Skip to content

Define the canonical extract / recall / remember MCP triad as the agent interface #15

Description

@harrymove-ctrl

Context

The local MCP server (packages/mcp/src/index.ts) exposes ~20 fine-grained tools (scrape_markdown, crawl_site, extract_brand, remember_site_snapshot, upload_proof_to_walrus, recall_site_context, query_site_memory, get_context_bundle, ...) and the hosted server (packages/mcp/src/hosted.ts) exposes a different read-only set via registerToolAliases. There is no single, stable triad an agent (or a Talus/Nexus node) can bind to. The roadmap (exec summary + §6) makes contextmem.extract / .recall / .remember the canonical capabilities to publish as Talus Tools. Note buildAgentReadableSite is already imported in index.ts but never wired into a tool.

Goal / user story

As an agent builder, I want three high-level, well-documented MCP tools — contextmem_extract, contextmem_recall, contextmem_remember — with stable typed I/O, so I can integrate ContextMEM in one step and have my calls map 1:1 to Talus Nexus DAG nodes, without learning 20 internal verbs.

Acceptance criteria

  • contextmem_extract accepts { target, mode?: 'auto'|'web'|'walrus', maxPages?, namespace? } and returns a stable JSON envelope { namespace, runId, target, pageCount, chunkGraphDigest, artifactDigest, summary } by composing crawlWebSite/scrapeWebPage/resolveWalrusTarget + buildAgentReadableSite + facts.
  • contextmem_remember accepts { runDir|runId, namespace?, storeOnWalrus?: boolean, whatChanged? } and unifies today's remember_site_snapshot + upload_proof_to_walrus + rememberStorageIndex, returning { namespace, writeMode, written, receipt?, memoryRef }.
  • contextmem_recall accepts { namespace, query, topK?, includeSources?: boolean } and returns { namespace, query, answer?, sources: [...], memory }, unifying recall_site_context / query_site_memory / get_context_bundle.
  • All three tools exist on BOTH the local (index.ts) and hosted (hosted.ts) servers with identical names and output shapes (hosted extract/remember may be gated/no-op where the Worker can't pack — return a typed unsupported envelope rather than throwing).
  • The ~20 existing tools remain registered as advanced aliases (reuse the registerToolAliases pattern) so nothing breaks, but tool descriptions point agents to the triad first.
  • A shared zod schema module exports the three input/output types so cli, mcp, and any Nexus tool-def import the same contract; unit tests assert the output envelope shape for each tool.

Implementation notes

  • Touch packages/mcp/src/index.ts, packages/mcp/src/hosted.ts, and add packages/mcp/src/triad.ts (or packages/core if shared with CLI) holding the zod I/O schemas + the composition functions.
  • MCP tool names cannot contain dots; use contextmem_extract|recall|remember as the MCP names and reserve the dotted contextmem.extract form for the Talus/Nexus node identifiers (document the mapping).
  • extract should reuse createRunId + the run-dir layout already produced (manifest.json, llms.txt), and surface chunkGraphDigest()/artifactDigest (from packProofBundle) since those are the verifiable anchors the receipt hook (separate issue) needs.
  • remember storage path is Node-only today (packProofBundle shells tar); on the hosted/Worker side return { storedOnWalrus: false, reason } until the Worker-side R2 zip packer lands — keep the contract identical so the receipt hook is uniform.
  • recall on hosted should delegate to the existing store.recallMemory + searchContext plumbing already in hosted.ts.
  • Keep output JSON-only (the text()/textResult() helpers) so Nexus can parse deterministically.

Sui Overflow angle

This triad is the agent-facing surface ContextMEM demos for Sui Overflow: a single, legible extract → remember → recall loop is what a Talus/Nexus DAG composes, and what the on-chain attribution receipt attaches to. Judges and agent builders see one clean Sui-native memory primitive instead of 20 verbs, and every node output already carries the digests that prove what was extracted/stored on Walrus.

Dependencies

None (foundational). Blocks: the on-chain attribution-receipt issue and the reference-agent-templates issue.

Part of the ContextMEM roadmap (#4) • Sui Overflow build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Demo-blocking: required for a working Sui Overflow demoagent-talusTalus/Nexus agent integration and attribution receiptsfeatureUser- or agent-facing capabilitymcpModel Context Protocol servers and tools

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions