by radimsem
An agentic memory database that cuts session tokens by 82–99%. One portable SQLite file — your agent's memory, anywhere.
# Add to your Claude Code skills
git clone https://github.com/radimsem/remindbCoding agents already have memory. CLAUDE.md, AGENTS.md, your notes folder, that growing pile of project READMEs. Stuff persists just fine.
The problem is how the agent consumes it. Every session starts by re-reading the whole pile from scratch — every Read, every Grep, scanning raw prose the agent has already processed dozens of times. Big context windows don't fix it. A 1M-token window is still paid per call, and still can't tell yesterday's stale note from today's relevant one.
Raw markdown is the wrong shape for memory. Not because it can't hold the words — it can — but because it forces the agent to pay full freight on every read.
remindb is a single SQLite file your agent treats as long-term memory. It parses your notes (Markdown, HTML, JSON, YAML, TOON) into a structured tree, hashes every node, encodes repetitive structures compactly when it saves tokens, and surfaces the whole thing through a tight MCP tool suite.
Each point is a summary — the full reasoning, with the tradeoffs, lives in docs/.
An ICR the agent can index, not skim. MemoryTree returns the Intermediate Context Representation — typed, labeled, token-counted — in one call instead of a directory walk and a pile of file reads. → The node tree
Hot vs. cold, like a real cache. Every node has a temperature that rises when it's read and decays over time. Hot nodes rank higher in search; cold ones stop crowding the top without ever being deleted. → Temperature
When a node crosses the cold threshold the server nudges the agent to compact it in place — same anchor, same history, fewer tokens. No cron, no worker; it's driven by how the memory actually gets used. →
No comments yet. Be the first to share your thoughts!
Git-style versioning, free. Every compile or write lands a snapshot with per-node diffs. A returning agent resyncs with MemoryDelta — a tiny payload instead of a whole-file re-read. → Versioning
TOON encoding where it pays off. Arrays of uniform objects store ~40% smaller in TOON than YAML or JSON. The parser tries both per node and keeps the win only when it's real; irregular prose stays plain text. The same ≥15% rule converts MathML in HTML to compact LaTeX. → TOON encoding · MathML → LaTeX
FTS5 search, not grep. Ranked anchors in milliseconds over a porter-tokenized index — no file rescans, no regex timeouts — trimmed to exactly the token budget you pass. → Search
Knowledge graph from lateral relations. Author [[Architecture; w=2.5]] in any payload and the compiler resolves a directed weighted edge; MemoryRelated traverses it up to 5 hops, ranked by path weight. Forward references self-heal. → Knowledge graph
Portable by design. The whole memory is one .db file. Copy it to another machine, hand it to another agent, commit it into a repo, sync it across devices. No server, no daemon, no external state — any MCP-capable agent can point serve at the same file and share the same knowledge.
Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/radimsem/remindb/main/install.sh | bash
By default the binary lands at ~/.local/bin/remindb. Pick a different prefix:
curl -fsSL https://raw.githubusercontent.com/radimsem/remindb/main/install.sh | bash -s -- --prefix /usr/local
Windows (PowerShell 5.1+):
iwr -useb https://raw.githubusercontent.com/radimsem/remindb/main/install.ps1 | iex
Lands at %LOCALAPPDATA%\Programs\remindb\bin\remindb.exe. Override with -Prefix:
./install.ps1 -Prefix C:\tools\remindb
git clone https://github.com/radimsem/remindb.git
cd remindb
go build -o ~/.local/bin/remindb ./cmd/remindb
Verify:
remindb --version
Two moving parts: the binary (release tags) and the agent-side skills (remind, memoize — the markdown your agent loads to learn how to call the MCP tools). They iterate on different cadences, so they update independently.
remindb update
Reads the installed version, compares it against the latest GitHub release, and re-runs the install script only when they differ. dev-builds (from go build / go install) always proceed — there's no published version to compare against. Pass --force to reinstall regardless:
remindb update --force
The public skills live under skills/remind/ and skills/memoize/. They're refreshed by vercel-labs/skills.
First-time install (or after adding a new agent):
npx skills@latest add radimsem/remindb/skills -a claude-code
# -a codex | gemini-cli | opencode | openclaw | ...
Refresh later:
npx skills@latest update
The README is the trailer. The manual is in docs/ — each page opens with the problem it solves, in plain language.
| Page | What's there |
|------|--------------|
| Architecture | The layer-by-layer map: parser → transformer → emitter → store, then query → mcp. |
| CLI reference | Every subcommand — compile, serve, inspect, bench, doctor, update — with flags. |
| Configuration | The .remindb/ directory: config.json feature blocks, ignore, temperatures.json, pinned. |
| The node tree · Temperature · Versioning · Search · TOON · MathML → LaTeX · Knowledge graph | The feature deep-dives linked from What you get. |
A Memory* tool suite, registered once, surfaced to any MCP-capable agent (Claude Code, Codex, Gemini CLI, OpenCode, OpenClaw, …). The read path is documented in the remind skill, the write path in memoize.
| Tool | Purpose |
|------|---------|
| MemoryTree | Renders the full node hierarchy with labels, types, IDs, temperatures, and token counts. The agent's cheap orientation call. |
| MemorySearch | FTS5 full-text search over labels and content. Returns ranked anchors within a token budget. |
| MemoryFetch | Returns one anchor plus its ancestors and children, trimmed to a token budget. The "read just this region" call. |
| MemoryFetchBatch | Fetches many anchors in one round-trip under a shared budget — the "read every search hit at once" call. No per-call framing tax. |
| MemoryDelta | Returns only the nodes that changed since a given snapshot cursor. Lets agents resync with a tiny payload instead of re-reading files. |
| MemoryDiff | Compares two arbitrary snapshots git-diff-style. Point-in-time forensic comparison; both ends fixed. |
| MemoryHistory | Browses the version history of a node — who/when/how it changed, rollback-capable via stored old content. |
| MemoryRelated | Traverses the relations graph from an anchor — outgoing/incoming/both, up to 5 hops, ranked by summed path weight. Surfaces what an authored [[Label]] wiki-link connects to. |
| MemoryStats | Reports DB health and shape: node/token totals with per-type breakdown, snapshot/cursor summary, temperature spread, relations, FTS row count. Read-only, single round-trip. Same data the remindb inspect CLI renders. |
| MemoryWrite | Writes or updates content at an anchor. Creates a new snapshot and a per-node diff. |
| MemorySummarize | Replaces a node's content with a shorter summary the agent provides. Used when the temperature tracker flags a cold node. |
| MemoryCompile | Compiles source files or a directory into the database from inside a session. Same engine as the compile CLI. |
| MemoryRelate | Creates a manual edge between two existing nodes. Resolves the target the same way parsed wiki-links do (id → source+label → label only). Does not create a snapshot — relations are a sideband. |
| MemoryForget | Explicitly removes a node. Three deletion modes (including reparent, which rewires children up to the deleted node's parent). |
| MemoryRollback | Walks the graph back to a prior snapshot, optionally pruning the history after it. Still produces exactly one snapshot. |
| MemoryPin | Protects a node from temperature decay and the cold-summarize loop — for reference material that must not age out. |
| MemoryUnpin | Releases a pin, returning the node to normal decay. |
Resourc