StrataDB provides six data primitives — purpose-built data structures that cover the state management needs of AI agents. Each primitive has a specific shape and API, rather than forcing everything into a generic key-value model.

The Six Primitives

PrimitiveShapeBest For
KV StoreKey → ValueWorking memory, config, scratchpads
Event LogAppend-only sequence of typed eventsAudit trails, tool call history, decision logs
State CellNamed cell with CASCoordination, counters, locks, state machines
JSON StoreKey → JSON document with path accessStructured config, conversation history
Vector StoreCollection of keyed embeddings with pluggable indexing (brute-force or HNSW)Similarity search, RAG context, agent memory
BranchNamed isolated namespaceSession isolation, experiments, multi-tenancy

Choosing the Right Primitive

“I need to store a simple value by key” → KV Store

“I need an immutable log of events” → Event Log. Events are append-only. You cannot modify or delete individual events.

“I need a value that multiple writers coordinate on” → State Cell. The compare-and-swap (CAS) operation lets you update only if you have the latest version, preventing lost updates.

“I need a structured document I can update at specific paths” → JSON Store. You can read and write at JSON paths like $.config.temperature without replacing the whole document.

“I need to store and search embeddings” → Vector Store. Create collections with a fixed dimension and distance metric, then search by similarity. Supports brute-force (exact) and HNSW (approximate) indexing, batch upsert for bulk loading, and 8 metadata filter operators.

“I need to isolate data between sessions or experiments” → Branches. Every other primitive is scoped to a branch.

Comparison

FeatureKVEventStateJSONVector
Read by keyYesBy sequenceBy cell nameBy key + pathBy collection + key
WritePut (overwrite)Append onlySet / CASSet at pathUpsert
DeleteYesNoNoYesYes
List/scanBy prefixBy typeNoBy prefixBy collection
SearchNoNoNoNoSimilarity
VersionedYesYes (sequence)Yes (counter)YesYes
TransactionalYesYesYesYesNo*

*Vector operations are not transactional — they bypass the session transaction system.

All Primitives Are Branch-Scoped

Every primitive is isolated by the current branch. Data written in one branch is invisible from another. See Branches for details.

Space Organization Within Branches

Within a branch, primitives are further organized by space. Each space has its own independent instance of every primitive. The default space is implicit — all operations target it unless you switch spaces.

$ strata --cache
strata:default/default> kv put key default-value
(version) 1
strata:default/default> use default experiments
strata:default/experiments> kv get key
(nil)

Spaces are organizational, not isolation boundaries. Transactions can span multiple spaces within the same branch. See Spaces for the full guide.

All Primitives Use Value

The CLI auto-detects types from input format. Strings, integers, floats, and booleans are recognized automatically. JSON objects and arrays can be passed as JSON strings.

Next

  • Value Types — the 8-variant type system
  • Guides — per-primitive API walkthroughs