Memnest
Open-source memory engine for AI agents

Memory that knows what changed.

A vector store hands your agent everything that resembles the question, stale and current mixed together. Memnest stores atomic facts, works out whether each new one replaces, enriches or repeats what it already knows, keeps the history, and serves only what is true now.

MIT licensed Self-hosted, SQLite or Postgres Any LLM, local or hosted MCP for Claude, Cursor, VS Code
container customer:acmekept, not overwritten
Acme runs its payments service on Postgres. superseded from the onboarding call
Acme runs its payments service on MySQL, migrated from Postgres in June 2026. updates from ticket #4411
Acme's payments MySQL cluster runs in eu-west-1. extends both stay current
search("what database does Acme use?") The agent gets MySQL, in eu-west-1. The Postgres fact is in the trace as not-latest, never in the prompt.
Live preview

Watch memories form, replace each other, and fade.

This is @memnest/core and the dashboard's own graph renderer, running in your browser on an in-memory store. Ingest a customer's conversations and watch the graph grow: nodes are facts, arrows are replacements, faded nodes are superseded and hollow ones forgotten. The only stand-in is the language model, whose answers are scripted.

container customer:acme 3 Mar 2026
LoadingStarting the engine…
The memory graph

1 · Conversationsingest in order
2 · Asksearch(query, scope, budget)
Running createMemnest with the in-memory store, hashEmbedder for vectors and a scripted model. Nothing leaves your browser. Same code as npm install @memnest/core
Why not a vector store?

Similar isn't the same as true.

When a fact changes, the old and new versions look alike, so similarity search returns both and the agent picks one. Often the wrong one.

A plain vector store

top-k for "what database does Acme use?"
  • "…our payments service runs on Postgres. The platform team is…"0.91
  • "…finished moving payments from Postgres to MySQL…"0.89
  • "…here's our staging key: sk-demo-0000…"0.62
"Acme is on Postgres." Wrong, with a credential in the prompt.

Memnest

search("what database does Acme use?", scopeOf('customer:acme'))
  • Acme runs its payments service on MySQL, migrated from Postgres in June 2026.fact
  • Acme's payments MySQL cluster runs in eu-west-1.fact
"Acme is on MySQL, in eu-west-1." The key was redacted before it was ever stored.
Stale facts keep coming backEvery new fact is resolved against similar ones, and search serves only the latest version.
Overwriting loses accountabilityNothing is thrown out. Superseded facts stay, linked to what replaced them and where they came from.
Nobody can see why the agent said itEach search returns a trace, and the dashboard shows the graph, lineage and timeline.
Secrets and small talk end up in memoryRedaction runs before storage; pronoun-laden, secret or low-confidence candidates are rejected with a logged reason.
One customer leaks into anotherA container is a hard boundary, down to scoped API keys, and every route is tested for leaks.
Transcripts blow the context windowMemories are packed into a token budget, and a profile gives a prompt-ready summary.
Use it

In your chat, in your code, or as a service.

In your chat

Claude, Cursor and VS Code get memory tools over MCP. Nothing to build: one command, and your assistant remembers you between conversations.

claude mcp add memnest -- npx -y @memnest/cli mcp --container user:me

Install for your client →

In your code

Recall before the model call, hand the turn back after it. Any model, local or hosted, and any framework.

const { memories } = await memnest.search(question, scope, { tokenBudget: 400 });
const reply = await callYourModel({ system: facts(memories), question });
await memnest.add({ containerTag, customId: chatId, content: turns });

Agent integration →

As a service

One server for every client, with container-scoped keys, a REST API, and a dashboard where a person can see and correct what agents believe.

docker compose up -d
memnest keys create --name acme-bot --container customer:acme

Server & dashboard →

Built to be trusted

Guarantees, each with a test that fails if it breaks.

A container is a hard boundary

Every store method and HTTP route is probed from another container, with a key and with a session. A new route without a probe fails typecheck.

store-contract + server leakage suites

Secrets never reach storage

Credentials are redacted before hashing, chunking or saving. The test greps the raw database file, its write-ahead log and shared memory.

secrets.test.ts

Every memory has provenance

Stores refuse a memory without a source document and extraction run. Even direct writes get one.

walks every memory back to its source

Degradation is never silent

When vector search cannot run, the trace says why: no embedder, no embeddings yet, or a failed query embedding.

trace.degraded

More in Security and privacy.

Give your agent a memory it can explain.

Self-hosted, MIT licensed, and small enough to read. Start with one command; move to Postgres and the dashboard when you need them.