Skip to main content
The 3ngram MCP server exposes the following unified search tools. Every entry is generated from the tool’s source signature and docstring, so this page never drifts from the backend.
Required parameters are marked with the required attribute. Optional parameters show their default value.

search_unified

Search Unified · read-only · non-destructive · idempotent · closed-world Default search across memories AND indexed content chunks in one call. Use this tool first. Specialist alternatives remain available for explicit narrowing: search_memories (memories only, richer filters like status / due_before / tag) and search_content (content chunks only, source_filter / source_type by origin). Each hit carries a source_type tag ("memory" or "content_chunk") so the caller can reason about provenance without a second round-trip. Per-leg scores are min-max normalized to [0, 1] before merging so similarity_floor applies uniformly across stores. Ranking internals live in the existing sync DB helpers — this tool does not re-implement cosine / BM25 / recall-boost / time-decay. Dedup (ADR-002 §Q3): chunks whose id appears in memories.promoted_from_chunk_id for the current user are hidden so content promoted into an atomic reference memory isn’t double-counted. Pre-#2899 the FK column is absent and dedup becomes a no-op — the tool still returns correctly-tagged results. Returns: str Source: backend/src/engram/mcp/tools/search/unified.py

Parameters

query
str
required
Natural language query. Embedded once, reused across legs.
limit
int
default:"10"
Max total results to return after merge (default 10).
source_type
Literal['memory', 'content', 'all']
default:"'all'"
Which stores to search. "all" (default) fans across memories + content chunks; "memory" only hits the memories leg; "content" only hits the chunks leg.
memory_type
str | None
default:"None"
Restrict the memory leg to a specific type (decision, commitment, blocker, preference, pattern, note, event. Legacy alias: context). Ignored when source_type="content".
atomic_only
bool
default:"False"
When True, return only memories with atomic = TRUE (ADR-002 standing references: protocols, playbooks, routines). Content chunk results are skipped because chunks are not atomic memories.
scope
str | None
default:"None"
Optional life-context filter ("personal" / "work").
similarity_floor
float
default:"0.3"
Drop merged results with normalized score below this threshold. Range [0.0, 1.0], default 0.3 matches the specialist tools. Zero disables the filter.