AtticDB
by Clawdlinux
README.md
# AtticDB
[](https://github.com/Clawdlinux/atticdb/releases/latest)
[](https://github.com/Clawdlinux/atticdb/releases)
[](#license)
[](#where-to-run-it)
AtticDB is local, durable memory for coding agents, written in Rust.
It stores turn history per session and keyed facts. A write is acked only after it is synced to disk.
It wires into Copilot CLI, VS Code, Claude Code, Codex, Gemini CLI, Antigravity and Claude Desktop with 1 command.
Status: early. Fine for your laptop. Not for production yet.
- MCP Registry name: `mcp-name: io.github.Clawdlinux/atticdb`
## Install
On macOS and Linux:
```sh
curl -fsSL https://github.com/Clawdlinux/atticdb/releases/latest/download/install.sh | sh
export PATH="$HOME/.local/bin:$PATH" # needed only if the installer said it isn't on PATH
```
The installer puts `atticdb` in `~/.local/bin` and checks the download against the release's `SHA256SUMS`. It never uses sudo or edits your shell files.
Releases ship monthly, and the latest is the default.
Set `ATTICDB_VERSION=0.1.0` to pin a release, `ATTICDB_INSTALL_DIR` to install elsewhere, or `ATTICDB_DOWNLOAD_BASE` for a mirror.
On Windows x86_64, download `atticdb-x86_64-pc-windows-msvc.zip` and `SHA256SUMS` from the [latest release](https://github.com/Clawdlinux/atticdb/releases/latest).
Check the zip, then put `atticdb.exe` in a folder on your PATH. In PowerShell:
```powershell
(Get-FileHash .\atticdb-x86_64-pc-windows-msvc.zip -Algorithm SHA256).Hash.ToLower() # must match SHA256SUMS
Expand-Archive .\atticdb-x86_64-pc-windows-msvc.zip "$env:LOCALAPPDATA\Programs\atticdb"
$env:PATH += ";$env:LOCALAPPDATA\Programs\atticdb" # this session only. Add it to your user PATH too
atticdb setup
```
`install.sh` doesn't run on Windows.
From source, with Rust installed:
```sh
cargo install --git https://github.com/Clawdlinux/atticdb atticdb --locked # puts atticdb in ~/.cargo/bin
```
The downloads badge counts release archive downloads. Our own install tests are left out. A daily workflow updates it.
## Updating
`atticdb doctor` and `atticdb setup` check for a new release at most once a day. When one is out, they end with:
```
AtticDB 0.4.0 is out (you have 0.3.0). Run: atticdb upgrade
```
The notice never changes their exit code. A failed check prints nothing, and the next try waits 1 h.
The server AtticDB starts for you checks too, in the background, through the same daily cache.
Your agent sees the notice at chat start, in the AtticDB memory block. The hook reads the cache only, so it never waits on the network.
The hook, `atticdb mcp` and the other commands never check.
```sh
atticdb upgrade # shows the plan, then asks
atticdb upgrade --yes # doesn't ask. Needed when stdin is not a terminal
atticdb upgrade --version 0.3.0 # installs this release, even an older one
atticdb upgrade --auto on # the server installs each new release on its own
atticdb upgrade --auto off # back to asking
```
Auto-upgrade is off until you turn it on. With it on, the server runs `atticdb upgrade --yes` within a day of a new release.
Its output goes to `upgrade.log` in the home. It runs on macOS and Linux only, and never for a `+dev` build.
It runs the new release's own `install.sh`, which checks the download against `SHA256SUMS`.
The old binary stays beside the new one as `atticdb.prev`.
Then it stops the running server and runs `atticdb doctor` from the new binary, which starts the new server.
It stops the server only after the server proves it serves this home's store. Else it says to stop it by hand.
The plan always warns that a release may change the store format. Then the old binary can't open the store after the first write.
With an older `--version`, the plan warns instead. The older binary may not open a store a newer release wrote.
A home with 16 MiB segments is one: releases before `segment_mib` refuse its config and its segments (D106).
To roll back with the default install dir:
```sh
mv ~/.local/bin/atticdb.prev ~/.local/bin/atticdb
```
Then stop the server as in [Uninstall](#uninstall) step 2. The next AtticDB call starts the old one.
Each upgrade replaces `atticdb.prev`. A failed upgrade keeps the earlier one.
To turn the daily check off, set `ATTICDB_NO_UPDATE_CHECK` to any value but empty or `0`.
Any `CI` variable, even an empty one, turns it off too.
Builds from source, whose version ends in `+dev`, still check but never print the notice.
`atticdb upgrade` ignores the off switches, since you asked. With `--version` it doesn't check at all.
What's sent: 1 `GET` to `https://api.github.com/repos/Clawdlinux/atticdb/releases/latest`, by `curl` with a 3 s limit.
It carries no token, no ID and no data about you. GitHub sees your IP address, as for any download.
curl runs with `-q`, so your `~/.curlrc` doesn't apply.
The answer is cached in the home as `update-check.json`.
If cargo built `atticdb` from source, `upgrade` prints the `cargo install` command to run instead. A release binary you put in `~/.cargo/bin` upgrades as usual. If Homebrew did, it prints `brew upgrade atticdb`.
Neither runs anything. On Windows, `upgrade` prints the manual steps, as in Install above.
## Quick start
```sh
atticdb setup --dry-run # shows what it would change, writes nothing
atticdb setup # asks which apps, then wires them
atticdb doctor # checks the install; it may start the server
```
`atticdb --help` lists the commands. `atticdb <command> --help` prints that command's flags. `atticdb help --all` prints every flag. Set `NO_COLOR=1` to turn color off.
`setup` finds Copilot CLI, VS Code, Claude Code, Codex, Gemini CLI, Antigravity and Claude Desktop. It adds the MCP entry, a chat-start hook and the guide each app reads. Antigravity and Claude Desktop get only the MCP entry. Restart them to load it. Claude Code also gets a PostCompact hook. It saves each compaction summary as a note, with a pointer to the full transcript. Every edited file is backed up first. `atticdb disconnect <app>` removes exactly what it added. Codex runs a new hook only after you approve it once in Codex. [research/setup_eval/results](research/setup_eval/results/README.md) has the eval results.
`atticdb doctor` prints 1 line per check, with what to do when one fails. [Set up](crates/atticdb/README.md#set-up) and [`atticdb doctor`](crates/atticdb/README.md#atticdb-doctor) give the details.
A new home reserves about 34 MiB: 2 segment files of 16 MiB and 2 MiB of index files.
A home made before keeps its 64 MiB segments, about 130 MiB. Nothing migrates it.
The config key `segment_mib`, 16 to 1024, sets the segment size of a new store only. Without it, a store gets 64 MiB.
`atticdb doctor` shows the size as `store: <X> MB on disk, <S> MiB segments`. The [crate README](crates/atticdb/README.md) gives the details.
### See it
In under 60 s on macOS and Linux, 1 agent corrects a fact, and another agent's stale write is refused.
```sh
python3 scripts/demo_correction.py
```
## Memory tree
AtticDB saves facts under keys that work like folder paths. Use these top-level folders:
| Key | What goes there | Loaded at chat start |
|---|---|---|
| `user/<topic>` | Your preferences and style | Yes, in every repo |
| `repo/<repo>/<area>/<topic>` | This project's rules and decisions | Yes, in that repo |
| `agent/<agent>/<topic>` | Notes for 1 app only | Not yet |
| `team/<team>/` | Reserved for sync later | Don't write here yet |
`<repo>` is the main folder name of the repo you work in. `<area>` is optional. It helps once a repo has many rules, as in `repo/myrepo/api/retry`.
Your agents save a rule here when you state it in a chat. You can save one yourself:
```sh
atticdb fact set --key user/style --content "Short commit messages."
atticdb fact set --key repo/myrepo/tests/runner --content "Run cargo test before a PR."
```
`atticdb tree` shows how your memory is organized. Each folder gets a fact count and the date of its newest change:
```text
$ atticdb tree
(all keys) 6 facts, newest 2026-11-04
|-- repo/ 4 facts, newest 2026-11-04
| |-- myrepo/ 3 facts, newest 2026-11-04
| `-- web/ 1 fact, newest 2026-11-04
`-- user/ 2 facts, newest 2026-11-04
|-- style 2026-11-04
`-- tone 2026-11-04
Deeper levels show as counts. Pass --depth <n> to see more.
```
With no prefix it shows 2 levels. `atticdb tree repo/myrepo/` shows 1 folder, all levels.
`--depth <n>` sets the levels. `--content` adds each value's first line. `--json` prints 1 JSON line for scripts.
Deleted and forgotten keys never show. [`atticdb tree`](crates/atticdb/README.md#atticdb-tree) has the details.
## Forget and export
Content is hidden from normal AtticDB reads. It stays on disk until purge ships (#159).
A forget hides a session, a fact, a file ref or single records. After it, your agents, search, studio and exports stop showing that content.
It doesn't erase anything. The bytes stay in the data folder. Real erase is tracked in [#159](https://github.com/Clawdlinux/atticdb/issues/159).
A forget covers only what was written before it. Notes written later still show.
AtticDB can't undo a forget. No MCP tool forgets, so your agents can't forget through their memory tools.
You forget from the shell or from studio. An agent that runs shell commands could still run `atticdb forget`.
Setup adds no shell allow rule for it, so check the commands your agent asks to run.
### Forget from the shell
```sh
atticdb forget session --agent copilot --session myrepo # a whole session
atticdb forget key --key repo/myrepo/deploy-rule # 1 fact
atticdb forget file --path shots/login.png # 1 file ref. The file may be gone
atticdb forget lsns --lsns 12,15 # single records, by LSN
```
With no store flags, these use your home, the store `atticdb setup` wired up.
Agents save notes under an agent name, such as `copilot` or `claude-code`, and a session named after the repo.
`atticdb recent --agent copilot --session myrepo` lists that session's turns with their LSNs. Studio shows them too.
Add `--up-to-lsn <n>` to hide only records at or below LSN `n`. Each forget prints 3 lines:
```text
forgot session copilot/myrepo up to lsn 40 (txn 9, lsn 40)
Content is hidden from normal AtticDB reads. It stays on disk until purge ships (#159).
Names, keys, LSNs, counts and sizes stay visible. See "What a forget leaves visible" in the README.
```
`atticdb forget` doesn't ask "are you sure?". Typing the command is the only friction.
It isn't an approval step either. Anything that holds your token can call `POST /v1/forget`.
`atticdb dump`, `atticdb stats` and `atticdb verify` never print content. Their counts and sizes still include forgotten records.
The store holds at most 100,000 hidden LSNs, set by the engine option `max_forgotten_lsns`.
Past that, `forget lsns` fails with `resource_exhausted`. Session and key forgets don't count toward it.
The server config doesn't set this option. If you embed the engine and lower it below the LSNs already hidden, open fails until you raise it.
`max_facts` works the same way.
### Forget from studio
Studio is read-only unless you start it with `--allow-forget`:
```sh
atticdb studio --allow-forget
```
The Sessions table then gets a box on each row and a "Forget selected (N)" button. It takes up to 100 sessions at a time.
A session page gets "Forget this session", and a fact page gets "Forget this key".
Each asks first, in a dialog with the sentence above and a link to the list below.
Studio hides only what the page showed you. Turns written after the page loaded stay visible.
Studio forgets sessions and fact keys. Use the shell for single records.
### Export
```sh
atticdb export ~/atticdb-export
```
It writes your memory as markdown. Facts go in `facts.md`, and each session gets `sessions/<agent>/<session>.md`.
It all comes from 1 point in time. Forgotten turns show as `## #<seq> forgotten`. Forgotten facts are left out.
The folder must not exist yet. A failed run never leaves a half export there.
The files hold your memory in plain text. A later forget doesn't touch them.
[`atticdb export`](crates/atticdb/README.md#atticdb-export) has the details.
### What a forget leaves visible
A forget hides turn content, meta, role and time, and fact values. These stay observable:
- Names: agents, sessions, fact keys and file-ref paths. `/v1/sessions`, `records` placeholders, studio's tables and list cursors show them.
- Positions: LSNs, seqs and record kinds. Placeholders keep them. Search and list cursors may name a hidden LSN or key.
- Counts: each session's `turns`, session totals, and the `/v1/stats` and `/metrics` fields `facts`, `fact_revisions` and `compressed_turns`. They include forgotten records. `search_index_terms` includes them until the next restart.
- Sizes and times: `atticdb dump` prints every record's payload length and commit time.
- Retry oracles: a retry with a guessed payload and a known retry key confirms the guess. `turn_repeats` counts repeated content.
- RAM: in-memory index tokens stay until the next restart. Hot cache entries stay until purged or evicted. Reads never serve either.
- Bytes: segment files, unsalted retry digests in checkpoints, filesystem and SSD remanence, copies, backups and exports already taken.
- `recover --truncate-at` below a forget's LSN drops the forget, and the content shows again.
- A retry that arrives after its key left the dedup window writes the content again.
## Uninstall
1. Run `atticdb disconnect <app>` for each app you connected: `copilot`, `vscode`, `claude-code`, `codex`, `gemini`, `antigravity` or `claude-desktop`. It removes only what setup added.
2. Stop the background server. Its pid is in the `LOCK` file in the data folder. The data folder is `~/Library/Application Support/atticdb` on macOS and `~/.local/share/atticdb` on Linux.
```sh
cat ~/Library/Application\ Support/atticdb/data/LOCK # macOS. Linux: ~/.local/share/atticdb/data/LOCK
kill <pid> # the number after pid=
```
3. Remove the binary and the data folder. The data folder holds all your memory, so this deletes it for good.
```sh
rm ~/.local/bin/atticdb # or: cargo uninstall atticdb
rm -f ~/.local/bin/atticdb.prev ~/.local/bin/atticdb.prev.old # left by atticdb upgrade
rm -rf ~/Library/Application\ Support/atticdb # macOS
rm -rf ~/.local/share/atticdb # Linux
```
If you set `ATTICDB_HOME`, that is the data folder. On Linux with `XDG_DATA_HOME` set, it is `$XDG_DATA_HOME/atticdb`. If you set `ATTICDB_INSTALL_DIR`, the binary is there.
## Where to run it
macOS, Linux and Windows x86_64. Release binaries cover macOS and Linux on x86_64 and arm64, and Windows on x86_64. The Linux ones are static, so any distro works. Then `atticdb setup` connects it to VS Code, Copilot CLI, Claude Code, Codex, Gemini CLI, Antigravity and Claude Desktop.
Claude Desktop runs only on macOS and Windows, so Linux can't connect it.
On Windows, Codex gets only its MCP entry for now ([#142](https://github.com/Clawdlinux/atticdb/issues/142)). On Windows, Claude Code 2.1.139 or later is needed for the hook. Durability there is weaker, as Windows has no directory fsync. [Windows](crates/atticdb/README.md#windows) lists what differs.
Keep the data directory on a local disk. Every ack waits for a sync, so that disk sets your write latency.
[Where to keep the data directory](crates/atticdb/README.md#where-to-keep-the-data-directory) lists the disks we tested and the ones to avoid.
## Hosted
`atticdb serve` also answers MCP at `POST /mcp`. Agents on any machine can share 1 store with a URL and a token.
Nothing gets installed where the agent runs. [docs/hosting.md](docs/hosting.md) stands one up on 1 VM behind Caddy.
Whoever runs the server gives you `<host>` and `<token>`. The token picks your tenant.
- The hosted server lists 7 tools. `file_ref` and `file_get` are local only, since they read files on the machine that runs them.
- Remote agents get no chat-start block. That hook runs a local binary. The instructions tell the agent to call `fact_list` with prefix `user/` and with `repo/<repo>/` instead.
- The server can't see your repo. So the agent passes `session` on `memory_append` and `memory_recent`. It's the main folder name of the repo you work in.
- Notes name the app that wrote them. The name comes from the app's MCP `clientInfo.name`.
- The entries below are named `atticdb-hosted`, so they don't replace the local `atticdb` entry from `atticdb setup`. Keep 1 of the 2 in each app, or the model sees 2 memories.
- Keep `<token>` out of repos and shared config files.
Copilot CLI, in `~/.copilot/mcp-config.json`. Docs: [Adding MCP servers for Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers).
```json
{
"mcpServers": {
"atticdb-hosted": {
"type": "http",
"url": "https://<host>/mcp",
"headers": {"Authorization": "Bearer <token>"},
"tools": ["*"]
}
}
}
```
Or from a terminal:
```sh
copilot mcp add --transport http --header "Authorization: Bearer <token>" atticdb-hosted https://<host>/mcp
```
VS Code 1.144 and later also reads `~/.copilot/mcp-config.json`. So with the Copilot CLI entry above, VS Code already has `atticdb-hosted`.
Don't add the `mcp.json` entry too. VS Code would list 2 servers, each with its own `/mcp` session.
2 sessions don't share what they last read. So their `fact_set` calls can conflict for no reason (D101, D107).
Use this VS Code entry only without Copilot CLI, or on a build older than 1.144. It goes in `mcp.json`.
Run **MCP: Open User Configuration** to open it. VS Code asks for the token once and keeps it in its secret store. Docs: [MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration).
```json
{
"inputs": [
{"type": "promptString", "id": "atticdb-token", "description": "AtticDB token", "password": true}
],
"servers": {
"atticdb-hosted": {
"type": "http",
"url": "https://<host>/mcp",
"headers": {"Authorization": "Bearer ${input:atticdb-token}"}
}
}
}
```
Claude Code. `--scope user` makes it apply in every project.
```sh
# Docs: https://code.claude.com/docs/en/mcp
claude mcp add --transport http --scope user atticdb-hosted https://<host>/mcp \
--header "Authorization: Bearer <token>"
```
Codex, in `~/.codex/config.toml`. Codex reads the token from the variable you name. Set it in the shell that starts Codex.
Don't use `ATTICDB_TOKEN`: the local `atticdb` commands read that one.
```toml
# Docs: https://developers.openai.com/codex/mcp
[mcp_servers.atticdb-hosted]
url = "https://<host>/mcp"
bearer_token_env_var = "ATTICDB_HOSTED_TOKEN"
```
Gemini CLI, in `~/.gemini/settings.json`. `httpUrl` picks Streamable HTTP. Docs: [MCP servers with Gemini CLI](https://geminicli.com/docs/tools/mcp-server/).
```json
{
"mcpServers": {
"atticdb-hosted": {
"httpUrl": "https://<host>/mcp",
"headers": {"Authorization": "Bearer <token>"}
}
}
}
```
Claude's web, Desktop and mobile Connectors need OAuth. The hosted server has bearer tokens only for now ([0010](docs/design/0010-hosted-mcp-endpoint.md)).
[Hosted MCP](crates/atticdb/README.md#hosted-mcp-post-mcp) has the protocol details.
## Tell us what you need
AtticDB does a few things on purpose. We add features when people ask for them.
- Missing an app, a command or an API? [Open a feature request](https://github.com/Clawdlinux/atticdb/issues/new?template=feature.yml). Say what you're trying to do, not just the feature.
- Something broke? [Open a bug](https://github.com/Clawdlinux/atticdb/issues/new?template=bug.yml) with the `atticdb doctor` output.
- Someone asked already? Add a thumbs-up to that issue. We count those. Issues labeled `waiting-for-users` are ideas we parked until enough people want them.
## Memory comparison
AtticDB runs locally and keeps explicit fact revisions. Its ranked search uses words, not embeddings.
| Tool | How it retrieves memory | Where it runs |
|---|---|---|
| AtticDB | Ranked word search and keyed fact lookup | Local binary or self-hosted MCP |
| [Mem0](https://docs.mem0.ai/open-source/overview) | Embeddings with configurable retrieval components | Library or self-hosted server |
| [Walrus Memory](https://docs.wal.app/walrus-memory/sdk/overview) | Embedding-based recall | Relayer-backed, even with client-side embeddings |
These are documented differences, not measured rankings. We have not benchmarked Mem0 or Walrus Memory.
**Measured correction handoff:** We tried 3 explicit decision changes with fresh stores, repeated 3 times.
| Check | AtticDB | [MCP reference memory server 2.0.0](https://www.npmjs.com/package/@modelcontextprotocol/server-memory/v/2.0.0) |
|---|---:|---:|
| Reader got only the corrected value | 9/9 | 9/9 |
| Reader could retrieve ordered revisions natively | 9/9 | No native revision tool |
| Stale writer was refused after another writer saved | 9/9 | 0/9 |
Both clients read the same value before either edit. AtticDB refused the stale edit.
The reference server kept both edits as observations.
This tests native tools, not a workflow with a separate graph archive or client-managed locking.
See the [correction eval](research/locomo_retrieval/README.md#correction-handoff).
**Measured retrieval:** On LoCoMo, each retriever got the same 1 KiB text limit.
| Evidence recall | AtticDB ranked search | SQLite FTS5 BM25 |
|---|---:|---:|
| All 1,536 questions | 54.1% | 51.9% |
| 321 temporal questions | 63.2% | 62.0% |
SQLite was faster in this setup. It ran in process, while AtticDB used a Unix socket.
This tests evidence retrieval, not answer accuracy or whether an agent rejects an outdated fact.
See the [full results](research/locomo_retrieval/results/2026-11-19-equal-budget.md) and [run command](research/locomo_retrieval/README.md#how-to-run-it).
## Docs
- [atticdb](crates/atticdb/README.md): server, HTTP API, MCP, studio, `tree`, `forget`, `export`, `upgrade`, `stats`, `load`, `verify`, `dump` and `recover`. It also has these:
- [Run a server by hand](crates/atticdb/README.md#run-a-server-by-hand), [Keys](crates/atticdb/README.md#keys) and [Where to keep the data directory](crates/atticdb/README.md#where-to-keep-the-data-directory).
- [MCP](crates/atticdb/README.md#atticdb-mcp), [Secrets](crates/atticdb/README.md#secrets), [Shell verbs](crates/atticdb/README.md#shell-verbs) and [Connect](crates/atticdb/README.md#atticdb-connect-and-atticdb-disconnect).
- [Studio](crates/atticdb/README.md#atticdb-studio), [`atticdb export`](crates/atticdb/README.md#atticdb-export) and [Windows](crates/atticdb/README.md#windows).
- [atticdb-core](crates/atticdb-core/README.md) and [atticdb-tape](crates/atticdb-tape/README.md): engine, formats, recovery and limits.
- [Overview](docs/overview.md): how it works, benchmark numbers and the build steps.
- [Sandboxed agents](docs/deploy/sandboxes.md): who holds memory, and how sandboxed code can reach it.
- [Hosting](docs/hosting.md): 1 VM, Caddy and `atticdb serve`, so remote agents reach 1 store at `POST /mcp`.
- [Python client](clients/python/README.md), [TESTING.md](TESTING.md) and the [decision log](docs/design/0002-decision-log.md).
- Benchmarks: [head-to-head tables](bench/H2H.md) and [macOS engine runs](bench/RESULTS.md). History: [0001 (historical)](docs/design/0001-architecture.md).
## Contributing
Read [CONTRIBUTING.md](CONTRIBUTING.md) before you open a pull request. It has the build and test commands.
Follow the [code of conduct](CODE_OF_CONDUCT.md), and report vulnerabilities as [SECURITY.md](SECURITY.md) says.
## License
License: MIT OR Apache-2.0, at your option. See [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessMixed handling