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, lock-free snapshot reads, and k-hop temporal traversal — running in-process, no server.
Status: early development (0.0.x) — the engine core works (op log, single-applier concurrency, scoped temporal traversal, replay-determinism property tests), but the API is not yet stable and the recall layer (vector search, full-text, change feed) is still landing. Not production-ready; pin exact versions.
use ;
let db = open?;
let scope = new;
let = ;
// Every mutation is a batch of ops, applied atomically.
db.submit?;
// Every read is scoped — there is no unscoped read path.
let scopes = of.with_shared;
let sub = db.traverse?;
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; readers are lock-free against arc-swapped persistent snapshots
License: MIT OR Apache-2.0.