DBX + Jurix — Zero-Leakage Per-Tenant Vector Memory for Enterprise AI\
💡 Inspiration
Generative AI is transforming industries, but enterprise adoption in regulated sectors—such as law, healthcare, and finance—has hit a hard wall. That wall is data sovereignty and tenant leakage.
Today’s standard AI architectures rely on shared, multi-tenant vector databases where embeddings from thousands of different customers are indexed in a single pooled graph. If a tenant filter is misconfigured, a prompt injection bypasses guardrails, or a cross-tenant index sweep occurs, confidential data leaks. In legal practice, if Client A’s confidential acquisition agreement or trade secret surfaces in Client B’s retrieval window, that is an immediate breach of attorney-client privilege and legal malpractice.
Running a separate, dedicated database cluster for every single customer or matter is cost-prohibitive and operationally impossible.
Our inspiration: What if we built a database engine from the ground up that guarantees mathematical, cryptographic, and memory-boundary tenant isolation at the speed of in-memory caching?
That vision produced DBX—a per-tenant memory engine written in Go—and Jurix—the legal diligence and contract audit workbench demonstrating DBX's real-world power.
⚙️ What It Does
DBX + Jurix is a full-stack, enterprise-grade AI infrastructure and vertical application suite:
DBX (The Vector Engine):
Acts as a dedicated, low-latency state and vector memory engine per tenant. Runs natively on the Redis Serialization Protocol (RESP) alongside an HTTP control plane. Isolates each customer into independent memory partitions with dedicated WAL logs, eliminating cross-tenant leakage by design. Delivers sub-millisecond approximate nearest neighbor (ANN) vector search. Jurix (The Legal Reviewer’s Workspace):
A commercial contract diligence and risk audit cockpit built for attorneys. Ingests agreements (NDAs, MSAs, DPAs) and performs line-anchored clause audits against firm playbooks (liability caps, breach notifications, governing laws). Generates exact, clickable source citations down to the character offset (no AI hallucinations). Tracks reviewer decisions (Accept, Reject, Resolve) with cryptographic evidence fingerprinting. Conducts pre-bill narrative audits against ABA litigation/activity codes to flag billing guideline violations before invoicing. 🧠 Math & Core Mechanics DBX is built on principled systems programming and applied mathematics, avoiding third-party vector wrapper libraries:
- Hierarchical Navigable Small World (HNSW) Graphs For high-dimensional similarity search, DBX implements a native multi-layer HNSW graph:
Probabilistic Layer Assignment: Vectors are assigned to hierarchical layers according to a geometric distribution: $$l = \lfloor -\ln(\text{uniform}(0, 1)) \cdot m_L \rfloor$$ where $m_L = \frac{1}{\ln(M)}$. Top layers have sparse, long-range links for rapid coarse-grained exploration (resembling a skip-list), while lower layers provide dense clustering for high precision. Bounded Beam Search: Graph exploration uses dynamic candidate queues bounded by $efConstruction$ and $efSearch$ to balance query latency against recall accuracy (>99% recall at sub-millisecond response times).
- Distance Metrics & Scalar Quantization (SQ8) Cosine Similarity & Normalized Inner Product: $$\text{Cosine}(u, v) = \frac{u \cdot v}{|u|2 |v|2} = \frac{\sum{i=1}^{d} u_i v_i}{\sqrt{\sum{i=1}^{d} u_i^2} \sqrt{\sum_{i=1}^{d} v_i^2}}$$ SQ8 Memory Compression: High-dimensional FP32 vectors (typically 4 bytes per dimension) consume massive RAM. DBX implements 8-bit Scalar Quantization (SQ8), compressing 32-bit floats into 8-bit integers via per-vector linear min-max scaling: $$q_i = \text{round}\left(255 \times \frac{x_i - x_{\min}}{x_{\max} - x_{\min}}\right)$$ This achieves a 75% memory reduction (from 1536 floats = 6,144 bytes to 1,536 bytes) with virtually zero degradation in ranking accuracy.
Late Fusion Hybrid Scoring Pure vector search often misses exact entity names or statutory numbers. DBX combines sparse BM25 keyword matching with dense semantic embeddings using Reciprocal Rank Fusion (RRF): $$RRF(d) = \sum_{m \in M} \frac{1}{k + r_m(d)}$$ where $r_m(d)$ is the rank of document $d$ in system $m$, and $k$ is a smoothing constant ($k \approx 60$).
Sharded Concurrency & Cryptographic Boundaries 256 Concurrent Memory Shards: Rather than using a single global mutex that bottlenecks under heavy multi-tenant read/write loads, DBX partitions key-spaces across 256 independent memory shards using FNV-1a hashing: $$\text{hash} = \left(\text{hash} \oplus \text{byte}\right) \times 16777619$$ Append-Only Write-Ahead Logging (WAL): Every vector insertion and state mutation is written to an fsync-flushed, CRC32-checksummed append log before being committed to memory, guaranteeing durability without blocking read throughput. Evidence Fingerprinting in Jurix: Reviewer decisions are anchored to an SHA-256 state fingerprint: $$\text{Fingerprint} = \text{SHA256}(\text{SourceQuote} \parallel \text{LineRange} \parallel \text{PolicyVersion})$$ If a contract is revised or a playbook rule changes, old decisions are automatically marked stale while preserving the audit history. 🏗️ Architecture & How We Built It +-----------------------------------------------------------------------------------+ | JURIX FRONTEND | | React 19 + TypeScript + Vite + Tailwind CSS + Lucide | | (Line Anchors, Diligence Matrix, Playbook Editor, Pre-bill) | +-----------------------------------------------------------------------------------+ | HTTP / REST + CSRF | +-----------------------------------------------------------------------------------+ | JURIX SERVER | | FastAPI + SQLite WAL (AES-256-GCM) | | - Line Anchor Extraction (pypdf/docx) - Regulatory Watches | | - Policy Engine & Heuristics - Pre-bill ABA Code Auditor | +-----------------------------------------------------------------------------------+ | | OpenAI-Compatible REST RESP Protocol (TCP 6380) | | +---------------------------+ +-----------------------------------+ | NVIDIA NIM / AI | | DBX DATABASE | | - Meta Llama-3.1-Nemotron | | Custom Go Storage Engine | | - NV-EmbedQA Vectors | | - 256 Memory Shards (FNV-1a) | | - High-Throughput GPU | | - HNSW Multi-Layer ANN Search | | Inference Microservice | | - Per-Tenant Dedicated WALs | +---------------------------+ | - Control Plane Orchestrator | +-----------------------------------+ Storage Engine: Engineered in Go for native memory control, goroutine-backed concurrency, and minimal GC overhead. Application API: Built with Python 3.13, FastAPI, and SQLite WAL encrypted with 256-bit AES-GCM payloads. Frontend: Crafted in React 19, TypeScript, and Tailwind CSS, featuring dark/light glassmorphic modes, responsive layouts, and zero external component library bloat. Deployment & CI: Containerized via multi-stage Docker builds, automated under GitHub Actions, and orchestrated for cloud-native private server deployment.
🚧 Challenges We Faced
Eliminating Mutex Contention in Vector Graphs: Problem: HNSW graph construction requires exploring neighbors and updating bidirectional edge lists. Under concurrent multi-tenant ingestion, a global lock degraded performance. Solution: Implemented fine-grained, per-node read-write locks and partitioned memory into 256 independent shards, allowing different tenants to insert and index simultaneously without contention. Deterministic Evidence Anchoring: Problem: LLMs tend to summarize or slightly rephrase quotes, breaking legal citations when matching back to original documents. Solution: Implemented an exact character-and-byte verification pass in Jurix. Before an anchor is rendered, the system verifies its presence and coordinates in the ingested text; missing clauses are explicitly flagged without hallucinated quotes. CI/CD Cache & Cross-Platform Quirks: Problem: Differences between Windows filesystem permissions and Linux GitHub Actions runners caused CI test failures when creating temporary pytest temp directories and resolving dependency vulnerabilities. Solution: Diagnosed runner execution logs via GitHub's API, integrated directory provisioning scripts into the workflow, and updated locked lockfiles to achieve 100% green test passes across 102 integration tests.
🏆 Accomplishments We Are Proud Of
Built a Real Database from Scratch: We did not just build a UI on top of Pinecone or Milvus. We wrote a high-performance vector and key-value database engine in Go with native RESP protocol support. True Zero-Leakage Architecture: Demonstrated that Tenant B cannot query, scan, or access Tenant A's vector space, even when hosted on the same physical node. 102 Passing Integration Tests: Built comprehensive automated test coverage spanning account isolation, evidence immutability, foreign-tenant boundaries, and concurrency stress testing. Production-Grade Developer Experience: Provided complete tooling—including live CLI orchestration, migration scripts (migrate.py), automated encrypted backup/verify scripts, and a multi-stage Docker environment.
📚 What We Learned
Tenant Isolation Belongs at the Storage Layer: Trying to enforce tenant privacy purely through application-level SQL WHERE tenant_id = ? or vector metadata filters is prone to human error, injection attacks, and developer oversights. True multi-tenancy must be enforced at the memory and file boundary. Vector Quantization is a Superpower: Moving from FP32 to SQ8 quantization yields a 4x reduction in RAM requirements while preserving over 98% of top-k recall, dramatically slashing infrastructure costs. Lawyers Value Determinism Over Creativity: In legal tech, an AI that hallucinates a single statute or slightly misquotes a liability cap is worse than useless. Deterministic rules, clear audit trails, and human-in-the-loop verification are what legal practitioners actually require.
🔮 What's Next for DBX & Jurix
NVIDIA cuVS & GPU-Accelerated Indexing: Integrating NVIDIA's cuVS library to offload HNSW graph construction and distance computations to NVIDIA Tensor Core GPUs for billion-scale vector ingestion. Multi-Modal Evidence Diligence: Expanding Jurix to ingest patent diagrams, site survey photos, and engineering blueprints using NVIDIA NeMo Retriever multimodal models. Enterprise SSO & SAML Integration: Adding Okta and Azure AD integration for law firm enterprise single sign-on and role-based client portal access. Clustered Raft Consensus: Implementing a Raft-based consensus protocol in DBX for active-active high availability and automated disaster recovery across geographical zones.
Log in or sign up for Devpost to join the conversation.