memory is the name you write in code. Under the hood it is two cooperating layers sharing one source of truth: a tamper-evident Layer 1 store on local disk, and a Layer 2 service that derives searchable, tiered structure from it. Everything any agent or human records — decisions, facts, people, projects — flows through this store and is chained together so that no byte can change without breaking the chain.
Layer 1 — the protocol store
The protocol store is the authoritative record. It lives on disk at.cyberos/memory/store/ relative to your project root, inside the gitignored .cyberos/ tree alongside the CUO workflow engine.
The store is tenant data. It is always gitignored and must never be committed to version control. Keep it local; use
cyberos export when you need a portable snapshot.Store layout
Every store is a self-contained, zippable artefact with a predictable structure:The four canonical operations
Every mutation to the store is expressed as exactly one of four canonical operations. There is no fifth.Merkle audit chain
Each audit record carries two chain fields:prev_chain (the chain hash of the preceding record) and chain, computed as:
[u32 length][u32 crc32c][u64 seq][u64 ts_ns][payload]). At consolidation, sealed segments are compressed with deterministic zstd and a signed tree-head anchor is written to audit/checkpoints/. This means you can replay any record, prove any write happened, or detect any byte-level tampering — even across machines and over time.
Layer 2 — the brain service
Layer 2 reads the Layer 1 store and builds derived structure on top of it:Embeddings
Per-event embeddings enabling semantic recall over every memory the store has ever recorded.
Summaries
Rolling summaries computed over recent audit rows so agents can load context-efficient snapshots rather than raw ledger data.
Hot / Warm / Cold Tiers
Memories tiered by
occurred_at time. Recall answers queries over the hot index with full provenance back to the exact Layer 1 rows.Day-to-day usage
Installation and setup
A fresh store is scaffolded automatically when you runnpx cyberos install in any project. The installer creates .cyberos/memory/store/ and wires it to the workflow engine. To skip store creation (e.g. in a CI-only environment), set CYBEROS_NO_MEMORY=1.
If you need to point agents at a different store location, pass --store <path> or set the CYBEROS_STORE environment variable. Resolution order is: explicit override → nearest .cyberos/memory/store/ walking up from the working directory.
CLI commands
cyberos doctor derives the store’s current state:
Python API
The public surface is intentionally small:python -m cyberos --help starts in under 30 ms.
BRAIN in practice
The store enforces a single-writer guarantee: only one process may hold
LOCK_EX on .lock at a time. The lock record carries a JSON lease (pid, host, monotonic_ns, expiry_ns) with a 10-second TTL and a 3-second renew interval. Stale leases left by a killed writer are reaped in microseconds. If two agents need to share memories, use cyberos import to merge one store into another — never share a store directory between concurrent writers.Install CyberOS
Run
npx cyberos install in your repo to scaffold the store, the workflow engine, and the agent entry point in one step.