MCP Works with Claude Code, Cursor and any MCP app

A database engine purpose-built for AI memory.

Native Go · Provenance-aware · Revocable · Embedded

How CheeseDB works: an AI stores three sources (the user says they are allergic to peanuts, a doctor’s note confirms it, a web page says the satay sauce is peanut-free) and three memories built on them, including “the satay is safe”. Asked if the user can eat the satay, it says yes. The web page was wrong, so it is recalled: the memories built on it are removed and their text erased, while “allergic to peanuts” stays because it has other sources. Asked again, the AI says it does not know.

Every memory knows its sources. Ask it anything in plain English. Recall a bad source, and everything learned from it goes too.

For AI apps (MCP)
claude mcp add cheesedb -- cheesedb mcp alice
For Go programs
go get github.com/govinargo-labs/cheesedb

Preview. Embedded, Go standard library only, Apache-2.0.

The problem

Deleting the bad source isn’t enough.

An agent builds memory from sources it can’t fully trust. When one turns out to be bad, everything the agent learned from it is still in memory, and the agent keeps acting on it.

Wrong

A tool returned bad data, and three memories were built on it.

Malicious

A web page planted false facts or instructions: memory poisoning and prompt injection.

Private

A user asked for their data to be deleted, including what the agent concluded from it.

Try it

Play the recall game.

A food allergy, a wrong web page, and one red button. Nine short steps.

or and 1: user said 2: doctor’s note 3: web page memory 4 memory 5 memory 6

Terminal

Recorded from a real run of the cheesedb command, with a local embedding model and a local chat model.

Search

Ask it in plain English.

With an embedding model, CheeseDB finds memories by meaning, so you and your AI can ask in your own words. Every result comes only from memories that are still valid: a recalled memory is never found again.

Search

Find by meaning

“Can the user eat the satay?” finds “the satay sauce has no peanuts”, with no shared keywords needed.

cheesedb search alice "can the user eat the satay?"

Ask

Get an answer

Search picks the closest live memories; a chat model answers from those only, and says “I do not know” when they are not enough.

cheesedb ask alice "can the user eat the satay?"

Forget

Forget by description

Describe what to forget. CheeseDB shows the closest memory and every memory that would go with it, and erases them only after you say yes.

cheesedb forget alice "the satay sauce"

With an embedding model

Search, ask and forget in your own words

Any OpenAI-compatible embedding server works: Ollama, LM Studio, oMLX, vLLM, or a hosted API. A local one keeps your memories on your machine. Add two lines to ~/.cheesedb/llm.conf:

embed_base_url = http://localhost:11434/v1
embed_model    = nomic-embed-text
  • Every new memory becomes searchable as it is remembered. cheesedb embed alice catches up on older ones.
  • MCP apps get a sixth tool, search.
  • From Go, bring vectors from any model: CreateIndex, Embed, Search.
Without one

Everything else works the same

No model, no network, nothing sent anywhere. You keep the whole core:

  • Sources, memories and where each one came from.
  • Recall, Erase, Compact and Verify.
  • Reading by id, listing live memories, and the five other MCP tools.
  • Already have a vector store? Keep it, store only memory ids there, and check each result against CheeseDB.

Under the hood

Every record has three parts.

Erase has to remove text without losing history, so each record is split in a way that keeps the history.

Header
The record’s id and a hash that seals it to the record before it. Never erased, so the chain stays verifiable.
Structure
What kind of record it is and which sources it depends on. Never erased, so recall still works after an erase.
Content
The text itself, with a random salt. The only part erase removes, together with the memory’s search vector.
CheeseDB internals in three layers. Host: your Go program calls the library directly; an MCP app talks to cheesedb mcp, and you use the cheesedb command, both on top of the library; an optional embedding model turns text into vectors for them, never for the library. The library: Open, OpenAgent, the memory calls (AddLot, Remember, Recall, WouldRecall, Get, Active, Compact, Verify) and the search calls (CreateIndex, Embed, Search, Indexes, VerifyIndex, DropIndex). In memory, rebuilt by replay: the family tree, leg counters, an offset table and the optional search index, whose rows for recalled memories are removed at once. On disk: a LOCK file, one folder per agent with agent.key, sealed segments with seal files, one active segment, and an index folder with its own log. Below, one record: header and structure kept forever, salt, content and its vector removed by Erase or Compact, all linked by the hash chain.
Select the picture to open it full size. A Go program calls the library directly, or an MCP app reaches it through cheesedb mcp. In memory, the engine keeps the family tree, leg counters and an offset table, all rebuilt from the log when an agent is opened. On disk, each agent is a folder of append-only segments; a search index is a folder of its own beside them.

For Go developers

A few lines of Go.

The same story as the game.

s, err := cheesedb.Open("/data/cheesedb")   // a folder you choose, created 0700
tok, err := s.CreateAgent("alice")          // Alice's token, shown once: keep it safe
alice, err := s.OpenAgent(tok)              // the only way to reach Alice's data
defer alice.Close()

user, _ := alice.AddLot("user_message", []byte("I am allergic to peanuts"))
doc, _ := alice.AddLot("doctor_note", []byte("peanut allergy confirmed"))
web, _ := alice.AddLot("web_page", []byte("our satay sauce is peanut-free"))

allergy, _ := alice.Remember([]byte("the user is allergic to peanuts"), cheesedb.Leg{user}, cheesedb.Leg{doc}) // user OR doctor
sauce, _ := alice.Remember([]byte("the satay sauce has no peanuts"), cheesedb.Leg{web})
safe, _ := alice.Remember([]byte("the satay is safe for the user"), cheesedb.Leg{allergy, sauce})            // needs both

// Optional: search by meaning, with vectors from your embedding model.
alice.CreateIndex("default", 768, "nomic-embed-text")
alice.Embed("default", safe, vec)
hits, _ := alice.Search("default", questionVec, 5) // never returns a recalled memory

removed, _ := alice.Recall(web, cheesedb.Fair, cheesedb.Erase) // the web page was wrong
// removed == [sauce, safe]; allergy survives; their text and vectors are erased from disk

Install the command-line tool with go install github.com/govinargo-labs/cheesedb/cmd/cheesedb@latest. It has one command per feature, including cheesedb find, which searches the raw bytes of the files to prove erased text is gone. Needs Go 1.26.5 or newer. Developed on macOS and tested on Linux in CI. Windows isn’t supported yet.

Is it for you?

When to use it, and when not to.

Use CheeseDB when

  • Your agents learn from sources you can’t fully trust.
  • You need to remove a source and everything declared to depend on it, however deep the chain goes.
  • You want to find memories in plain English, and never get back one that was recalled.
  • Erased text must really be gone from the files.
  • You want to give Claude Code, Cursor or another MCP app a memory it can recall, with no code.
  • You want an embedded Go library with no server and no dependencies.

Use something else when

  • You need SQL-style queries, filters or keyword search. CheeseDB finds by id or by meaning.
  • Startup time matters with very long histories: opening an agent replays its log, about 0.7 s at 1M memories.
  • An agent’s memory won’t fit in RAM: about 205 bytes per memory, plus about 0.8 KB per searchable memory.
  • You need fast search over millions of memories from the command or MCP: each call reloads the index, 7.5 s at 1M (0.74 s at 100,000). From Go, with the store open, it takes 143 ms.
  • You need production guarantees today. This is a preview.

See the numbers Read the limits

The name

Why cheese?

Lot 4821 milk from farm 7

“Lot” and “recall” are food-safety words. A cheese maker records which lots of milk went into which wheels, so when one lot turns out to be contaminated, they recall exactly the cheese made from it.

CheeseDB does the same for what an agent remembers. The name also nods to the Swiss cheese model of safety: stack several layers of protection, and harm only happens when the holes in every layer line up.