agent-store
The fleet's causal-ordered, backend-pluggable store substrate — one thin layer that gives every agent the same durable ordering, identity, and coordination seam, on SQLite today and PostgreSQL tomorrow.
Status: bootstrapping (2026-06-13)
What this is
agent-store is not a database and not an agent. It is the small Rust crate
that two very different consumers sit on top of without re-inventing the same
machinery:
newt-agent's conversation store — a per-writer, BLAKE3-chained, tamper-evident log.modulex-mcp's routine engine — a monotonic generation counter that stamps every report.
It provides three things and nothing more:
- A pluggable [
Backend] —SqliteBackendtoday (bundled rusqlite, zero system dependencies, the laptop default). A synchronous Postgres backend lands behind thepgfeature in Phase 2, for where an operator already runs a server (your own box, or an operator-owned managed cluster database). Everything is synchronous, so consumers drop it into their existing call sites with no async refactor. - Two causal primitives —
Generation(a named monotonic counter) andWriterLog(a per-(stream, writer)log whose every entry chains the previous entry's BLAKE3 hash, verifiable withWriterLog::verify). - A commit [
Doorbell] — the seam co-located agents use to wake each other. The substrate only emits aCommitEvent; a consumer bridges it ontoagent-mesh, publishing the causal pointer(writer, seq)on a per-stream topic. The mesh stays the only distributed fabric —agent-storenever becomes a cross-machine coordination primitive.
Load-bearing principles
- Wall-clock time is never a coordination primitive. Ordering is
(writer, seq)and generation counters. Any timestamp a consumer stores is a display claim, never compared to make a decision. - The substrate is synchronous and mesh-agnostic. No async creep, no dependency on the mesh transport. The doorbell hands events out; consumers do the bridging.
- The default is a file. SQLite, bundled, no server, no daemon. Postgres is opt-in and only ever a server someone else already owns and reaps.
Usage
use ;
// Open a store and lay down the substrate tables.
let db = in_memory?; // or SqliteBackend::open(path)?
ensure_schema?;
ensure_schema?;
// A monotonic generation counter (modulex's report clock).
let report = new;
assert_eq!;
assert_eq!;
// A per-writer chained log (newt's conversation turns) + a doorbell a
// session loop would bridge onto the mesh.
let bell = new;
bell.subscribe;
let turn = append?;
bell.ring;
// The chain is tamper-evident.
verify?;
# Ok::
Build & validate
Zero-warnings policy; .githooks/pre-push and .github/workflows/ci.yml run
the same steps and must stay in parity.
Roadmap
| Phase | Scope |
|---|---|
| 0 (this repo) | Substrate: Backend + SQLite, Generation, WriterLog, Doorbell. |
| 1 | Consumers wire the doorbell over agent-mesh for local multi-agent coordination. |
| 2 | pg feature: synchronous Postgres Backend (opt-in, BYO/remote server). |
| 3 | Operator-owned managed Postgres for in-cluster fleets (the cluster "Meat Locker"). |
| 4 | Semantic recall (pgvector), in-cluster only. |
License
Dual-licensed under either MIT or Apache-2.0 at your option.