JouleDB
An energy-metered database engine. Every operation, store, query, HDC bind, cascade tier dispatch, is measured in joules, and the receipt is cryptographically anchorable.
JouleDB takes one position: the right unit of account for database + AI work is the verifiable joule, and a deterministic spine with the model at the leaves is how you minimize it. It is not a competitor to a lakehouse or a warehouse, it is a different axis.
Free and open research project, released under MIT OR Apache-2.0 (see
COPYRIGHT). This is a capability showcase, published to demonstrate the architecture, not a managed service.
What it is
One B-tree storage substrate carrying:
- 7 query languages, SQL, Cypher, CQL, GraphQL, Datalog, SPARQL, Gremlin (+ InfluxQL/PromQL +
SigQLbiosignals), over one engine, not separate stores. - SSI MVCC copy-on-write + instant branching (
joule-db-branch) with Phase 5/6 atomic publish, depth-bounded cycle-safe traversal,DBSPincremental views,TriModal RRF(BM25 ⋈ RaBitQ 1-bit POPCNT ⋈ HDC) + ACORN 2-hop rescue, andHippoRAGPersonalized PageRank. - A deterministic cascade as the substrate, not a router bolted in front of an LLM:
LSN LangCache (95 nJ) -> Engram O(1) Memory (220 nJ) -> TriModal RRF / HDC -> LittleBit-2 Living Synapse. JouleSynapse&JouleHarness(joule-db-weights+joule-db-gpu): compiles HuggingFace.safetensorscheckpoints into SQL-queryable sub-1-bit (< 0.60BPW)LittleBit-2bitplanes executed viawgpuMetal/Vulkan/WebGPUXNOR + countOneBits(POPCNT) shaders, paired with SakanaSVFonline adaptation, GoogleTitanssurprise-gated plasticity (with MVCCrollback_to_lsn),AirLLM/PowerInferVRAM-capped streaming,MooncakeRadix KV blocks, and durable CRC32+zstdJSYNsnapshots.- Post-Docker
JouleCapsule, Post-GitJouleSpace, andJouleWardCapability Confinement: daemonless pure-Rust OCI Distribution v2 pulls + $O(1)$ CoW rootfs branching,Zed Delta/Jujutsuoperation logs + multimodal rooms, RFC-2104ThermoCapoffline-attenuatable capability macaroons, macOSSeatbelt/ LinuxLandlock+bwrap+seccomp-bpf/WASI 0.2confinement,Dagger-class 0-spawn Merkle action memoization, single-file SHA-256.jcapbundles, and drop-in OpenAI (/v1/*) & Ollama (/api/*) wire endpoints. - High-resolution heterogeneous 6-rail energy accounting (
joule-db-energy+JouleWard): 1-nanojoule (nJ) and 1-nanosecond (ns) attribution acrosscpu_nj,gpu_nj,npu_ane_nj,dram_uma_nj,storage_nvme_nj, andnetwork_wire_njspanningMcuBareMetal,WasmEdgeIsolate,MobileNpu,EdgeRobotic,AppleUmaWorkstation,LinuxAccelerator, andCloudCxlCluster, Merkle-anchorable viajoule-db-ledger. - An HDC runtime, 15 irreducible primitives (bind / bundle / permute / Reflect / Inhibit / Spawn / ...), zero-train one-shot learning (70.0% Hits@1 / 88.1% Hits@10 on WN18RR at ~10 uJ/prediction; 100% on LongMemEval-60).
- Wire surface: native binary protocol (JWP), PostgreSQL pgwire compatibility, Arrow Flight SQL, WebSocket, HTTP, MCP Streamable HTTP, OpenAI
/v1/*, and Ollama/api/*.
What it is not (read this)
This repository is published with its limitations stated, because a credible showcase states them:
- Self-hosted software, not a managed cloud service. Raft, 2PC, sharding, and multi-node Heterogeneous Fabric routing ship and are verified by Jepsen-style fault-injection tests; OpenIE does not operate a commercial multi-region SaaS control plane from this repo.
- Panic-hardened core & server (
#![deny(unsafe_code)]injoule-db-core,deny(clippy::unwrap_used)across all 7 core crates:core,local,weights,branch,ledger,query,server), while auxiliary workspace crates continue ongoing clippy cleanup. - Private frontier reasoning models are separate. All open-source engine crates here compile standalone from
crates.iowith zero proprietary dependencies (joule-db-weightsnatively ingests standard open.safetensorscheckpoints); private frontier reasoning plugins are not in this repository. - The amorphic engine's pattern-language resolver is feature-gated off in this build (it depends on a separate project). The storage-side amorphic path is intact; the pattern-lang-backed codegen path is not shipped.
For the full architectural assessment see docs/WHITEPAPER-JOULEDB-2026-05.md and docs/jouledb/SOTA-SWOT-2026-11.md.
Why it exists
In 2026 the database+AI field converged on one move, collapse OLTP/OLAP/AI into one governed substrate, put an agent on top, and re-derived two of JouleDB's design points independently: copy-on-write versioned storage with instant branching, and deterministic complexity-routing in front of the model. Those arrivals were measured in dollars. JouleDB was built on the same structure because the unit of account is the verifiable joule.
Quickstart
- Rust client SDK,
docs/jouledb/SDK-RUST.md - C ABI / WASM / ODBC / LangGraph,
docs/jouledb/SDK-*.md - Per-query-language references,
docs/jouledb/QUERY-*.md - Wire protocol,
docs/MGAI-JWP-PROTOCOL.md; pgwire compatibility,docs/MGAI-PGWIRE-COMPAT.md - HDC primitive reference,
docs/MGAI-HDC-REFERENCE.md - Architecture & honest assessment,
docs/WHITEPAPER-JOULEDB-2026-05.md
Layout
crates/joule-db-*, the engine (core, local, query, server, client, c, browser, edge, gpu, branch, crdt, ternary, features, energy, viz, weights, ledger, langgraph, hdc, domains, amorphic, odbc, test-harness, benches, quickstart).
Supporting infra crates: jwp (wire protocol), sigql, inv-mcp-core, jpb-core, inv-energy-core, inv-hdc-core, and the inv-auth/post-quantum-crypto cluster.
License
Copyright (c) 2026 Open Interface Engineering, Inc. Licensed under either of Apache License, Version 2.0 (LICENSE-APACHE) or the MIT license (LICENSE-MIT), at your option, for the binaries, the documentation and the examples. Earlier releases and earlier versions of this README described the binaries as Business Source License 1.1; that no longer applies.