Show HN: CheeseDB – agent memory where deleting a source deletes what it taught Govinargo Labs released CheeseDB v0.3.0, an embedded, append-only, hash-chained memory database for AI agents that records the source of every memory and deletes everything derived from a source when that source is recalled. In benchmarks with 1 million memories per agent on an Apple M1 Max, CheeseDB removed 10,000 dependent memories in 5.2 ms versus 236 ms for SQLite, 1.94 s for PostgreSQL 17 and 68 ms for Neo4j Community 2026.10, and read one memory by id in 1.8 µs. The preview release, written in Go with only the standard library, has not had an independent security review and its API and on-disk format may change before v1.0, so Govinargo Labs does not recommend it for production data. A database engine purpose-built for AI memory. Native Go · Provenance-aware · Revocable · Embedded Every memory knows its sources. Ask it anything in plain English. Recall a bad source, and everything learned from it goes too. An embedded, append-only, hash-chained memory database for AI agents, written in Go with the standard library only. Use it from Go, from the cheesedb command, or from Claude Code, Cursor and other MCP apps. Website: cheesedb.dev https://cheesedb.dev Status: preview. cheesedb is in active development. It has not yet had an independent security review, and the API and on-disk format may change before v1.0, so it is not yet recommended for production data. See Limits limits and the changelog https://github.com/govinargo-labs/cheesedb/blob/main/CHANGELOG.md . An agent's memory is built from sources it cannot fully trust: user messages, web pages, documents, tool results. Sooner or later one of them turns out to be: - wrong: a tool returned bad data; - malicious: a web page planted instructions or false facts prompt injection, memory poisoning ; - private: a user asks for their data to be deleted. Deleting that source is not enough. Everything the agent learned from it stays in memory, and the agent keeps acting on it. A plain memory store cannot tell which memories came from where, so it cannot remove them. The demo try-it shows this with a real LLM: after the bad source is deleted from a plain memory list, the model still gives the same wrong answer. - Every memory records its sources. A memory is stored with the sources or other memories it was learned from. The engine refuses a memory without one. - Recall removes exactly what depended on a source. One call removes the source and every memory built on it, however deep the chain goes. Memories that are still backed by another, independent source survive Fair ; or remove everything the source ever touched Strict . - Ask it in plain English. With an embedding model of your choice, cheesedb finds memories by meaning search , answers questions from them ask , and forgets what you describe after you confirm forget . A recalled memory is never found again. Without a model, everything else works the same. - Erase really erases. Recall ..., Erase removes the text from the files on disk before it returns. cheesedb find searches the raw bytes to prove it. - The history cannot be edited silently. Every record is chained by hash to the one before. Damage or edits are detected on every open, and erasing text keeps the chain verifiable. - Agents are isolated by design. Each agent is reached only through its own token. No method takes another agent's name, so a prompt-injected tool holding one agent's handle has no way to reach another. - Embedded and dependency-free. A Go library and a folder on disk: no server, no external dependencies. You can model sources and memories in SQL, or as a graph in Neo4j. We did both, to compare: the same data on all four engines, with the same durability every write flushed to the physical disk before it is acknowledged . Benchmarks with 1M memories per agent, median of 3 runs, on an Apple M1 Max macOS, internal SSD , SQLite 3.53, PostgreSQL 17 and Neo4j Community 2026.10. Full results, method and caveats: BENCHMARKS.md https://github.com/govinargo-labs/cheesedb/blob/main/BENCHMARKS.md ; the raw output of the run: bench/results/v0.3.0 https://github.com/govinargo-labs/cheesedb/blob/main/bench/results/v0.3.0 . | | cheesedb | SQLite | PostgreSQL | Neo4j | |---|---|---|---|---| | Recall that removes 10,000 memories | 5.2 ms | 236 ms | 1.94 s | 68 ms | | Recall that removes 20 memories | 4.9 ms | 7.2 ms | 10.1 ms | 6.5 ms | | Read one memory by id | 1.8 µs | 7.4 µs | 59 µs | 211 µs | | Durable write one memory | 4.6 ms | 5.5 ms | 6.8 ms | 6.1 ms | | Startup, ready for the first query | 706 ms | 0.1 ms | 3.0 ms | 1.2 ms¹ | | Disk per memory | 314 B | 249 B | 546 B | 496 B | | RAM per memory while open | 205 B | page cache only | shared buffers only | JVM heap and page cache | ¹ A new connection to a server that is already running; booting the Neo4j server took 6.5 to 8.2 s in an earlier run. PostgreSQL and Neo4j ran over TCP on localhost, which adds a round trip to each statement. We wrote the Neo4j model and queries ourselves, and an expert may do better. - Recall is where it wins. cheesedb keeps the dependency graph in memory and removes 10,000 memories with one write: about 13x faster than Neo4j, 45x faster than SQLite and 370x faster than PostgreSQL. The SQL versions run several statements for each affected memory. A graph database fits the job better, and Neo4j is the closest competitor, but it is still slower. - The rules live in the engine, not in your code. No memory without a source, no memory built on a recalled source, recalls are permanent, agents cannot see each other. With SQL or a graph database you write and test these yourself. - Erasure is built in. In a general database, a deleted row's bytes can stay in the files free pages, the write-ahead log until a vacuum or checkpoint. cheesedb's Erase rewrites the file without them before it returns. - Writes are about even, because the disk flush dominates for every engine. - You need SQL-style queries, filters or keyword search. cheesedb finds by id or by meaning ask-in-plain-english . Keep other queries in your database, store only memory ids there, and check each result against cheesedb. - Startup time matters with very long histories. cheesedb replays its log when it opens an agent: about 0.7 s at 1M memories. SQLite opens instantly. Snapshots are planned. - An agent's memory does not fit in RAM. cheesedb keeps about 205 bytes per memory in memory, plus about 0.8 KB per searchable memory 768 values, one byte each . - You need production guarantees today. cheesedb is a preview; see Limits limits . go get github.com/govinargo-labs/cheesedb the library go install github.com/govinargo-labs/cheesedb/cmd/cheesedb@latest the command Requires Go 1.26.5 or newer. Developed and tested on macOS; Linux runs the same tests in CI. Windows is not supported yet. The peanut story, from the command line. A user is allergic to peanuts; a restaurant's web page says its satay sauce is peanut-free; the page turns out to be wrong. cheesedb agent create story cheesedb lot story user message "I am allergic to peanuts" lot 1 cheesedb lot story doctor note "Allergy test result: peanut allergy confirmed" lot 2 cheesedb lot story web page "Spice Garden menu: our satay sauce is peanut-free" lot 3 cheesedb remember story "The user is allergic to peanuts" 1 2 memory 4: from 1 OR 2 cheesedb remember story "Spice Garden's satay sauce has no peanuts" 3 memory 5 cheesedb remember story "The satay at Spice Garden is safe for the user" 4,5 memory 6: needs 4 AND 5 With an embedding model setup ask-in-plain-english , ask in your own words. Memories saved before the model was set up become searchable with cheesedb embed : cheesedb embed story cheesedb search story "can the user eat the satay at Spice Garden?" 6: The satay at Spice Garden is safe for the user match 0.81 5: Spice Garden's satay sauce has no peanuts match 0.77 4: The user is allergic to peanuts match 0.57 Without one , list what is alive: cheesedb active story . Then the web page turns out to be wrong: cheesedb recall story 3 fair erase recalled 3; memories removed: 5 6 cheesedb search story "can the user eat the satay at Spice Garden?" 4: The user is allergic to peanuts match 0.57 cheesedb find story "peanut-free" not found anywhere searched every file, byte by byte cheesedb recall story 1 fair erase memories removed: : the doctor's note still backs the allergy cheesedb verify story OK. head fingerprint: ... examples/plain-english https://github.com/govinargo-labs/cheesedb/blob/main/examples/plain-english runs this story step by step, with ask and a chat model, for a demo or a screen recording. s, err := cheesedb.Open "/data/cheesedb" // a folder you choose, created 0700 tok, err := s.CreateAgent "alice" // returns Alice's token, once: keep it safe alice, err := s.OpenAgent tok // the only way to reach Alice's data defer alice.Close a, := alice.AddLot "user message", byte "I live in Pune" b, := alice.AddLot "web page", byte "profile: lives in Pune" c, := alice.AddLot "weather tool", byte "Pune: rain" m1, := alice.Remember byte "user lives in Pune" , cheesedb.Leg{a}, cheesedb.Leg{b} // learned from A, or from B m2, := alice.Remember byte "Pune is rainy" , cheesedb.Leg{c} m3, := alice.Remember byte "carry an umbrella" , cheesedb.Leg{m1, m2} // needs M1 AND M2 removed, := alice.Recall c, cheesedb.Fair, cheesedb.Untrusted // the weather tool was wrong // removed == m2, m3 ; m1 survives because it does not depend on C cheesedb can find memories by meaning, so you and your AI can ask in your own words: "can the user eat the satay?" finds "the satay sauce has no peanuts". It needs an embedding model, which turns text into a list of numbers a vector so that texts with similar meaning get similar numbers. cheesedb stores the vectors, searches them, and removes them when their memory is recalled. The library never calls a model: the cheesedb command and its MCP server do, with the model you set up. Set it up by adding an embedding model to ~/.cheesedb/llm.conf . Any OpenAI-compatible server works Ollama, LM Studio, oMLX, vLLM, or a hosted API ; a local one keeps your memories on your machine: embed base url = http://localhost:11434/v1 default: base url embed model = nomic-embed-text e.g. after: ollama pull nomic-embed-text embed api key = your-key only if the server needs one If your chat server also serves the embedding model, embed model alone is enough: the server and key are taken from base url and api key . Use it: cheesedb search alice "what should I eat?" the closest live memories, best first cheesedb ask alice "what should I eat?" search, then the chat model answers from those memories only cheesedb forget alice "the pizza place" shows the closest memory and what goes with it; erases after a yes cheesedb embed alice make memories saved before the model was set up searchable cheesedb index alice the agent's index and its model Every memory saved with remember in the command and in the MCP server is made searchable at once, and MCP apps get a sixth tool, search . If the model is down, the memory is still saved and the answer says it is not searchable yet; cheesedb embed catches up. After changing the model, run cheesedb embed again: vectors of two models cannot be compared, so it rebuilds the index. Without an embedding model , nothing changes: sources, memories, recall, erase, verify, reading by id, listing live memories and the five other MCP tools all work, and nothing is sent anywhere. If you already have a vector store, keep it, store only memory ids there, and check each result against cheesedb. From Go , with vectors from any model: alice.CreateIndex "default", 768, "nomic-embed-text" // dims and a label for the model alice.Embed "default", m3, vec // vec float32 from your model alice.EmbedBatch "default", items // many at once, one disk sync per batch hits, := alice.Search "default", queryVec, 5 // Hit{ID, Score}, best first for , h := range hits { it, := alice.Get h.ID // the text comes from the ledger fmt.Println h.Score, string it.Data } ids, := alice.WouldRecall m3, cheesedb.Fair // what a recall would remove, without removing it - A recalled memory is never returned. Recall removes the vectors of everything it removes, at once. With Erase , the vectors are erased from disk together with the text, and both hash chains still verify Verify , VerifyIndex . A vector can be turned back into an approximation of its text, so cheesedb treats it like the text. - Exact search, small in RAM: the question is compared with every vector cosine similarity , so there are no missed results and nothing to tune. In memory each vector takes one byte per value about 0.8 KB at 768 values ; the exact float32 values stay on disk, and the few rows that could still be in the top results are re-checked with them, so the answer is the same as a full float32 scan. The time grows with the number of memories; see How it scales how-it-scales . - ask sends only what search found 10 memories by default to the chat model, and tells it never to treat a missing memory as an answer, so it is told to say "I do not know" instead of guessing. - forget finds memories, not sources. Sources are not in the search index; recall a source by its number. It shows everything that would go before it erases anything WouldRecall . - One index per model. Vectors from different models cannot be compared. From Go, to switch models, create a new index, embed into it, then DropIndex the old one. - Without an index, nothing changes: same files, same head fingerprint, same speed. An index lives in its own folder with its own log ARCHITECTURE.md section 9 https://github.com/govinargo-labs/cheesedb/blob/main/ARCHITECTURE.md 9-vector-indexes . A Go program, offline with a stand-in embedder that matches shared words, or with a real model: go run ./examples/vector-search EMBED BASE URL=http://localhost:11434/v1 EMBED MODEL=nomic-embed-text go run ./examples/vector-search cheesedb's own cost with a search index 768 values per memory , on an Apple M1 Max. No embedding model is included: with a local one, turning a question into a vector took 17 ms. Median of 3 runs; method and every number: BENCHMARKS.md https://github.com/govinargo-labs/cheesedb/blob/main/BENCHMARKS.md search-index-cheesedbs-own-cost-by-size . | Memories in one agent | 1,000 | 10,000 | 100,000 | 1,000,000 | |---|---|---|---|---| | Disk: memories / search index | 0.3 MB / 3.1 MB | 3 MB / 31 MB | 30 MB / 311 MB | 300 MB / 3.1 GB | | RAM with the index loaded | 1.4 MB | 11 MB | 99 MB | 1.1 GB | | Search, store kept open Go | 1.1 ms | 1.9 ms | 15 ms | 143 ms | | Search per cheesedb command or MCP call | 9.0 ms | 79 ms | 0.74 s | 7.5 s | | Recall with Erase per command or MCP call | 31 ms | 112 ms | 0.81 s | 7.5 s | The command and the MCP server open the store for every call, so each search reloads the index; they suit agents of up to about 100,000 memories. A Go program that keeps the store open loads it once. With real embeddings at 1M, search still ranked the right memories first among a million look-alikes, and none came back after their source was recalled. The cheesedb command is a command-line tool with one command per feature, and a demo with a real LLM: go install ./cmd/cheesedb puts cheesedb in ~/go/bin add that folder to your PATH cheesedb help every command cheesedb agent create alice cheesedb lot alice weather tool "Pune: rain" cheesedb demo needs an OpenAI-compatible LLM see cmd/cheesedb/llm.go It keeps its data in ~/.cheesedb change it with CHEESEDB DIR . The LLM commands read their server and model from ~/.cheesedb/llm.conf search adds an embedding model there; see Ask in plain English ask-in-plain-english : base url = http://localhost:8000/v1 model = your-model-name api key = your-key only if your server needs one The demo tells one story three ways. An agent learns from a user message, a web page and a weather tool. Then the weather tool turns out to be wrong. Here is a real run: How to read it 1. Three sources arrive. Each one is stored as a lot with a label: user message , web page , weather tool . 2. The model learns memories and says where each came from. The arrow on the right lists the sources: memory 6 came from 3 , the weather tool. Memory 7 was built on 4 and 6 . 3. Ask a question. The model sees all 4 memories and answers from the weather forecast. 4. The weather tool was wrong, so remove source 3 three ways: - A, a naive memory list. It deletes the source and nothing else. The model still sees the memories built from it, and gives the same answer. - B, cheesedb with Untrusted . One call removes 3 and everything learned from it, 6 and 7 . The model sees only 2 memories, so it no longer knows the forecast. The text is still in the files, and the demo finds the word "rain" in 3 places. - C, cheesedb with Erase . The model sees the same 2 memories, and the text is gone from the files. A search of every byte finds nothing. 5. The table sums it up: does the model still use the bad data, and is the bad text still on disk? cheesedb find runs the same byte-by-byte search, so you can check your own data. cheesedb mcp