Expand description
dejadb-store — the embedded Turso-backed store for DejaDB.
Implements the store schema: dictionary-encoded 2½-permutation
triple indexes (SPO + POS mandatory, OSP selective for entity-valued
relations), entity_latest materialization, op-log + HLC + tombstones,
thread index, and the vaais operation profile (add / recall / batch /
supersede / forget) plus bounded graph ops and two-axis entity_at.
Sync facade over the async turso crate: DejaDB owns a current-thread
runtime; point ops measured at µs-class through this path in M0.
Modules§
- memory_
tool - LR-13 — Anthropic memory-tool backend adapter.
- migrate
- Migration importers — read another memory system’s export and write it into a DejaDB file with original timestamps, provenance, and (where the source has one) the full edit history preserved as supersession chains.
Structs§
- Bundle
Stats - Result of
bundle_since— the git-shaped incremental backup (§5.10). - Command
Embed EmbedBackendthat shells out to a host-supplied command per call: the text goes to the child’s stdin, stdout must be a JSON array of numbers. This is the dependency-free way to give every surface (CLI--embed-cmd, MCP serve, bindings) a real vector leg — the host owns the model, the engine still ships none. One process spawn per embed: fine for turn-level recall and imports, not for the voice per-frame path.- DejaDB
- The embedded DejaDB store handle — one file per memory.
- Deja
DbOptions - Open options.
- English
Expander - Built-in English query expander: synonym substitution + naive suffix
stemming, capped to a handful of variants. Deterministic and allocation-
light. English-only by design (see
QueryExpander). - Fact
Draft - One extracted fact from a
remember()extraction callback. - Fork
Group - An open fork: a
(namespace, subject, relation)that has more than one live head, because two writers superseded the same value concurrently (e.g. edits synced from two edges). The tips coexist — nothing is lost — until an explicit merge closes the fork.heads[0]is the deterministic provisional head every node agrees on. - History
Entry - One version in a supersession chain (
DejaDB::history, newest first). - Import
Stats - Result of
import_bundle. - OpRecord
- One op-log record, the change-feed unit.
- Recall
Tuning - Post-fusion recall refinements. All default off — a bare
recall_hybridbehaves exactly as before. Applied inside the recall deadline; each stage degrades to plain fusion order when its backend or data is unavailable (fail-open, never an error). - Remember
Result - Result of
DejaDB::remember. - Store
Stats - Store statistics (
DejaDB::stats). - Verify
Report - Integrity report (
DejaDB::verify).
Enums§
- Axis
- Temporal axis for
entity_at. - Direction
- Traversal direction for
related.Inuses the selective OSP index, so it only sees entity-valued relations.
Constants§
- OP_ADD
- Op-log operation kinds.
- OP_
FORGET - OP_
SUPERSEDE - RRF_K0
- RRF fusion constant used by
recall_hybrid(the standard k0 = 60). Exported so observability surfaces can report the effective value.
Traits§
- Addable
Dyn - Object-safe serialization adapter so
add_batchcan take mixed grain types. - Embed
Backend - Pluggable embedding backend. The host owns the model; multilingual recall quality comes from choosing a multilingual model (e.g. bge-m3 / multilingual-e5) — text reaches the backend as NFC-normalized UTF-8, script untouched (Arabic/Mandarin/English alike).
- Query
Expander - Pluggable rule-based query expander (Tier-1 retrieval). No LLM, no network.
Given a query it returns additional query variants; the caller runs one
extra BM25 leg per variant and fuses them via RRF, bridging vocabulary gaps
(“cell” ↔ “mobile” ↔ “phone”) — the poor-man’s semantic bridge for the
edge/BM25-only profile where no embedder is installed. The built-in
EnglishExpanderis English-only; multilingual deployments install their own or leave expansion off (it is opt-in per query). - Rerank
Backend - Pluggable cross-encoder reranker (Tier-2
retrieval). Like
EmbedBackend, the host owns the model: inject a local candle/ONNX cross-encoder (or any scorer) — the engine ships no model and takes no ML dependency. Off by default; with no reranker installed recall behaves exactly as before. Reranking is a turn-level refinement (tens of ms), never on the voice per-frame path;recall_hybrid_tunedonly invokes it inside the deadline and falls back to fusion order otherwise.