Vector × Graph × Document

Three paths, one embedded AI database.

TriviumDB is a single-file engine for AI applications, built to weave agent context, multimodal memory, and structured metadata on one machine.

Theoretical Trinity Aperture single node space · one embedded memory model
Interactive model drag to rotate · click a plane to focus
X
Y
Z
MODEL INVARIANT

One embedded file, one node ID space, three coordinated representations.

02 · Problem

Three stores create one fragile memory.

A vector index, graph store, and payload database can each be correct — while the agent's memory is still inconsistent.

3 ID spaces 4 sync paths n-hop latency
Split memory topologyAgent application talks to three separate stores with drifting IDs and synchronization faults. A faint .tdb single ID space appears as the desired shape.Agent AppPayload DBdoc_7Vector DBvec_142Graph DBnode_91ID driftdelete synctransaction gapcross-store latency.tdb memorydesired single ID spaceSPLIT MEMORY TOPOLOGY · THREE STORES / THREE IDENTITIES

03 · Trinity Model

One ID space binds the planes.

A Trivium node is the shared address for semantic position, payload state, and graph relations.

node_id = vector ⊕ payload ⊕ edges
  • VECTOR: f32[]
  • PAYLOAD: JSON
  • GRAPH: edges[]
Trinity node modelA central node_id 42 connects to vector, payload, and graph planes through a single ID space invariant ring.single ID spacenode_id42VECTOR PLANE[0.12, -0.44, 0.08, ...]PAYLOAD PLANE{ text, type, timestamp }embedding_modeltagssourceGRAPH PLANErelated_to · mentions · caused_bysame IDsame IDsame IDsemantic positionpayload staterelation topologyTRINITY NODE MODEL · ONE ADDRESS / THREE REPRESENTATIONS

04 · Search Pipeline

A query becomes context.

Search starts with a semantic anchor, expands through graph relations, then returns a diversified context set instead of a nearest-neighbor list.

semantic anchor graph expansion DPP diversity
Hybrid search pipelineQuery vector flows through semantic anchor, top-k candidates, graph expansion, score propagation, DPP diversity, and context packet.search(query, expand_depth=2, diversify=True)01query vector02semantic anchor03top-k candidates04graph expansion05score propagation06context packetDPP diversity matrixHYBRID SEARCH PIPELINE · SEMANTIC / GRAPH / DIVERSITY

05 · QuIVer

Approximate search, reranked for recall.

QuIVer compresses the vector field, routes through a navigation graph, then reranks candidates against full precision vectors.

QuIVer ANN search mapPoint field with binary quantization strips, Vamana navigation hops, candidate basin, and full precision rerank table.2-bit BQ signatures01 10 00 1110 10 01 0011 00 01 10f32 rerank0x2a17 0.9320x11c0 0.9010x77bd 0.8840x04ac 0.8610x991e 0.842querynavigatecandidate basinQUIVER · 2-BIT BQ SIGNATURES / VAMANA GRAPH / FULL-PRECISION RERANK
API bindings Python / Node / Rust
Rust core transactions / query pipeline / hooks
Workspace vectors / payload / edges
Storage .tdb / .vec / .tdb.quiver / .wal
Rom mode.tdb

portable knowledge stores and smaller databases

Mmap mode.tdb + .vec

large vector pools with zero-copy cold start

06 · Storage

Portable when small. Mmap-backed when large.

Rom mode keeps a compact `.tdb` file easy to copy. Mmap mode separates vector pools into `.vec` while the `.tdb` file remains the source of metadata, graph structure, and durable state.

07 · Reliability

Crash recovery is part of the write path.

TriviumDB treats embedded durability as an engine primitive: dry-run validation, WAL frames with CRCs, fsync boundaries, atomic rename, and deterministic replay keep the three planes moving together.

commit pipeline wal_safe=true
  1. 01

    Validate as a dry run

    Mutations are shaped before commit so vector, payload, and edge updates can be rejected without partially changing the node.

  2. 02

    Append WAL records

    The write-ahead log captures intent first, giving replay a precise source of truth after process or host interruption.

  3. 03

    Guard each frame with CRC

    Checksummed log frames make torn or corrupted records detectable before they can be applied to the embedded store.

  4. 04

    Flush, rename, replay

    fsync and atomic rename make durable checkpoints explicit; startup replay completes committed records and ignores unsafe tails.

startup replay WAL
checkpoint atomic rename
integrity CRC verified

08 · Developer Experience

Embedded memory without a service graph.

Start from Python, Node, or Rust and keep vectors, JSON, and edges in one local database file. The API is designed for agent memory loops where every result can point back to a durable node.

Python pip install triviumdb
Node npm install triviumdb
Rust cargo add triviumdb
python · agent_memory.py
import triviumdb

with triviumdb.TriviumDB("agent-memory.tdb", dim=3) as db:
    alice = db.insert([0.12, -0.45, 0.78], {
        "type": "memory",
        "text": "Alice works on embedded databases",
    })

    cafe = db.insert([0.08, -0.52, 0.81], {
        "type": "place",
        "name": "Blue Bottle",
    })

    db.link(alice, cafe, label="visited", weight=0.8)
    context = db.search([0.10, -0.48, 0.80], top_k=5, expand_depth=2)
    print(context)

09 · Build

Give your agent one durable memory substrate.

Explore the core concepts, then open the TriviumDB repository to inspect the embedded engine behind WAL recovery, CRC-protected frames, and the shared vector/graph/payload node model.