topodb
The memory terrain for AI agents — embedded, temporal, graph-native.
TopoDB is an embedded, local-first memory engine for AI agents, written in pure Rust: a scoped temporal property graph on redb, with an op-log write path, disk-resident MVCC reads, and k-hop temporal traversal — running in-process, no server.
Status: early development (0.0.x) — the engine core and the recall layer are implemented: op log, single-applier concurrency, scoped temporal traversal, BM25 full-text search, graph-scoped vector search, access stats, change feed, and replay-determinism property tests. The API is not yet stable; pin exact versions.
use ;
Design principles
- Narrow and deep — an agent-memory engine, not a general graph database
- Format stability is a feature — versioned on-disk format, migrations always
- Honest benchmarks from day one
- Engine, not policy — no LLM calls inside the database, ever
- Embedded-first — servers and sync are future layers, never prerequisites
Core properties
- Temporal edges — facts supersede, never overwrite;
as_ofreads see history - Structural scoping — every read takes a
ScopeSet; cross-scope edges require aSharedendpoint - Deterministic replay — the op log stores fully-resolved ops; replaying it reproduces state exactly (property-tested)
- Single-applier concurrency — writers from any thread serialize through one applier; reads run in redb MVCC read transactions, never block each other, and never block redb's storage commits, though a long-running read can briefly delay the applier's next batch while it holds the dicts/scope-registry read guards
License: MIT OR Apache-2.0.