Anchor
a cross-agent memory keeper · for any agent that speaks MCP
No. 0.1 · MMXXVI

Long memory,
short prompts.

§ Editor's note

Anchor is a small, local-first MCP server that remembers what your coding agents learn — the package manager, the decisions, the file where auth lives. Swap agents and the new one starts halfway done, not from zero.

MIT-licensed. Local SQLite. No telemetry, no accounts.


§ 1

Your agent learned a lot today. Then you switched agents.

An hour in, your assistant has finally figured out the moving parts. Then quota runs out, or a teammate prefers a different tool, or a different model is just better for this particular task. The new agent opens the same repo and asks the same four questions you already answered.

The knowledge wasn't lost. It just lived in the wrong place — inside one agent's session, instead of inside the project.

97.7%

Across 8 real-world scenarios, cold starts dragged in 98,200 tokens of prior transcript. Anchor replaced that with 2,239 tokens of typed recall — a 44× compression — while recovering 100% of critical facts across every category.

Reproducible at tests/eval/run.mjs · 8 scenarios · 0 information leaks

§ 2

Same task. One has memory.

A trivial-looking ask — "add rate limiting to /auth/*" — sent to a fresh agent with no project context, then to the same agent with Anchor attached.

Without Anchor
~ — zsh — cold start
$ antigravity ask "add rate limiting to /auth/*"

Loading prior session transcripts as context…
COLD START── 9,400 tokens injected ────────────────────

Q: What testing framework does this repo use?
Q: What's the package manager?
Q: Where do auth middlewares live?
Q: Is there a preference between Redis and Memcached?

Time to first useful action: 8m 12s
With Anchor
~ — zsh — anchored
$ antigravity ask "add rate limiting to /auth/*"

Anchor: recalled 5 facts, 2 decisions, 1 episode
ANCHORED── 224 tokens injected ──────────────────────

Uses Vitest. Package manager is pnpm.
Auth middleware in src/auth/middleware.ts.
Decision: Redis token bucket
  (tried in-memory; failed multi-region.)

Time to first useful action: 1m 40s

Same task, same agent — only the 224 tokens of SQLite recall, slotted in before the model started thinking, made the difference.


§ 3

Four kinds of memory, not one undifferentiated blob.

Most "memory" systems flatten everything into a vector and pray. Anchor takes the older, less fashionable position that a fact is not a decision, and a decision is not the episode in which it was made.

i.

Fact

"Vitest runs with Node 20; tests migrated away from Jest"

Small, stable, project-scoped truths. The kind of thing a new teammate asks on their first day and never asks again.

ii.

Decision

"Migrate database schema from Prisma to Drizzle"

Resolutions with reasons attached (e.g. Prisma's generated types caused blocking issues with project references). Stored so the next agent can argue with the choice — or, more often, stop re-litigating it.

iii.

Episode

"Rotated JWT keys and tested key grace period on JWKS endpoint"

A timestamped record of what happened. Useful for "didn't we already try this last Tuesday" — and yes, you did.

iv.

Artifact

deploy/charts/base/ (standard Helm chart template)

Pointers into the actual codebase. Files, folders, line numbers, fixtures. The map, not the territory.

New facts that contradict old ones don't pile up — memory_supersede retires the stale entry and writes the new one in its place. Old episodes age out on their own through a salience decay function; nobody has to garbage-collect anything by hand. And before any of this hits disk, secrets are scrubbed at the write boundary, not as a courtesy on the way back out.

Per-Language Prioritization shields your agent from context noise in multi-language repos and monorepos. Anchor automatically tags memories with their programming language (e.g. typescript, go, rust, python) by analyzing code blocks or active file paths. When your agent recalls memory, matching languages receive a 1.5x relevance boost, bringing in-scope lessons directly to the top of the context budget while letting general preference rules still gracefully pass through.


§ 4

One server, five tools, a file you own.

The whole thing is small on purpose. A single MCP server speaks to every agent on the top row. A single SQLite file on your machine holds every memory. Embeddings, if you want them, are an opt-in adapter — never the primary recall path.

Claude Code Codex Cursor Cline Antigravity
↓ ↓ ↓ ↓ ↓
SERVER · 0.1
Anchor MCP Server
recall · remember · supersede · forget · list
stdio | HTTP (localhost:3838)
↓ ↓ ↓
Storage
~/.anchor/memory.db
SQLite · FTS5 BM25
Embeddings (opt-in)
Ollama / OpenAI
Gemini / Voyage
Footprint
4.2 MB

§ 5

Boring numbers, measured honestly.

No asterisks, no "up to," no charts massaged into looking like hockey sticks. The query hot path runs under four milliseconds at the ten-thousandth memory. If that ever stops being true, the benchmark will say so.

Latency & Scalability

Memories Insert avg Recall p50 Recall p95 Gist size DB size
100 0.74 ms 1.14 ms 3.14 ms 126 tokens 168 KB
1,000 0.83 ms 1.53 ms 1.93 ms 553 tokens 596 KB
10,000 0.82 ms 2.59 ms 3.31 ms 553 tokens 4.2 MB

The query path is plain SQLite FTS5 with BM25 ranking — Anchor's reranking layer sits on top of it, not in front of it, which is why the numbers stay flat as the table grows.

Cold vs Warm Retrieval Quality

Scenario Category Cold Start Warm Recall Reduction Hit Rate
Auth Rate Limiting Backend API 9,400 tkn 224 tkn 97.6% 5 / 5
Stripe Billing SaaS Payments 7,800 tkn 163 tkn 97.9% 3 / 3
Turborepo Monorepo Infrastructure 12,500 tkn 304 tkn 97.6% 6 / 6
ML Recommendation Engine ML/Data 15,000 tkn 334 tkn 97.8% 6 / 6
React Native State Mobile 11,200 tkn 271 tkn 97.6% 5 / 5
EC2 → Kubernetes DevOps 13,800 tkn 330 tkn 97.6% 6 / 6
Security Audit Security 10,500 tkn 276 tkn 97.4% 6 / 6
MySQL → PostgreSQL Database 18,000 tkn 337 tkn 98.1% 6 / 6

Measures the exact size of context needed to restore full context on cold starts vs warm recall. recovering 100% of facts across all 8 project categories with zero information leaks.

Reproduce: node packages/server/dist/bench/bench.js && node tests/eval/run.mjs

§ 6

If it speaks MCP, it works.

There is no agent allowlist, no per-vendor adapter, no integration backlog. Anchor speaks the open protocol; whatever's on the other end does too, or it doesn't.

Plus 50+ more via the open Agent Skills spec at skills.sh


§ 7

Three commands. Under a minute.

Nothing leaves the machine. No account, no API key, no cloud bucket waiting to be misconfigured. The database is a file in your home directory; it's yours the moment it's written.

01
Install & init (auto-registers)
~ — zsh
$ npx @anchormem/anchor init
02
Share with your team
~ — zsh
$ npx @anchormem/anchor setup
03
Open the console
~ — zsh
$ npx @anchormem/anchor

§ 8

What goes to disk, and what doesn't.

Before any memory is committed, Anchor runs the candidate string through a redaction pass: OpenAI, Anthropic, Google, Stripe, Slack and GitHub keys; AWS access keys; JWTs; PEM-formatted private keys; the usual cohort of .env-style secrets. If something matches a recognised secret pattern, it's replaced with a stable placeholder before the SQLite write executes — not after, not on the way back out.

The same pre-write pass scrubs a small library of known prompt-injection phrases. It is not a panacea, but it does mean an agent can't be casually tricked into laundering a payload through your memory store on its way to the next agent.

When running in HTTP transport mode, the server binds to 127.0.0.1 only. It validates Host headers against localhost variants (DNS rebinding protection), restricts CORS origins to localhost, enforces a 100 req/min rate limit per IP, caps request bodies at 1 MB, and sets strict security headers — all without configuration.

On POSIX systems the data directory is created mode 0700 and the database file mode 0600 — readable only by you. On Windows the equivalent inherited NTFS ACLs apply.

When recalled content is handed back to an agent it carries an explicit untrusted footer, so the receiving model treats it as user-shaped input rather than as system instruction.

There is no telemetry. There are no accounts. There is nothing to log in to, and nothing logging you.

Read the security policy →