Search Memory
Use Nowledge Mem proactively when prior knowledge would materially improve the answer.
Strong Signals
Search when:
- the user references previous work, a prior fix, or an earlier decision
- the task resumes a named feature, bug, refactor, incident, or subsystem
- a debugging pattern resembles something solved earlier
- the user asks for rationale, preferences, procedures, or recurring workflow details
- the user uses implicit recall language: "that approach", "like before"
Contextual signals — consider searching when:
- complex debugging where prior context would narrow the search space
- architecture discussion that may intersect with past decisions
- domain-specific conventions the user has established before
- the current result is ambiguous and past context would make the answer sharper
Token-Efficient Retrieval Routing & Graph Neighborhoods
To minimize token usage, avoid bloating the conversation context, and prevent terminal permission prompts, follow this interface hierarchy:
- Nowledge FS (MCP
mem_fs) - Best for Unified File Actions:
- For listing, searching, checking size, or loading chunks of memories, threads, wiki pages, or documents, call the MCP
mem_fs tool.
- Use the "Start broad, then narrow" pattern:
- Run
mem_fs with command: "recall", path: "/memories", query: "..." for semantic searches.
- Run
mem_fs with command: "grep", query: "..." to search text across memories, threads, and library sources.
- Run
mem_fs with command: "stat" to check the file size and line counts cheaply before loading.
- Run
mem_fs with command: "cat", path: "...", line: START, lines: COUNT to fetch only the required window, avoiding context bloat.
- Specialized MCP Tools:
- Use
memory_search for durable knowledge queries.
- Use
thread_search followed by thread_fetch_messages (always passing a small limit like 5 or 10) to paginatedly check thread histories.
- Use
memory_neighbors or explore_graph to expand graph neighborhoods selectively.
- CLI Fallback (Only if MCP is unavailable):
- Important:
nmem fs CLI commands take positional arguments (do NOT pass --query or --path flags):
- Recall:
nmem fs recall "<query>"
- Read/Cat:
nmem fs cat "<path>" --line START --lines COUNT
- Grep:
nmem fs grep "<pattern>" <path>
- Stat/Find/Ls:
nmem fs stat "<path>", nmem fs find "<query>", nmem fs ls /
- For direct question asking/synthesis across all sources:
nmem ask "question" (use --ephemeral to avoid creating a Timeline entry, and --json for structured sources).
- For memory/thread lookups:
nmem --json m search "<query>" or nmem --json t search "<query>" (with pagination).
Prefer the smallest retrieval surface that answers the question.
If the runtime already knows the active project or agent lane, add --space "<space name>" to these commands.
Mention source threads when they add useful historical context.
1---2name: nmem-memory-search3description: Search the user's personal knowledge base when past insights would improve the response. Trigger proactively for continuity, recurring bugs, design rationale, and remembered workflows. Triggered by /nmem-memory-search.4---56# Search Memory78Use Nowledge Mem proactively when prior knowledge would materially improve the answer.910## Strong Signals1112Search when:1314- the user references previous work, a prior fix, or an earlier decision15- the task resumes a named feature, bug, refactor, incident, or subsystem16- a debugging pattern resembles something solved earlier17- the user asks for rationale, preferences, procedures, or recurring workflow details18- the user uses implicit recall language: "that approach", "like before"1920**Contextual signals — consider searching when:**2122- complex debugging where prior context would narrow the search space23- architecture discussion that may intersect with past decisions24- domain-specific conventions the user has established before25- the current result is ambiguous and past context would make the answer sharper2627## Token-Efficient Retrieval Routing & Graph Neighborhoods2829To minimize token usage, avoid bloating the conversation context, and prevent terminal permission prompts, follow this interface hierarchy:30311. **Nowledge FS (MCP `mem_fs`) - Best for Unified File Actions**:32 - For listing, searching, checking size, or loading chunks of memories, threads, wiki pages, or documents, call the MCP `mem_fs` tool.33 - Use the **"Start broad, then narrow"** pattern:34 - Run `mem_fs` with `command: "recall", path: "/memories", query: "..."` for semantic searches.35 - Run `mem_fs` with `command: "grep", query: "..."` to search text across memories, threads, and library sources.36 - Run `mem_fs` with `command: "stat"` to check the file size and line counts cheaply before loading.37 - Run `mem_fs` with `command: "cat", path: "...", line: START, lines: COUNT` to fetch only the required window, avoiding context bloat.382. **Specialized MCP Tools**:39 - Use `memory_search` for durable knowledge queries.40 - Use `thread_search` followed by `thread_fetch_messages` (always passing a small `limit` like `5` or `10`) to paginatedly check thread histories.41 - Use `memory_neighbors` or `explore_graph` to expand graph neighborhoods selectively.423. **CLI Fallback (Only if MCP is unavailable)**:43 - **Important**: `nmem fs` CLI commands take **positional arguments** (do NOT pass `--query` or `--path` flags):44 - Recall: `nmem fs recall "<query>"`45 - Read/Cat: `nmem fs cat "<path>" --line START --lines COUNT`46 - Grep: `nmem fs grep "<pattern>" <path>`47 - Stat/Find/Ls: `nmem fs stat "<path>"`, `nmem fs find "<query>"`, `nmem fs ls /`48 - For direct question asking/synthesis across all sources: `nmem ask "question"` (use `--ephemeral` to avoid creating a Timeline entry, and `--json` for structured sources).49 - For memory/thread lookups: `nmem --json m search "<query>"` or `nmem --json t search "<query>"` (with pagination).5051Prefer the smallest retrieval surface that answers the question.5253If the runtime already knows the active project or agent lane, add `--space "<space name>"` to these commands.5455Mention source threads when they add useful historical context.