Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

System overview

One binary, three processes

memo-mcp is one statically linked Go binary (CGO_ENABLED=0, about 30 MB). The same binary runs in three roles, which are separate processes that share only the database file:

RoleStarted byTalks overLifetime
MCP server (memo-mcp or memo-mcp serve)The MCP client (Claude Code, Claude Desktop, …)stdio: JSON-RPC on stdin/stdout, logs on stderrAs long as the client session
Web UI (memo-mcp ui)An operatorHTTP on a loopback port, GET onlyUntil Ctrl-C
CLI (memo-mcp <command>)An operator or a scriptTerminalOne command

Each MCP client session usually starts its own server process. Several processes can hold the same file open at once; SQLite WAL mode and a 5-second busy timeout serialise writers.

 MCP client ── stdio ──▶ memo-mcp serve ─┐
 operator ── browser ──▶ memo-mcp ui ────┼──▶ $MEMO_HOME/kb/<name>.db  (SQLite, WAL)
 operator ── shell ────▶ memo-mcp <cmd> ─┘
                                          └─▶ ~/.cache/memo-mcp/models  (embedding models)

Inside the process

PackageResponsibility
internal/serverThe ten MCP tools and the memo:// resources; request middleware (metrics, logs, call log)
internal/cliCommands, configuration resolution, serve and UI wiring
internal/retrieveThe search pipeline: arms, fusion, recency, cutoff, budget, explain
internal/kbSchema and migrations, ingest, facts, trust, time, graph tables, pages, export
internal/embeddingThe model registry, download, in-process inference (hugot / GoMLX, pure-Go ONNX)
internal/graph, internal/compactEntity extraction and resolution; compaction work items and checks
internal/uiThe read-only web UI (html/template, embedded assets)
internal/obsMetrics registry, Prometheus exposition, logging setup

The ten MCP tools

ToolWrites?Purpose
ingestyesStore a markdown document with provenance; same content is a no-op, changed content a new revision
searchno*Hybrid search with optional per-result explanations
readnoDereference a memo:// address as a passage, section or document
rememberyesRecord one fact with evidence and validity dates; supersedes corrects an old one
forgetyesRetire a document or fact with a reason (agent-written records only)
promotevia a humanAsk a human to raise trust, through an elicitation dialog or a CLI command
explorenoWalk the entity graph from one name
compactwork itemsPropose pages, refreshes, conflict and merge decisions, duplicates
submityesHand back a page or a decision for a work item; checked before it is stored
statusnoNamespaces, model, pending vectors, jobs, graph and page counts

* search writes only to the opt-in query log.

Resources mirror the addresses (memo://doc/{id}, memo://chunk/{id}, …), and memo://index returns a one-line-per-document index under 8 KB.

The one network call

The first time a process needs an embedding model that is not cached, it downloads the model files from Hugging Face into ~/.cache/memo-mcp/models. Nothing else in the default configuration opens an outbound connection. The optional Ollama executor and the --metrics-addr listener are explicit opt-ins, and both are loopback-only by default. See Air-gapped installs to avoid even the download.

Design reference: architecture §1–§4.