Two core MCP tools with explicit hand-declared JSON schemas — search_memory calls ContextAssemblyService.SearchMemories gRPC, write_memory goes through the full 9-step write pipeline with source='mcp_explicit'.
Milestone 3.5.E.2 — search_memory and write_memory Tools
Status: Planned
Goal: Track E — MCP Tool Surface
Phase: 3.5 — Extraction & Context Assembly
Estimated effort: 3 days
Track: Track E — MCP Tool Surface
Depends on: Milestone 3.5.E.1 (MCP server skeleton)
Why This Milestone Exists
Expose the two core memory operations as MCP tools with explicit, hand-declared JSON schemas. search_memory calls the same ContextAssemblyService.SearchMemories gRPC RPC the proxy uses — identical ranking/scoring logic. write_memory goes through the identical 9-step write pipeline with source="mcp_explicit", not a shortcut (ADR-0050 stub contracts; real pipeline ADR when writers land).
Orientation (indicative)
Named paths, package layouts, libraries, schemas, env vars, and commands anywhere on this page are rough sketches for orientation — inspiration and a baseline, not a required change list.
During implementation, expect to:
- open the live tree and follow existing patterns before inventing new ones
- research current constraints (latency, tenancy, deploy shape, libraries) more deeply than this page can
- advance the design beyond the sketch where measurement or code reality says so
- land work in different filenames, merged packages, deferred docs, or new surfaces when the situation calls for it
Prefer outcomes over matching any particular file tree or command sequence.
Areas that may be involved (situational — not a checklist):
- MCP server surface
- Memory service / repositories
Design Decision: MCP Writes Use the Standard Pipeline
write_memory via MCP is not a fast-path insert. It goes through validate → PII → dedup → embed → near-dup → conflict → DB → cache → index. Confidence defaults to 0.6 (below extraction's typical 0.7+) unless the caller has memory:write:trusted permission.
Success signals
Outcome-oriented signals that the milestone is in good shape. Exact filenames, package layouts, and commands may differ from any sketches above.
-
search_memoryandwrite_memoryboth pass through existing pipelines with no duplicated logic - Explicit JSON schemas committed, unit-tested against valid and malformed inputs
-
source="mcp_explicit"visible inmemories.metadata, verified by test - Confidence-default and trusted-permission-bit behavior unit tested
- Repo guards / CI checks still pass
Prerequisites
- Milestone 3.5.E.1 (MCP server skeleton)
- Phase 3 memory service (write pipeline)
- Phase 3.5 Track C (context assembly — for SearchMemories)
Last updated on