Auny in a hood

shared-agent-memory

Shared memory for AI coding agents: installs a collector, a local SQLite vector store and one MCP search tool so Claude Code, Codex and Gemini CLI share memory

npx shared-agent-memory
Star on GitHub

AI memory filesEvery 3 hours the collector reads each AI's memory files.

Collector and server
  • Secret scanA batch with a secret is refused

  • Local storeSQLite with sqlite-vec

  • memory_searchOne MCP tool for every AI

Claude Code, Codex CLI and Gemini CLI keep writing their own files.
shared-agent-memory copies them into one store any AI can search.

What this does

Silent video

Get started

Go from install to your first shared search.

  1. Run setup

    It detects your AI tools, shows what it found and writes a scheduler entry that collects every 3 hours.

  2. Set two keys

    Supply different SAM_WRITE_KEY and SAM_READ_KEY values through your environment.

  3. Check, collect and search

    Run doctor, start the server, collect once and search across every AI.

  4. Connect your AI

    Point any MCP host at shared-agent-memory mcp --ai <tool>.

npx shared-agent-memory

shared-agent-memory doctor
shared-agent-memory serve
shared-agent-memory collect
shared-agent-memory search "project conventions"

Setup never installs other tools or edits an AI's configuration.
Read the full overview

Requirements

Node 22 or newer

The store uses node:sqlite with the sqlite-vec extension.

gitleaks

The default scanner. Setup prints the official install command when it is missing.

Ollama

Runs nomic-embed-text locally for 768-dimension embeddings.

An AI tool with memory files

Claude Code, Codex CLI, Gemini CLI, or a ChatGPT export. Add a profile for another tool.

Collect from every AI you use.

One profile per tool says where its memory lives, from that tool's own docs. Transcripts stay off unless you turn them on.

Where each AI keeps memory

Scan before anything is stored.

A batch holding a secret is refused whole, and no scanner means nothing is saved. Mass deletes and empty inventories are refused too.

Follow the 33 steps

Search from any AI over MCP.

One tool, memory_search, with privacy tags applied before ranking. Hits come back framed as stored data.

Read the API

Docs and guides

Evidence you can inspect

57451 bytes
Packed package sizeMeasured 2026-12-05 · Expires 2027-03-05
118 files
Packed file countMeasured 2026-12-05 · Expires 2027-03-05
1 package
Runtime dependencies (sqlite-vec)Measured 2026-12-05 · Expires 2027-03-05
82 cases
Node test cases passedMeasured 2026-12-05 · Expires 2027-03-05
7 cases
Conformance cases over the CLI and HTTP APIMeasured 2026-12-05 · Expires 2027-03-05

Dated package measurements you can re-run in the repository with npm test and npm pack --dry-run. The conformance cases include a planted key that is refused and never searchable.

Releases