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
Natural language query. Embedded once, reused across legs.
Max total results to return after merge (default 10).
Which stores to search.
"all" (default) fans across memories + content chunks; "memory" only hits the memories leg; "content" only hits the chunks leg.Restrict the memory leg to a specific type (decision, commitment, blocker, preference, pattern, note, event. Legacy alias: context). Ignored when
source_type="content".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.Optional life-context filter (
"personal" / "work").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.