### Initialize ICM for All Tools Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Installs all necessary configurations and tools for ICM integration. Use this for a comprehensive setup. ```bash icm init --mode all ``` -------------------------------- ### Install ICM via Script Source: https://github.com/rtk-ai/icm/blob/main/README_pt.md Quickly install ICM by downloading and executing an installation script. This method is suitable for a fast setup. ```bash curl -fsSL https://raw.githubusercontent.com/rtk-ai/icm/main/install.sh | sh ``` -------------------------------- ### Zed MCP Configuration Example Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Example JSON configuration for setting up ICM as a context server in Zed. ```json { "context_servers": { "icm": { "command": { "path": "/path/to/icm", "args": ["serve"] } } } } ``` -------------------------------- ### Install and Initialize ICM Source: https://github.com/rtk-ai/icm/blob/main/docs/product.md Install the ICM tool using Homebrew and initialize it for your agent. This sets up permanent memory for your agent with two simple commands. ```bash brew tap rtk-ai/tap && brew install icm icm init ``` -------------------------------- ### Cursor MCP and Skill Setup Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Initializes ICM for MCP server and skill modes in Cursor. This installs the necessary MCP configuration and a persistent memory rule. ```bash icm init --mode mcp ``` ```bash icm init --mode skill # Installs ~/.cursor/rules/icm.mdc ``` -------------------------------- ### Install ICM from Source Source: https://github.com/rtk-ai/icm/blob/main/README_pt.md Install ICM directly from its source code using Cargo. This requires Rust and Cargo to be installed on your system. ```bash cargo install --path crates/icm-cli ``` -------------------------------- ### Install ICM via Homebrew or Script Source: https://context7.com/rtk-ai/icm/llms.txt Install ICM using Homebrew for macOS/Linux or a quick install script. Ensure Rust is installed if building from source. ```bash # Homebrew (macOS / Linux) brew tap rtk-ai/tap && brew install icm ``` ```bash # Quick install script curl -fsSL https://raw.githubusercontent.com/rtk-ai/icm/main/install.sh | sh ``` ```bash # From source cargo install --path crates/icm-cli ``` -------------------------------- ### Amp MCP and Skill Setup Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Initializes ICM for MCP server and skill modes in Amp. This installs the MCP configuration and recall/remember skills. ```bash icm init --mode mcp ``` ```bash icm init --mode skill # Installs /icm-recall and /icm-remember ``` -------------------------------- ### Initialize ICM for Specific Modes Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Installs ICM integration for a specific mode. Choose the mode that suits your needs. ```bash icm init --mode mcp # MCP server configs (default) ``` ```bash icm init --mode cli # Inject instructions into CLAUDE.md, AGENTS.md, etc. ``` ```bash icm init --mode skill # Slash commands & rules ``` ```bash icm init --mode hook # Claude Code hooks + OpenCode plugin ``` -------------------------------- ### OpenAI Codex CLI MCP Configuration Example Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Example TOML configuration for setting up ICM as an MCP server in OpenAI Codex CLI. ```toml [mcp_servers.icm] command = "/path/to/icm" args = ["serve"] ``` -------------------------------- ### OpenCode MCP and Hook Setup Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Initializes ICM for MCP server and hook modes in OpenCode. This sets up the MCP server configuration and installs a JavaScript plugin with hooks for event handling. ```bash icm init --mode mcp # MCP server config ``` ```bash icm init --mode hook # Installs JS plugin with hooks ``` -------------------------------- ### Initialize ICM Configuration Source: https://github.com/rtk-ai/icm/blob/main/README_pt.md Automatically detect and configure all supported tools for ICM integration with a single command. This simplifies the setup process. ```bash icm init ``` -------------------------------- ### Generic MCP Configuration Source: https://github.com/rtk-ai/icm/blob/main/README_pt.md Example of how to configure ICM for any MCP client. This specifies the command and arguments to run ICM. ```bash command = "icm", args = ["serve"] ``` -------------------------------- ### Install ICM via Homebrew Source: https://github.com/rtk-ai/icm/blob/main/README_pt.md Install ICM using Homebrew on macOS or Linux. Ensure you have Homebrew installed. ```bash brew tap rtk-ai/tap && brew install icm ``` -------------------------------- ### Manual ICM Serve Setup with Compact Mode Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md This JSON configuration enables compact mode for the ICM serve command, resulting in shorter responses and reduced token usage. Useful for optimizing performance. ```json { "command": "icm", "args": ["serve", "--compact"], "env": {} } ``` -------------------------------- ### Initialize ICM and Configure AI Tools Source: https://context7.com/rtk-ai/icm/llms.txt Automatically detect and configure all supported AI tools with a single command. Manual setup for specific tools like Claude Code is also shown. ```bash # Auto-detect and configure all supported AI tools icm init ``` ```bash # Manual Claude Code setup claude mcp add icm -- icm serve ``` -------------------------------- ### Manual ICM Serve Setup Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Use this JSON configuration to manually set up the ICM serve command for MCP-compatible tools. This is useful for tools not automatically detected. ```json { "command": "icm", "args": ["serve"], "env": {} } ``` -------------------------------- ### Install ICM via Homebrew or Script Source: https://github.com/rtk-ai/icm/blob/main/README.md Install ICM using the Homebrew package manager on macOS or Linux, or use the provided script for a quick installation. Ensure you have the necessary permissions. ```bash # Homebrew (macOS / Linux) brew tap rtk-ai/tap && brew install icm # Quick install curl -fsSL https://raw.githubusercontent.com/rtk-ai/icm/main/install.sh | sh ``` -------------------------------- ### Initialize SvelteKit App Source: https://github.com/rtk-ai/icm/blob/main/crates/icm-cli/web/dist/index.html This script initializes the SvelteKit application by importing necessary modules and starting the app within its parent element. It's typically found in the main HTML file. ```javascript { __sveltekit_dpszmi = { base: "" }; const element = document.currentScript.parentElement; Promise.all([ import("/_app/immutable/entry/start.Cvp1pkmx.js"), import("/_app/immutable/entry/app.B5FB9QcJ.js") ]).then(([ kit, app ]) => { kit.start(app, element); }); } ``` -------------------------------- ### Install ICM Hooks Source: https://context7.com/rtk-ai/icm/llms.txt Install hooks for automatic memory extraction and context injection. Use `icm init --mode hook` to install all hooks automatically, or test individual hooks manually by piping JSON input to `icm hook `. ```bash # Install all hooks automatically icm init --mode hook # Manual hook testing (reads JSON from stdin) echo '{"tool_name":"Bash","tool_input":{"command":"git commit -m \"Fix auth bug\""}}' | icm hook post # Hook types installed in ~/.claude/settings.json: # 1. SessionStart: Inject wake-up pack at session start # icm hook start --max-tokens 500 # 2. PreToolUse: Auto-allow icm CLI commands (no permission prompt) # icm hook pre # 3. PostToolUse: Extract facts every N tool calls # icm hook post --every 15 # 4. PreCompact: Extract memories before context compression # icm hook compact # 5. UserPromptSubmit: Inject recalled context at prompt start # icm hook prompt ``` -------------------------------- ### VS Code / GitHub Copilot MCP and CLI Setup Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Initializes ICM for MCP server and CLI modes for VS Code and GitHub Copilot. This sets up the MCP server configuration and injects instructions into Copilot's configuration file. ```bash icm init --mode mcp # MCP server for VS Code ``` ```bash icm init --mode cli # Injects instructions into .github/copilot-instructions.md ``` -------------------------------- ### Example of Shared Knowledge with ICM Source: https://github.com/rtk-ai/icm/blob/main/docs/product.md Illustrates how ICM can store and recall architectural context, providing new team members' agents with immediate project understanding. This is visualized as a dependency graph. ```text Memoir: "backend-architecture" ├── user-service ──depends_on──► postgres │ ──depends_on──► redis ├── api-gateway ──depends_on──► user-service │ ──depends_on──► auth-middleware ├── auth-middleware ──part_of──► api-gateway └── postgres ──superseded_by──► cockroachdb (planned Q3) ``` -------------------------------- ### Start a Transcript Session Source: https://github.com/rtk-ai/icm/blob/main/README.md Initiates a new session for recording verbatim transcripts of agent interactions. The session ID is returned for subsequent recording commands. ```bash SID=$(icm transcript start-session --agent claude-code --project myapp) ``` -------------------------------- ### Generate Wake-up Pack for Session Injection Source: https://context7.com/rtk-ai/icm/llms.txt Use 'icm wake-up' to create a summary package of project context for session start injection, with options for token limits and format. ```bash # Build wake-up pack for session start injection icm wake-up --project api --max-tokens 500 --format markdown # Output: # ## Identity # - User prefers TypeScript, comprehensive error handling # # ## Critical decisions (project: api) # - Use PostgreSQL with JSONB for flexible schema # - JWT auth with 15-minute access tokens ``` -------------------------------- ### Roo Code MCP and Skill Setup Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Initializes ICM for MCP server and skill modes in Roo Code. This installs the MCP configuration and a rule file for persistent memory. ```bash icm init --mode mcp ``` ```bash icm init --mode skill # Installs ~/.roo/rules/icm.md ``` -------------------------------- ### Windsurf MCP and CLI Setup Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Initializes ICM for MCP server and CLI modes in Windsurf. This configures the MCP server and injects instructions into project-specific rule files. ```bash icm init --mode mcp # MCP server ``` ```bash icm init --mode cli # Injects instructions into .windsurfrules ``` -------------------------------- ### Claude Desktop MCP Setup Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Initializes ICM for MCP server mode in Claude Desktop. Ensure your configuration file is updated. ```bash icm init --mode mcp ``` -------------------------------- ### Configure Embeddings Model Source: https://github.com/rtk-ai/icm/blob/main/README.md Example TOML configuration for setting the embeddings model, such as 'intfloat/multilingual-e5-base'. ```toml [embeddings] ``` -------------------------------- ### Example of Session Continuity with ICM Source: https://github.com/rtk-ai/icm/blob/main/docs/product.md Demonstrates how ICM automatically stores decisions and fixes, allowing agents to recall context across sessions without re-reading files. This reduces context token usage and agent turns. ```text Session 1 (Friday): "I chose PostgreSQL because we need JSONB for flexible schemas" "The auth service uses JWT with 24h expiry, refresh tokens in Redis" "Fixed: connection pool exhaustion under load — switched to PgBouncer" → All stored in ICM automatically Session 47 (3 weeks later): Agent: "Based on your previous decision to use PostgreSQL with JSONB..." → Recalls without re-reading any file ``` -------------------------------- ### OpenAI Codex CLI MCP and CLI Setup Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Initializes ICM for MCP server (TOML config) and CLI modes for OpenAI Codex CLI. This injects instructions into AGENTS.md. ```bash icm init --mode mcp # TOML config ``` ```bash icm init --mode cli # Injects into AGENTS.md ``` -------------------------------- ### Recall Memories by Topic and Keyword Source: https://github.com/rtk-ai/icm/blob/main/docs/guide.md Recalls memories. The first example recalls based on a general query, while the second and third recall by specifying a topic and/or keywords. ```bash # Recall relevant context icm recall "API design choices" icm recall "nginx" --topic "errors-resolved" icm recall "database" --keyword "postgres" ``` -------------------------------- ### Start ICM Transcript Session Source: https://github.com/rtk-ai/icm/blob/main/README.md Initiate a new session for capturing verbatim messages. Returns a `session_id` for subsequent use. ```bash icm_transcript_start_session ``` -------------------------------- ### Start and Record Transcript Session Source: https://context7.com/rtk-ai/icm/llms.txt Initiates a transcript session for verbatim capture and records messages from different roles (user, assistant, tool). ```Bash SID=$(icm transcript start-session --agent claude-code --project myapp) icm transcript record -s "$SID" -r user -c "Why did we choose Postgres?" icm transcript record -s "$SID" -r assistant -c "We chose PostgreSQL for native JSONB support and BRIN indexes." icm transcript record -s "$SID" -r tool -c '{"cmd":"psql -c SELECT version()"}' -t Bash --tokens 42 ``` -------------------------------- ### Initialize ICM with Different Modes Source: https://github.com/rtk-ai/icm/blob/main/docs/guide.md Initialize ICM for various environments. Use `--mode skill` for slash commands and rules, `--mode hook` for the Claude Code PostToolUse hook, or `--mode cli` for manual CLI setup instructions. ```bash icm init # Auto-detect and configure MCP for all found tools icm init --mode skill # Install slash commands and rules icm init --mode hook # Install Claude Code PostToolUse hook for auto-extraction icm init --mode cli # Show manual CLI setup instructions ``` -------------------------------- ### Initialize Auto-Extraction and Auto-Recall Hooks Source: https://github.com/rtk-ai/icm/blob/main/README.md Installs hooks for auto-extraction and auto-recall for supported tools. This command sets up the ICM CLI to automatically manage context and facts during AI interactions. ```bash icm init --mode hook ``` -------------------------------- ### Build Critical Facts Pack with icm_wake_up Source: https://context7.com/rtk-ai/icm/llms.txt This tool constructs a compact pack of critical facts for LLM system-prompt injection at session start. Configure project, token limits, format, and whether to include user preferences. The response includes identity, critical decisions, and high-priority context. ```json { "name": "icm_wake_up", "arguments": { "project": "api", "max_tokens": 500, "format": "markdown", "include_preferences": true } } ``` ```text // Response: // ## Identity // - User prefers TypeScript with strict mode // - Always include comprehensive error handling // - Use semantic versioning for all packages // // ## Critical decisions (project: api) // - Use PostgreSQL with JSONB for flexible schema evolution // - JWT authentication with 15-minute access tokens, 7-day refresh // - All API endpoints require rate limiting via Kong // // ## High-priority context // - Redis cluster deployed on port 6380 (not default 6379) // - CI/CD uses GitHub Actions with staging deploy on PR merge // Selects critical/high memories, ranks by importance × recency × weight, // truncates to token budget. Preferences always included unless disabled. ``` -------------------------------- ### Get Global Memory Statistics Source: https://github.com/rtk-ai/icm/blob/main/README.md Retrieve overall statistics for all stored memories. ```bash icm_memory_stats ``` -------------------------------- ### Gemini Code Assist MCP and CLI Setup Source: https://github.com/rtk-ai/icm/blob/main/docs/integrations.md Initializes ICM for MCP server and CLI modes in Gemini Code Assist. This configures the MCP server and injects instructions into Gemini's configuration file. ```bash icm init --mode mcp ``` ```bash icm init --mode cli # Injects into ~/.gemini/GEMINI.md ``` -------------------------------- ### ICM Store Nudge Message Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Example of a server-appended hint when a certain number of non-store tool calls have been made consecutively. This message encourages saving context. ```plaintext [ICM: 12 tool calls since last store. Consider saving important context.] ``` -------------------------------- ### Add ICM MCP for Claude Code Source: https://github.com/rtk-ai/icm/blob/main/README_es.md Manually configure Claude Code to use ICM as its MCP. The 'serve' command starts the ICM server, and the '--compact' flag enables a more token-efficient mode. ```bash claude mcp add icm -- icm serve ``` ```bash claude mcp add icm -- icm serve --compact ``` -------------------------------- ### MCP Server Configuration for AI Tools Source: https://context7.com/rtk-ai/icm/llms.txt Configure the ICM MCP server for various AI tools by specifying the command and arguments in their respective configuration files. This example shows configurations for Claude Code, Cursor, VS Code, Zed, and OpenAI Codex CLI. ```json // Claude Code / Claude Desktop (~/.claude.json) { "mcpServers": { "icm": { "command": "icm", "args": ["serve", "--compact"] } } } ``` ```json // Cursor (~/.cursor/mcp.json) { "mcpServers": { "icm": { "command": "/usr/local/bin/icm", "args": ["serve"] } } } ``` ```json // VS Code (~/Library/Application Support/Code/User/mcp.json) // Note: VS Code uses "servers" not "mcpServers" { "servers": { "icm": { "command": "icm", "args": ["serve"] } } } ``` ```json // Zed (~/.zed/settings.json) { "context_servers": { "icm": { "command": { "path": "/usr/local/bin/icm", "args": ["serve"] } } } } ``` ```toml // OpenAI Codex CLI (~/.codex/config.toml) [mcp_servers.icm] command = "icm" args = ["serve"] ``` -------------------------------- ### Initialize ICM in Skill Mode Source: https://github.com/rtk-ai/icm/blob/main/README_pt.md Initialize ICM to install slash commands and rules for specific tools like Claude Code, Cursor, Roo Code, and Amp. This enables enhanced AI agent capabilities. ```bash icm init --mode skill ``` -------------------------------- ### Learn Project Architecture Source: https://context7.com/rtk-ai/icm/llms.txt Use 'icm learn' to scan a project directory and build a knowledge graph (memoir) of its architecture. ```bash # Scan project directory and create memoir knowledge graph icm learn --dir ./my-project --name "my-project-arch" # Output: Learned my-project: 15 concepts, 8 links created ``` -------------------------------- ### Get ICM Transcript Statistics Source: https://github.com/rtk-ai/icm/blob/main/README.md Retrieve statistics about transcript sessions and messages. ```bash icm transcript stats ``` -------------------------------- ### Get Feedback Statistics Source: https://github.com/rtk-ai/icm/blob/main/README.md View statistics related to recorded feedback, including total counts and breakdowns by topic. ```bash icm_feedback_stats ``` -------------------------------- ### Create a Memoir Knowledge Container Source: https://github.com/rtk-ai/icm/blob/main/docs/guide.md Creates a new memoir, which is a permanent knowledge container, with a specified name and description. ```bash # Create a knowledge container icm memoir create -n "backend-arch" -d "Backend architecture decisions" ``` -------------------------------- ### Create a New Memoir Source: https://github.com/rtk-ai/icm/blob/main/README.md Initialize a new memoir, which acts as a container for structured knowledge. ```bash icm_memoir_create ``` -------------------------------- ### Create ICM Memoir Knowledge Graphs Source: https://context7.com/rtk-ai/icm/llms.txt Create new memoirs, which serve as containers for permanent knowledge graphs. Memoirs can be given a name and a description. ```bash # Create a new memoir (knowledge container) icm memoir create -n "backend-architecture" -d "System architecture decisions" ``` -------------------------------- ### Recall Context for Prompt Injection Source: https://github.com/rtk-ai/icm/blob/main/docs/guide.md Inject relevant memories into your session by recalling context based on a query. Use `--limit` to control the number of recalled items. This is used by the SessionStart hook for automatic context loading. ```bash icm recall-context "my-project backend API" icm recall-context "authentication" --limit 20 ``` -------------------------------- ### Injecting Recalled Memories into Ollama Prompt Source: https://github.com/rtk-ai/icm/blob/main/docs/product.md Shows how to use the `icm recall-context` command to retrieve project memories and inject them into the prompt for local LLMs like Ollama. This enhances recall accuracy for models without direct tool integration. ```bash # Inject recalled memories into the prompt context=$(icm recall-context "my-project") ollama run qwen2.5:14b "$context\n\nQuestion: How does auth work?" ``` -------------------------------- ### List and Show ICM Transcript Sessions Source: https://github.com/rtk-ai/icm/blob/main/README.md Use `list-sessions` to view available transcript sessions and `show` to replay a specific session's messages. Replace `$SID` with the actual session ID. ```bash icm transcript list-sessions --project myapp ``` ```bash icm transcript show "$SID" --limit 200 ``` -------------------------------- ### General MCP Client Configuration for ICM Source: https://github.com/rtk-ai/icm/blob/main/README.md This configuration applies to any MCP client, specifying 'icm' as the command and 'serve' as an argument. It's a general way to integrate ICM with various AI tools. ```text # Any MCP client: command = "icm", args = ["serve"] ``` -------------------------------- ### Recall Project Context for Prompts Source: https://context7.com/rtk-ai/icm/llms.txt Use 'icm recall-context' to retrieve relevant project information formatted for prompt injection. ```bash # Recall context formatted for prompt injection icm recall-context "backend API authentication" # Output (ready for prompt prepend): # ## Relevant Context # - [decisions-api] Chose JWT with refresh tokens for stateless auth # - [errors-resolved] Fixed token expiry by adding clock skew tolerance # - [preferences] Prefer 15-minute access token lifetime ``` -------------------------------- ### Build Project with Embeddings Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Use this command for a full build including embeddings. This process can be time-consuming and results in a larger debug build. ```bash cargo build --release # Full build with embeddings ``` -------------------------------- ### Create a Permanent Memoir Source: https://github.com/rtk-ai/icm/blob/main/README.md Creates a new permanent knowledge graph (memoir) with a name and description. Memoirs store long-term, structured knowledge. ```bash icm memoir create -n "system-architecture" -d "System design decisions" ``` -------------------------------- ### Show Memoir Details and Concepts Source: https://github.com/rtk-ai/icm/blob/main/README.md Display the details of a specific memoir, including all its associated concepts. ```bash icm_memoir_show ``` -------------------------------- ### Benchmark Local LLMs with Ollama Source: https://github.com/rtk-ai/icm/blob/main/README.md Run a benchmark script to test ICM's performance with various local LLMs provided by Ollama. Specify the model to test. ```bash scripts/bench-ollama.sh qwen2.5:14b ``` -------------------------------- ### Search Concepts Across All Memoirs Source: https://context7.com/rtk-ai/icm/llms.txt Use 'search-all' to query for concepts across all available memoirs. ```bash icm memoir search-all "microservice" ``` -------------------------------- ### Run All Tests Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Execute all 110 tests across all crates to ensure the project's integrity. This includes unit, security, performance, UX, and integration tests. ```bash cargo test # 110 tests across all crates ``` -------------------------------- ### List All Memoirs Source: https://github.com/rtk-ai/icm/blob/main/README.md Display a list of all created memoirs. ```bash icm_memoir_list ``` -------------------------------- ### Run Linting Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Check code for style and potential errors using cargo clippy. The CI environment uses '-D warnings' for stricter linting. ```bash cargo clippy # Lint (CI uses -D warnings) ``` -------------------------------- ### SQL Store Constructors in Rust Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Provides constructors for the `SqliteStore`, allowing initialization with a file path, custom embedding dimensions, or for in-memory use during tests. ```rust SqliteStore::new(path: &Path) -> IcmResult // default 384d SqliteStore::with_dims(path: &Path, dims: usize) -> IcmResult // custom dimensions SqliteStore::in_memory() -> IcmResult // for tests ``` -------------------------------- ### SqliteStore Constructors Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Provides constructors for the `SqliteStore` implementation. ```APIDOC ## SqliteStore Constructors ### Description The `SqliteStore` is a concrete implementation of `MemoryStore` and `MemoirStore` using SQLite. The following constructors are available for creating instances of `SqliteStore`. ### Constructors - `SqliteStore::new(path: &Path) -> IcmResult`: Creates a new `SqliteStore` at the specified file path with default embedding dimensions (384d). - `SqliteStore::with_dims(path: &Path, dims: usize) -> IcmResult`: Creates a new `SqliteStore` at the specified file path with custom embedding dimensions. - `SqliteStore::in_memory() -> IcmResult`: Creates a new `SqliteStore` in memory, typically used for testing purposes. ``` -------------------------------- ### Initialize ICM in CLI Mode Source: https://github.com/rtk-ai/icm/blob/main/README.md Execute 'icm init --mode cli' to inject ICM instructions into the instruction files of various command-line tools, such as Claude Code, GitHub Copilot, and Gemini, improving their interaction with ICM. ```bash icm init --mode cli ``` -------------------------------- ### Display Active Configuration Source: https://github.com/rtk-ai/icm/blob/main/README_pl.md Use this command to view the currently active ICM configuration. The configuration file location varies by platform or can be specified by the $ICM_CONFIG environment variable. ```bash icm config # Wyświetl aktywną konfigurację ``` -------------------------------- ### List Memory Topics Source: https://github.com/rtk-ai/icm/blob/main/README.md Display a list of all topics that contain memories, along with the count of memories in each topic. ```bash icm_memory_list_topics ``` -------------------------------- ### Show Active ICM Configuration Source: https://github.com/rtk-ai/icm/blob/main/README.md Display the current active configuration settings for ICM using the `icm config` command. ```bash icm config # Show active config ``` -------------------------------- ### Consolidate Memories by Topic Source: https://github.com/rtk-ai/icm/blob/main/README.md Merge all memories associated with a specific topic into a single summary. ```bash icm_memory_consolidate ``` -------------------------------- ### Save Project Context Source: https://context7.com/rtk-ai/icm/llms.txt Use 'icm save-project' to manually save context about project activities, including importance and keywords. ```bash # Save context for current project icm save-project "Implemented user authentication with JWT" -i high -k "auth,jwt,security" ``` -------------------------------- ### Consolidate, Decay, and Prune ICM Memories Source: https://context7.com/rtk-ai/icm/llms.txt Manage memory lifecycle. Consolidate memories into a summary, optionally keeping originals. Manually apply decay or prune memories below a weight threshold. Preview pruning with --dry-run. ```bash # Consolidate all memories of a topic into a single summary icm consolidate --topic "errors-resolved" ``` ```bash # Keep originals alongside the consolidated summary icm consolidate --topic "errors-resolved" --keep-originals ``` ```bash # Manually apply decay to all memories (normally runs automatically) icm decay --factor 0.95 ``` ```bash # Preview what would be pruned (dry run) icm prune --threshold 0.2 --dry-run ``` ```text # Output: Would delete 3 memories below weight threshold 0.2 ``` ```bash # Actually prune low-weight memories icm prune --threshold 0.1 ``` -------------------------------- ### Auto-Recall Context for Current Project Source: https://context7.com/rtk-ai/icm/llms.txt Use 'icm recall-project' to automatically recall context for the current project, with an option to limit the number of results. ```bash # Auto-recall for current project (detects from PWD/git remote) icm recall-project --limit 10 ``` -------------------------------- ### ICM Store Nudge and Compact Mode Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Describes the 'Store Nudge' feature and the 'Compact Mode' for reducing response token usage. ```APIDOC ## Store Nudge and Compact Mode ### Store Nudge The server tracks consecutive non-store tool calls. After 10 calls without `icm_memory_store`, it appends a hint to the response: ``` [ICM: 12 tool calls since last store. Consider saving important context.] ``` Counter resets on every `icm_memory_store`. ### Compact Mode `icm serve --compact` produces shorter responses: - Store: `ok:` instead of `Stored memory: ` - Recall: `[topic] summary\n` per line instead of multi-line verbose format Saves ~40% tokens on recall output. ``` -------------------------------- ### Display Current ICM Configuration Source: https://github.com/rtk-ai/icm/blob/main/docs/guide.md Show the current ICM configuration settings, including the embedding model being used. This command helps in understanding the active settings for semantic search and other features. ```bash icm config # Show current settings ``` -------------------------------- ### ICM MCP Tools Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Lists the available tools within the ICM MCP server, their required arguments, and optional arguments. ```APIDOC ## ICM MCP Tools This table details the tools available through the ICM MCP server, including their arguments. ### Tool Dispatch | Tool | Required args | Optional args | |------|--------------|---------------| | `icm_memory_store` | `topic`, `content` | `importance`, `keywords[]`, `raw_excerpt` | | `icm_memory_recall` | `query` | `topic`, `keyword`, `limit` | | `icm_memory_update` | `id`, `content` | `importance`, `keywords[]` | | `icm_memory_forget` | `id` | — | | `icm_memory_consolidate` | `topic`, `summary` | — | | `icm_memory_list_topics` | — | — | | `icm_memory_stats` | — | — | | `icm_memory_health` | — | `topic` | | `icm_memory_embed_all` | — | `topic` | | `icm_memoir_create` | `name` | `description` | | `icm_memoir_list` | — | — | | `icm_memoir_show` | `name` | — | | `icm_memoir_add_concept` | `memoir`, `name`, `definition` | `labels` | | `icm_memoir_refine` | `memoir`, `name`, `definition` | — | | `icm_memoir_search` | `memoir`, `query` | `label`, `limit` | | `icm_memoir_search_all` | `query` | `limit` | | `icm_memoir_link` | `memoir`, `from`, `to`, `relation` | — | | `icm_memoir_inspect` | `memoir`, `name` | `depth` | ``` -------------------------------- ### Check Code Formatting Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Verify that the code adheres to the project's formatting standards using cargo fmt --check. This ensures consistent code style. ```bash cargo fmt --check # Format check ``` -------------------------------- ### ICM Architecture Summary Source: https://github.com/rtk-ai/icm/blob/main/docs/product.md Overview of the ICM architecture, highlighting its components like storage, search, embeddings, protocol, and extraction methods. It emphasizes a single binary, local operation, and no external dependencies. ```text Single binary (icm) ├── Storage: SQLite + FTS5 + sqlite-vec (cosine) ├── Search: 30% BM25 + 70% cosine similarity ├── Embeddings: fastembed, multilingual-e5-base (768d, 100+ langs) ├── Protocol: MCP JSON-RPC 2.0 over stdio ├── Extraction: rule-based pattern matching (zero LLM cost) └── Tests: 110 tests (unit, security, performance, UX, integration) ``` -------------------------------- ### ICM CLI Commands Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md List of available commands for the ICM CLI tool, covering memory management, server operations, benchmarking, and configuration. ```plaintext icm store Store a memory icm recall Search memories icm forget Delete a memory by ID icm topics List all topics icm stats Global statistics icm health Per-topic hygiene report icm decay Apply temporal decay icm prune Delete low-weight memories icm consolidate Merge topic into single summary icm embed Backfill embeddings icm extract Rule-based fact extraction from stdin/text icm recall-context Format recalled memories for prompt injection icm memoir Subcommands: create, show, add-concept, refine, search, search-all, link, inspect, list icm init Auto-configure 14 AI tools (mcp, cli, skill, hook modes) icm serve Start MCP server (--compact for shorter output) icm config Show active configuration icm bench Storage performance benchmark icm bench-recall Knowledge retention benchmark icm bench-agent Multi-session agent efficiency benchmark ``` -------------------------------- ### Inspect Memoir Concept and Neighborhood Source: https://github.com/rtk-ai/icm/blob/main/README.md Examine a specific concept within a memoir and its immediate graph neighborhood using Breadth-First Search (BFS). ```bash icm_memoir_inspect ``` -------------------------------- ### ICM Store Search Pipeline Logic Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Illustrates the search pipeline within the ICM store, detailing how queries are processed with or without an embedder, including hybrid search (FTS5 and cosine similarity) and fallbacks. ```text Query arrives │ ├─ Has embedder? ──► Hybrid search │ ├─ FTS5 BM25 (30% weight) │ ├─ Cosine similarity via sqlite-vec (70% weight) │ └─ Merge + deduplicate by memory ID │ └─ No embedder ──► FTS5 search │ └─ No FTS results? ──► Keyword LIKE fallback ``` -------------------------------- ### ICM CLI Commands Source: https://github.com/rtk-ai/icm/blob/main/docs/architecture.md Lists the available commands for the ICM command-line interface. ```APIDOC ## ICM CLI Commands This section lists the available commands for the `icm-cli` binary. ### Commands - `icm store`: Store a memory - `icm recall`: Search memories - `icm forget`: Delete a memory by ID - `icm topics`: List all topics - `icm stats`: Global statistics - `icm health`: Per-topic hygiene report - `icm decay`: Apply temporal decay - `icm prune`: Delete low-weight memories - `icm consolidate`: Merge topic into single summary - `icm embed`: Backfill embeddings - `icm extract`: Rule-based fact extraction from stdin/text - `icm recall-context`: Format recalled memories for prompt injection - `icm memoir`: Subcommands: create, show, add-concept, refine, search, search-all, link, inspect, list - `icm init`: Auto-configure 14 AI tools (mcp, cli, skill, hook modes) - `icm serve`: Start MCP server (--compact for shorter output) - `icm config`: Show active configuration - `icm bench`: Storage performance benchmark - `icm bench-recall`: Knowledge retention benchmark - `icm bench-agent`: Multi-session agent efficiency benchmark ``` -------------------------------- ### ICM Agent Benchmark Source: https://github.com/rtk-ai/icm/blob/main/README_pl.md This benchmark evaluates the efficiency of the ICM agent across multiple sessions, comparing performance with and without ICM's memory recall capabilities. It measures turns, input context size, and cost, demonstrating significant gains in later sessions when ICM recalls information instead of re-reading files. ```bash icm bench-agent --sessions 10 --model haiku ``` -------------------------------- ### Add ICM Serve Command with Compact Mode to Claude MCP Source: https://github.com/rtk-ai/icm/blob/main/README.md Configure the Claude MCP client to use 'icm serve' with the '--compact' flag for shorter responses, which helps save tokens. This is useful for optimizing resource usage. ```bash # Compact mode (shorter responses, saves tokens) claude mcp add icm -- icm serve --compact ``` -------------------------------- ### Search Across All Memoirs Source: https://github.com/rtk-ai/icm/blob/main/README.md Execute a full-text search across all available memoirs. ```bash icm_memoir_search_all ``` -------------------------------- ### Run Knowledge Retention Benchmark Source: https://github.com/rtk-ai/icm/blob/main/README.md Execute the knowledge retention benchmark with a specified model. This tests ICM's ability to recall specific facts from dense technical documents across sessions. ```bash icm bench-recall --model haiku ``` -------------------------------- ### Add Concepts to a Memoir Source: https://github.com/rtk-ai/icm/blob/main/README.md Adds concepts with names, descriptions, and labels to a specified memoir. Labels can be used for filtering and organizing concepts. ```bash icm memoir add-concept -m "system-architecture" -n "auth-service" \n -d "Handles JWT tokens and OAuth2 flows" -l "domain:auth,type:service" ``` -------------------------------- ### Preview Fact Extraction (Dry Run) Source: https://context7.com/rtk-ai/icm/llms.txt Use '--dry-run' with 'icm extract' to preview extracted facts without saving them to a topic. ```bash # Preview extraction without storing (dry run) echo "Switched from REST to GraphQL for the new dashboard API" | icm extract -p frontend --dry-run # Output: # [DRY RUN] Would extract: # - topic: decisions-frontend # content: Switched from REST to GraphQL for the new dashboard API # importance: high # keywords: graphql, rest, api, dashboard ```