Features

FusionDB packs three production-grade database engines into one binary, bound by a single atomic transaction layer and a unified query interface.

Three Engines. One Write.

LayerStorage FormatUse CaseKey Prefix
KV StoreAES-256-GCM encrypted JSON documentsFast point lookups, metadata, audit fields, entity payloads0x10 – 0x12
Graph StoreSemantic triples (subject → predicate → object)Relationship traversal, entity linking, ontology queries0x00 – 0x01
Vector StoreFloat32 embeddings via HNSW indexSimilarity search, RAG retrieval, semantic ranking0x02 – 0x04
🗄️
KV Store
Encrypted Key-Value

Every KV payload is encrypted with AES-256-GCM before touching disk. A fresh random nonce is generated per write. Three byte-prefix-isolated data tiers maintain logical separation between verified, unverified, and knowledge data.

  • AES-256-GCM encryption at rest
  • Ristretto LRU in-process cache (128 MB default)
  • ScanFilterStream for streaming reads
  • Salience / reliability / decay envelope
🕸️
Graph Store
Semantic Graph

Bidirectional quad store with length-prefixed key format. Forward edges at prefix 0x00, reverse at 0x01. Degree-2 (PII) edges are HMAC-SHA256 masked — the original value is stored in a separate encrypted reverse-lookup record.

  • Bidirectional edge indexing
  • HMAC-SHA256 PII masking on Degree-2 edges
  • 4-Degree ontology (Primary → Quaternary)
  • HydrateEntity() full relationship resolution
🧠
Vector Store
HNSW Vector Index

Hierarchical Navigable Small World (HNSW) approximate nearest-neighbor index backed by BadgerDB. No separate vector service required. CometNode binary serialization with cosine-distance metric and configurable max neighbors.

  • HNSW ANN index (cosine distance)
  • Float32 embedding support
  • MaxNeighbors = 16 (configurable)
  • Vector similarity via UFL $near selector

Zero-Trust Data Model

FusionDB derives two independent keys from your master secret — one for encryption, one for PII salting. The raw secret never enters the database. Degree-2 PII identifiers are one-way hashed before indexing.

  • AES-256-GCM encryption for all KV payloads
  • HMAC-SHA256 key derivation with domain separation
  • HMAC-SHA256 PII masking (emails, phones, IDs)
  • Encrypted reverse-lookup for PII decryption
  • FUSIONDB_SECRET environment variable — never on disk
  • Startup validation: exit on insufficient key entropy
  • Circuit breaker — halts after 3 sequential failures
  • Session sync guard — prevents cross-session operations
key derivation
// Two independent keys from one master secret
secretKey = HMAC-SHA256(master, "fusiondb-secret-v1")
saltKey   = HMAC-SHA256(master, "fusiondb-salt-v1")
 
// KV write: AES-256-GCM + fresh nonce
nonce = crypto/rand (12 bytes)
cipher = AES-256-GCM(secretKey, nonce, payload)
 
// PII graph edge: one-way hash
masked = HMAC-SHA256(saltKey, "jane@corp.com")
→ stored in graph, original encrypted separately

Unified Fusion Language

UFL is a JSON-based declarative interface for all reads and writes. One manifest format handles entity fusion, vector queries, and graph traversal.

manifest.json — write
{
  "ufl_version": "1.0",
  "action": "fuse",
  "entity": {
    "id": "person:jane_smith",
    "type": "Person",
    "tier": "verified",
    "vector": [0.12, -0.05, 0.88, 0.34],
    "kv": { "name": "Jane Smith" },
    "relations": {
      "secondary": [
        { "predicate": "has_email",
          "object": "jane@corp.com" }
      ]
    }
  }
}
Fuse Actions

Write entities atomically across all three layers. Supports JSON manifests, Markdown (YAML frontmatter), and Excel files for bulk ingestion.

Query Selectors

Query by entity ID with selector.id, or by vector similarity with selector.vector.$near. Hydration options control relationship depth (1–4 degrees).

Bulk Seeding

The seed CLI command recursively ingests a directory of JSON, Markdown, and Excel files. Batch commits at 100 entities prevent transaction overflow.

CLI & Observability

CLI Commands

CommandDescription
storeSingle entity write via command-line flags
queryForward graph index lookup by subject
uflParse and fuse a UFL manifest JSON file
seedRecursive directory ingestion (JSON, MD, XLSX)
serveHTTP observability server with health endpoints

Observability Endpoints

GET /healthz

Liveness probe. Returns 200 ok whenever the process is running.

GET /readyz

Readiness probe. Returns 200 ok when the database LOCK file exists and disk usage is below 90%.

Ready to Build?

One license unlocks the full FusionDB engine — Windows installer, Linux binary, and Go library.