Phase 3.5 extraction & assembly

Real search_memory / write_memory MCP tools over memory HTTP — metadata.mcp_source=mcp_explicit, fail-closed backend errors, MEMORY_WRITE only.

Milestone 3.5.E.2 — search_memory and write_memory Tools

Status: Completed 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 and write_memory call the memory service HTTP API so authz and the 9-step write pipeline stay single-sourced. Provenance for MCP writes is recorded as metadata.mcp_source="mcp_explicit" (ADR-0050 stub contracts; real pipeline is the memory service).


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 (services/mcp-memory/)
  • Memory service HTTP (POST /v1/memories, POST /v1/memories/search)

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 via memory HTTP. Confidence defaults to 0.6. Write authorization is the existing MEMORY_WRITE permission bit only.


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_memory and write_memory call memory HTTP (no duplicated write/search pipeline logic)
  • Explicit JSON schemas committed, unit-tested against valid and malformed inputs
  • metadata.mcp_source="mcp_explicit" on create payload, verified by test
  • Confidence default 0.6 and MEMORY_WRITE gating unit tested
  • Repo guards / CI checks still pass

Prerequisites

  • Milestone 3.5.E.1 (MCP server skeleton)
  • Phase 3 memory service (write + search HTTP)
Edit on GitHub

Last updated on