Work / agent-memory

Infrastructure2026

One memory for a fleet of coding agents

Several agents, several machines, one shared data layer with mounts, signal streams, addressed whispers and a secrets vault, and a rule about who may write what.

RustTypeScriptSQLite FTS5PostgreSQLFastifyModel Context ProtocolGitHub Actions

The problem

When several AI agents work the same projects across several hosts, each one starts with an empty context. They need shared documents, a way to leave messages for each other and for a specific running session, an identity model, and secrets that never sit in a prompt. Inventing a service per agent does not scale; a shared database with no rules produces agents overwriting each other.

What I built

The first generation is one SQLite file exposed as an MCP server. Twelve tools, each documented against something the reader already knows: initialise is git init, write is write, search is grep, a signal is a direct message, the inbox is an inbox. Structured documents with YAML frontmatter, direct and broadcast signals, presence tracking, full-text search through FTS5, and nothing else: no network dependency, no external service. A small cloud sync server beside it, Fastify over PostgreSQL with schema validation and bearer-token auth, gives push, pull and search across machines.

The second generation is a Rust HTTP MCP server with per-agent routing. Mounts separate the personal vault, durable knowledge, the framework spec, agent state, append-only event streams and an encrypted vault. Streams are read by cursor so an agent picks up where it left off; a whisper addresses one exact running session or every session of an identity; hooks emit session lifecycle events without the agent having to remember. A written rule table says which stream carries what, because the failure mode of shared memory is not capacity, it is agents writing the right thing in the wrong place.

The server deploys from GitHub as the source of truth: push to main, promote to prod, a watcher on the host pulls and rebuilds. Credentials for the agents’ own accounts are isolated per target and per host, and a written incident report covers the one time a legacy sync job silently broke that isolation.

I maintain a fork of a headless client for the Agent Client Protocol with persistent named sessions, prompt queueing, cooperative cancel, and file-system and terminal methods sandboxed to a working directory, and a bridge that exposes the Claude Agent SDK to any ACP client.