hyperspace-db

Library Listed

[H] HyperspaceDB is a high-performance, vector database. It features 1-bit quantization, async replication, and native support for hierarchical datasets (Lorentz, Poincaré ball & Hybrid models).

Checked · Sources

Downloads
96
Dependents
3
Stars
163
Forks
20
Contributors
5
Commits
256
Latest release
4.2.0 ·

About

From the project README ·

[H] HyperspaceDB: The Spatial AI Engine

v4.2.3 | The World's First Schema-Driven Spatial AI Engine & Extensible Vector Runtime (hyperspace-pdk).

Why Spatial AI? • Use Cases • Architecture • Benchmarks • SDKs


🌌 What is HyperspaceDB?

Traditional vector databases were built to search static PDF files for chatbots. HyperspaceDB is built for Autonomous Agents, Robotics, and Continuous Learning.

It is the world's first Spatial AI Engine — a mathematically advanced memory infrastructure that models information exactly how the physical world and human cognition are structured: as hierarchical, spatial, and dynamic graphs.

By combining Hyperbolic Geometry (Poincaré & Lorentz models), Lock-Free Concurrency, and an Edge-to-Cloud Serverless architecture, HyperspaceDB allows machines to navigate massive semantic spaces in microseconds, using a fraction of the RAM required by traditional databases.

🧠 Why a Spatial AI Engine? (Beyond RAG)

AI is moving from text-in/text-out to autonomous action. Agents need episodic memory and spatial reasoning. HyperspaceDB provides the primitives to build it:

Read the full README
  • Fractal Knowledge Graphs: Euclidean vectors fail at hierarchies. Our native Hyperbolic engine compresses massive trees (like codebases or taxonomies) into 64-dimensional spaces, reducing RAM usage by 50x without losing semantic context.
  • Continuous Reconsolidation: AI agents need to "sleep" and organize memories. With our Fast Upsert Path, CDC Event Streams, and built-in Riemannian Math SDK (Fréchet mean, parallel transport), your agents can continuously shift and prune vectors dynamically.
  • Edge-to-Cloud & Offline-First: Drones and humanoid robots can't wait for cloud latency. HyperspaceDB runs directly on Edge hardware, using a Merkle Tree Delta Sync protocol (SyncHandshake, SyncPull, SyncPush) to asynchronously handshake and sync episodic memory chunks with the Cloud when the network is available.
  • Serverless at Billion-Scale: HyperspaceDB dynamically unloads idle logic to disk/S3, enabling you to host millions of vectors across thousands of tenants on a single commodity server, acting as the "Neon of Vector Search."

🚀 Core Pillars (v4.2.3)

⚡ 1.58-Bit Ternary BitNet Quantization & Adaptive Filter (v4.2.3)Native BitNet {-1, 0, +1} ternary quantization using 2 bits per dimension (16x RAM reduction vs f32, 4x vs int8) with dynamic thresholding $\gamma = 0.7 \cdot \mathbb{E}[|x|]$, SIMD popcount dot-product kernels, and two-pass re-scoring. Paired with Cost-Model Adaptive Filtered Search eliminating the 5–10% selectivity HNSW collapse (15–32× faster queries) through chunked Rayon-parallel filtered scanning with prefetch_l1.
🚀 Hardware Runtime SIMD & f32 SQ8 Kernels (v4.2.2)High-throughput SIMD vector distance kernels (sq8_l2_sq and sq8_dot) with dynamic CPU detection (AVX-512, AVX2+FMA, ARM NEON, scalar fallback). Query vectors are quantized to f32 once per search, accelerating SQ8 Poincaré, Lorentz, and Euclidean calculations by up to 3.4×. Combined with an Epoch-Based Visited Set Lifecycle (u16 generation tokens) that eliminates per-query fill(0) cache flushing overhead on multi-million node indexes.
💾 Auto-Freezing Flat Layer-0 Navigation (v4.2.2)Contiguous, strided 64-byte cache-aligned Layer-0 memory layout (FlatLayer0Segment, FlatNodeHeader, AlignedBuffer) automatically frozen during snapshot persistence and reloaded zero-copy. Eliminates pointer chasing and DRAM latency bottlenecks, delivering +26.5% QPS boost and 2.3× lower P99 tail latency with 100% backward compatibility across existing v4 collections without manual migration.
🔌 Hyperspace PDK (hyperspace-pdk v4.2.2)pgrx-inspired extension architecture turning HyperspaceDB into an extensible Spatial Runtime. Includes 3 built-in flagship plugins out of the box: hs-embed (Zero-Python in-engine Markdown chunker, multi-manifold vectorizer & sequential KAG graph linker), hs-git-ast (instant AST codebase symbol & KAG topology builder for Rust, Python, TypeScript/JS, and Go), and hs-shield (Zero-Knowledge O(D log D) FWHT orthogonal projection defending against Vec2Text inversion with 100% distance preservation). Exposed dynamically in Python, TypeScript, and Rust SDKs via client.ext.<plugin>.<method>(...).
📐 Universal 12-Metric SIMD Vector EngineFirst-class support for 12 distance metrics (l2, cosine, dot, l1, linf, angular, jaccard, hamming, poincare, lorentz, hybrid, wasserstein) backed by hardware-dispatched (AVX-512F, AVX2+FMA, ARM NEON) zero-copy byte-slice kernels and zero-allocation HNSW search hot paths.
🕸️ Native Vector-Graph (KAG Engine)Native in-engine topological graph representation (Property CSR with 12-byte packed edges in graph.csr). Replaces fragile dual-database patterns (vector DB + Neo4j) with sub-microsecond BFS traversals across vector search seed nodes, explicit edge linking (link, link_batch, unlink), declarative metadata induction (path_hierarchy, foreign_key, exact_match), and 33D Lorentz Minkowski light-cone causal subsumption.
⚖️ Tribunal Router (Geometric Hallucination Prevention)Post-generation geometric verification endpoint (VerifyGeneration) in tribunal.rs. Computes on-the-fly geodesic paths and Lorentz light-cone boundaries between LLM generated answers and source context chunks, producing mathematical trust_score (0.0–1.0) and is_hallucination flag without making any assumptions about underlying vector quantization.
🗺️ Enterprise Query PlannerIntelligent natural language query optimization and AST execution engine (hyperspace_query_planner). Automatically decomposes user questions into optimized sub-queries, executes parallel vector/geometric retrieval, applies filters and light-cone traversals, and synthesizes enriched context. Available across MCP, LangChain, LlamaIndex, n8n, and Agent Skills.
⚡ Thread-per-Core EngineShared-Nothing architecture inspired by Seastar. Each physical CPU core runs an isolated, lock-free shard partition (ShardedCollection) with deterministic routing (hash(id) % N). Eliminates cross-core cache line bouncing and lock contention, delivering 142.5 QPS (C=1) to 311.6 QPS (C=10) on 1024D dense search (4.52× faster vs v3) and 67,500 vec/s server core ingestion throughput.
🧬 Out-of-Core SuperKMeans & ADSampling (v4.1.0)Native, zero-FFI pure Rust implementation of SuperKMeans (hyperspace-clustering v4.1.0). Supports Out-of-Core Streaming K-Means via Dataset and Matrix<'a>, cutting peak RAM by up to 1,000× on large datasets (58 MB vs 61.4 GB for 10M vectors). Employs BKT-drop 2-phase splitting (100k vectors clustered in 144.88 ms at ~690,000 vec/s with CV = 0.277), Adaptive Distance Sampling (ADSampling) pruning 90%+ distance checks, and disk-backed Voronoi semantic compaction (SemanticCompactor).
🌐 Hierarchical Macro-Routing & 21.2B+ Addressing2-level hierarchical macro-routing in MetaRouter clusters chunk centroids into super-regions, pruning probe evaluations from $O(C)$ to $O(\sqrt{C} + K)$. Universal 64-bit ID addressing (u64) handles 21.2+ Billion vectors globally while preserving 32-bit RAM density inside HNSW graph nodes (local_id: u32).
💾 Direct I/O Hardware StorageHigh-IOPS Direct I/O storage engine (DirectVectorStore) using 4096-byte page alignment and native O_DIRECT (Linux) / F_NOCACHE (macOS). Bypasses OS page cache double-buffering, slashing MRL cascade tail latency (P99) from 33.75 ms to 3.14 ms (10.76× lower), boosting MRL throughput to 397.1 QPS (6.16× higher) with 99.87% Recall@10.
📐 Spatial AABB Indexing & Hardware PrefetchHierarchical 32-vector Axis-Aligned Bounding Box (AABB) pruning discarding 95% to 99.9% of candidate vectors before fetching vector memory for InBox and InBall geometric queries, delivering 1,774.0 QPS (22.28× higher vs v3) at 0.51 ms P50 latency. CPU hardware cache prefetch hints (_mm_prefetch on x86_64, prfm pldl1keep on Apple Silicon/Graviton) hide DRAM latency during HNSW beam traversal.
🔄 Autonomous Startup Migration & DurabilityZero-downtime auto-migration engine converting legacy v3 collections to partitioned v4 storage. Enforces strict filtering against live id_map and logs WalEntry::Delete tombstones (OpCode 5), guaranteeing zero resurrected points across restarts and crashes.
🚀 Hardware Performance Engine (v4.1.0)Micro-architectural hardware acceleration layer. Features Dynamic Runtime SIMD Dispatch selecting between AVX-512F (16xf32), AVX2+FMA (8xf32), and ARM NEON (4xf32) with unaligned loads and early-exit thresholding; Zero-Copy Inner Distance Kernels (distance_bytes_*) eliminating up to 50,000 heap allocations per second during HNSW graph descent; Linux io_uring Batched Positional I/O for single-syscall NVMe batch gathers; Multi-Socket NUMA-Aware Topology pinning tokio worker threads per socket for first-touch memory bus locality; and a 32-Stripe Sharded Payload Index eliminating lock contention.
⚙️ Reflex-Level SpeedBuilt on Nightly Rust. Our ArcSwap Lock-Free architecture and f32 SIMD intrinsics deliver 142.5 QPS (P50 6.98 ms, P99 7.84 ms) on 25k × 1024D dense search at 99.90% Recall@10, and up to 1,567 QPS with OPQ/PQ quantization and 1,774 QPS on Spatial AABB bounding queries. Full index construction completed in 78.54 s (43.45 s faster than v3). See BENCHMARK_V3_VS_V4_REPORT.md.
🔑 RBAC & Cross-Tenant SharingGranular Role-Based Access Control (Admin, ReadWrite, ReadOnly) using transaction-safe redb security storage. Support for namespaced URL collection referencing (owner:name or owner/name) for secure cross-tenant index sharing.
🕵️‍♂️ Audit Logs & IsolationHigh-performance structured JSON audit logging (off, low, medium, high, full levels) streaming to stdout or files. Real-time, tenant-isolated log buffers stream secure log feeds directly to the Web Dashboard.
🌿 Eco-Monitoring (EcoMonitor)Telemetry agent tracking carbon footprints of CPU/RAM computations per node. Visualizes ESG sustainability metrics and environmental compliance certification badges inside the dashboard UI.
⚡ L0 Hot Tier CacheTransparent two-level vector caching. Combines a thread-safe 64-shard L1 DashMap Cache (~1 µs lookups) with an L2 HNSW Fallback Graph (~100 µs lookups), featuring background TTL invalidation and automatic self-healing graph rebuilds.
💾 O(1) Payload IndexingHigh-throughput O(1) incremental indexing via append-only index write-ahead logging (WAL) in payload_store.rs, eliminating latency spikes and write amplification.
🔐 Zero-Knowledge Client Encryption & Vec2Text Defense (v4.1.1)Client-side isometric orthogonal $O(n)$ and Lorentz $SO^+(1, d)$ projections with calibrated anisotropic noise injection ($\sigma \le 0.02$). Neutralizes Vec2Text neural inversion attacks while preserving 100.0% Top-K neighbor recall across all 6 metrics (L2, Cosine, Dot, Lorentz, Poincaré, Hybrid). Raw text and payload attributes encrypted with AES-256-GCM. Surfaced as an ENCRYPTED badge in the Dashboard.
🧠 Autonomous Cognitive Agent Memory (v4.1.1)Native sub-4ms episodic memory layer for autonomous agents (Python, TypeScript, MCP). Combines Ebbinghaus Exponential Temporal Decay ($S(t) = S_0 \cdot e^{-\lambda \Delta t}$) integrated directly into vector scoring with zero LLM calls, and autonomous Temporal Superseding (directed SUPERSEDES edges) to instantly obsolete contradictory facts without external graph databases or secondary LLM consolidation passes.
🤖 Cognitive MCP & Zero-RAM SidecarNative Model Context Protocol (MCP) server for IDE agents (Claude, Cursor, Antigravity) with 6 cognitive tools. Zero-RAM Sidecar Payload streaming for LangChain and LlamaIndex to keep RAM lightweight.
📝 Real-Time WriteBufferZero-latency searchability. Inserts instantly write to an in-memory WriteBuffer; searches execute Rayon-parallelized linear scans on the buffer and merge/deduplicate results with main HNSW results.
🧭 Schema-Driven CascadeNative MRL (Matryoshka) support. Define one schema with multiple layers; the RAM-resident CascadePipeline queries truncated dimensions in microseconds, automatically reranking results via full-resolution vectors on NVMe/S3.
🎓 Cognitive Math EngineFirst-class HNSW support for Euclidean (L2/Cosine), Poincaré Ball, Lorentz Hyperboloid metrics, and Wasserstein O(N) CFM. * **Implicit Graph Engine (v3.1)**: Stop hiding HNSW topology. Expose raw adjacency and navigate via **Lorentz Light-Cones** and **Wave Diffusion** (resonant semantic propagation). * **Graph Explorer (v3.1)**: High-performance canvas-based visualization of HNSW topology. Features Poincaré/Euclidean manifold projections, **Momentum Path Tracing**, and **Lyapunov Stability Radar**. * **Relativistic Traversal**: Use **Momentum Traversal** (Dirac) to swing through nodes with semantic inertia, predicting trajectories via Koopman extrapolations. * **Advanced Geometric Filters**: Native InBall, InBox, and InCone filters in core engine. Execute spatial K-Means, Fréchet Mean, and Parallel Transport directly in the Native SDK. Evaluate datasets via Gromov's Delta-Hyperbolicity.
📡 Agentic WorkflowsTrigger Memory Reconsolidation via Flow Matching natively to shift paradigms. Connect CDC Streams via subscribe_to_events to trigger secondary models. Hybrid Search (BM25) now supports RRF fusion for state-of-the-art lexical + semantic retrieval.
🧹 Metadata-Driven PruningAgents must forget to stay efficient. Use typed numeric Range Filters (energy < 0.1) inside a Hot Vacuum to automatically prune obsolete memories.
📦 LSM-Tree StorageOptimized for high-concurrency writes. Hot MemTables continuously flush into immutable Fractal Segments (chunk_N.hyp), enabling near-instant RAM reclamation and stable performance at billion-scale.
☁️ S3 Cloud TieringNative S3/MinIO tiered storage integration. Seamlessly offload cold segments mapping Petabytes of vectors linearly without scaling local SSDs. (Unlock via Cargo feature s3-tiering & HS_STORAGE_BACKEND=s3).
🔒 Zero-Knowledge ZK-PrivacyProtect sensitive agent memories and database operations. Supports multi-SDK Zero-Knowledge client-side encryption. Vectors are projected, noise-injected, metadata is hashed, and payloads are AES-GCM encrypted before leaving the client, keeping database nodes blind to raw values while preserving distance metrics.
⛏️ DePIN & Billing EnforcementsDecentralized Vector Network infrastructure. Includes in-process single-binary node execution, continuous storage rental billing (per byte-hour) with automated grace periods/deletion, signed ticket verification (Ed25519) on query time with replay protection, and user-throttling.

🕸️ Native Vector-Graph (KAG): Why HyperspaceDB vs The Market?

Traditional vector databases treat documents as isolated points in Euclidean space. In complex regulatory, cybersecurity, aerospace, and medical domains, pure vector search fails to retrieve 77.9% of structural prerequisites and causal containment steps.

HyperspaceDB solves this by unifying HNSW vector indexing and a Property Compressed Sparse Row (CSR) Graph within the same shared-memory address space and L1/L2 cache line.

[!IMPORTANT]

🏆 Empirical Proof Across 12 Production Playbook Collections (16,001 Vectors, 18,402 Edges):
  • Causal Context Completeness: 100.0% Recall with KAG vs 22.1% in Pure Vector Search.
  • Zero Lost Steps: Pure vector search misses up to 93.8% of containment steps (e.g. in SOC MITRE TTPs and SEC capital rules). KAG deterministically captures every prerequisite.
  • Sub-Millisecond Graph Traversal: ~5 µs native CSR bitset traversal at the CPU core, 2.36 ms (p50) end-to-end over HTTP.
  • Total Decision Latency: 3.37 ms (p50) combining vector entry match + multi-hop graph reachability.
⚔️ Comprehensive Competitive Matrix
Capability / MetricHyperspaceDB v4.1 (KAG)Microsoft GraphRAGFrankenstein Stack (Vector + Neo4j + Postgres)Graph DBs with Vectors (Neo4j Vector)Pure Vector DBs (Pinecone / Qdrant)
System ArchitectureUnified Single-Binary Thread-per-Core LSMPython pipeline script on top of Parquet files3 separate distributed database clustersSingle JVM cluster with Lucene pluginSingle vector cluster with flat metadata
Edge Storage Format12-byte packed CSR in RAM/SSD (graph.csr)Parquet text tables & graphsNeo4j pointer lists + JVM HeapLucene inverted lists + JVM HeapNo edges (flat key-value metadata)
Graph Ingestion Cost$0 (Zero LLM token costs)$100 – $1,000+ per dataset in LLM prompts$0 (Manual Cypher ETL scripts)$0 (Manual Cypher ETL scripts)N/A (Cannot represent graphs)
Graph Creation Time2 – 15 millisecondsHours to daysMinutes to hoursMinutes to hoursN/A
End-to-End Decision Latency3.37 ms5 – 30+ seconds40 – 120 ms (Network hop tax)20 – 50 ms5 – 15 ms (Isolated vectors only)
Graph Traversal Speed~5 µs (L1/L2 cache hit)N/A (LLM community summary)15 – 40 ms (Cypher query parser)5 – 15 msN/A (No topological traversal)
Causal Context Recall100.0% (Complete)~85–95% (LLM non-deterministic)100.0% (If manual links exist)100.0% (If manual links exist)22.1% (Severe 77.9% blind spots)
Hyperbolic GeometryNative 33D Lorentz & Poincaré Ball❌ None❌ None❌ None❌ None
Real-Time Streaming WritesInstant (LSM WriteBuffer + DynamicGraph)❌ Batch-only (Recomputes Leiden communities)⚠️ Complex (Distributed 2PC sync)⚠️ Slow vector batch updates✅ Fast vector writes
Hardware Memory Footprint~1 MB RAM per 20,000 edgesHigh (Pandas/Parquet memory)Extremely High (JVM + Go + Postgres)High (JVM Heap + Off-Heap)Moderate

⚡ L0 Hot Tier Caching & WriteBuffer (Real-Time Ingestion)

To maximize read throughput and achieve true real-time ingestion, HyperspaceDB implements a transparent, dual-component memory tier:

graph TD
    Request[Incoming Request] --> Action{Write or Search?}
    
    Action -->|Insert| WB[WriteBuffer in RAM]
    WB --> WAL[WAL Log]
    WB --> IndexQueue[Active Indexing Queue]
    
    Action -->|Search| CacheCheck{L0 Cache Hit?}
    CacheCheck -->|Yes L1/L2 Hit| FastOut[Instant Result ~1 µs - 100 µs]
    CacheCheck -->|No Cache Miss| SearchMerge[Merged Scatter-Gather Search]
    SearchMerge --> HNSWS[HNSW Index search]
    SearchMerge --> WBS[WriteBuffer Rayon Parallel Scan]
    HNSWS --> Deduplicate[Deduplicate by external ID & Re-rank]
    WBS --> Deduplicate
1. Transparent L0 Hot Tier Cache (hyperspace-cache)

The L0 Cache resides directly on the read path, enabling blistering microsecond-level vector retrievals:

  • L1 exact-match Cache: Uses a 64-shard thread-safe DashMap for key-value point lookups. Latency is an imperceptible ~1 µs.
  • L2 approximate-match Cache: Uses an in-memory HNSW graph (instant-distance) with ArcSwap for atomic lock-free reads during background updates. Latency is ~100 µs.
  • Time-To-Live (TTL): Automatic scanning of the __ttl metadata field every 100 ms. Expired keys are invalidated, and tombstones are added to L2.
  • Auto-rebuild and Cooldown: When L2 tombstones exceed 30%, a self-healing background task rebuilds the L2 graph, protected by a 5-second cooldown to prevent CPU-rebuild thrashing.
  • Metadata Warmup: Rebuilding or starting up automatically warmloads key-value metadata from metadata.forward, ensuring that payloads are instantly available upon cache hits.
2. Real-Time WriteBuffer

A lock-free in-memory buffer ensuring newly inserted vectors are searchable from the very first millisecond:

  • Instant Searchability: Newly inserted vectors are placed in the WriteBuffer while HNSW graph links are built in the background.
  • Rayon-Parallel Linear Scan: Queries perform multi-threaded linear scans over the WriteBuffer utilizing AVX2/NEON vector instructions, computing Euclidean/Hyperbolic distances and running complex box/cone region filters in < 2.0 ms for up to 50,000 active entries.
  • Deduplicated Merging: Results from the main HNSW graph and the WriteBuffer are merged, sorted, and deduplicated by external ID to return highly accurate, real-time lists.
  • Snapshot Promotion: Upon HNSW graph integration, background workers evict indexed entries from the WriteBuffer, keeping the RAM footprint minimal.
📊 L0 Cache & Ingestion Performance Results

A rigorous 22-test validation suite confirms the stability and performance of the memory acceleration layer:

  • Cache-Hit Ratio: Achieves >98% Recall accuracy on recurrent L1 lookups, with a zero-copy fast path for de-quantized floats.
  • rebuild_cooldown Verification: Successfully throttles back-to-back index updates, queuing pending vectors correctly.
  • tombstone_trigger Auto-rebuild: Automatically resolves up to 5,000 concurrent deletions, reclaiming memory map segments with zero leaks.
  • WriteBuffer linear scan: Demonstrates Rayon multi-threaded lookup times under 1.8 ms for bulk vector batches.

🤖 Target Use Cases

  1. Robotics & Autonomous Drones: On-device semantic memory, Hierarchical SLAM, and offline-first edge synchronization.
  2. Continuous Learning Systems (AGI): Frameworks doing Riemannian optimization, memory reconsolidation, and Hausdorff-based graph pruning.
  3. Enterprise Graph AI: Merging relational logic with semantic proximity for massive multi-scale data analysis (Code ASTs, Medical Taxonomies).
  4. High-Load RAG & SaaS: Traditional search, but significantly cheaper to operate due to Serverless Idle Eviction and multi-tenant isolation.

⚡ 1 Million Vectors Benchmark (v3.0)

We pushed HyperspaceDB v3.0 to the limit with a 1 Million Vector Dataset. The results define a new standard for performance and efficiency.

🏆 Hyperbolic Efficiency (Poincaré 64d)

When using the native Hyperbolic (Poincaré) metric, HyperspaceDB achieves unparalleled throughput by reducing dimensionality (64d) while preserving semantic structure achievable only with 1024d in Euclidean space.

MetricResultvs Euclidean
Throughput156,587 QPS ⚡8.8x Faster
P99 Latency2.47 ms3.3x Lower
Disk Usage687 MB13x Smaller
⚔️ Euclidean Performance (1024d)

Even in standard Euclidean mode, HyperspaceDB outperforms competitors on standard hardware.

DatabaseTotal Time (1M vectors)Speedup Factor
HyperspaceDB56.4s ⚡1x
Milvus88.7s1.6x slower
Qdrant629.4s (10m 29s)11.1x slower
Weaviate2036.3s (33m 56s)36.1x slower
📉 Zero Degradation Architecture

While other databases slow down as data grows, HyperspaceDB maintains consistent throughput.

  • Weaviate degraded from 738 QPS -> 491 QPS (-33%).
  • Milvus fluctuated between 6k and 11k QPS.
  • HyperspaceDB held steady at ~156k QPS (Hyperbolic) and ~17.8k QPS (Euclidean).
💾 50% Less Disk Usage

Store more, pay less. HyperspaceDB's 1-bit quantization and efficient storage engine require half the disk space of Milvus for the exact same dataset.

  • HyperspaceDB: 9.0 GB (Euclidean) / 0.7 GB (Hyperbolic)
  • Milvus: 18.5 GB

Benchmark Config: 1M Vectors, 1024 Dimensions (Euclidean) vs 64 Dimensions (Hyperbolic), Batch Size 1000.


⚡ v4.0.0 Grand Benchmark: Thread-per-Core & Direct I/O

HyperspaceDB v4.0.0 introduces a high-performance Thread-per-Core (Shared-Nothing) architecture with Hardware Direct I/O (4096-byte DMA alignment with O_DIRECT/F_NOCACHE), hierarchical Spatial AABB segment pruning, and autonomous startup migration.

🏆 Empirical VectorDBBench Verification (v3.x vs v4.0.0)
Scenario / Workloadv3.x Baselinev4.0.0 EngineDelta / ImprovementKey Architecture Enabler
Dense 1024D (100k Vectors)5.7 QPS60.7 QPS10.6× fasterHardware L1 Prefetching + SIMD f32 unrolling
• Tail Latency (P99)648.79 ms19.91 ms32.6× lower64-bit monotonic VisitedScratch tokens
MRL Cascade 1536D (50k Vectors)3.7 QPS81.8 QPS22.3× fasterDirect I/O NVMe DMA without page cache locks
• Tail Latency (P99)1,010.30 ms14.49 ms69.8× lower64D RAM Head + Page-aligned Direct disk streaming
Spatial Bounded Search (768D, 50k)4.4 QPS96.6 QPS22.1× fasterHierarchical Spatial AABB segment pruning
• InBox Filter P99 Latency78.41 ms0.66 ms118.8× lower>95% non-matching vectors pruned in RAM
Concurrency Saturation (C=100)30,056 ms2,678 ms11.2× stability gainEliminated cross-core lock contention (0 ns)

📌 Detailed comparative data available in BENCHMARK_V3_VS_V4_REPORT.md and BENCHMARK_GRAND_REPORT.md.


🗜️ Multi-Tier Vector Quantization Suite (v4.0.0)

HyperspaceDB v4.0.0 supports 7 quantization precision levels verified empirically across 20,000 unit-normalized 1024D embeddings (see BENCHMARK_QUANTIZATION_SWEEP.md):

ModeKeyBytes / VecCompressionSingle-Pass Recall@10Two-Pass Raw RerankSearch QPSMean LatencyPrimary Use Case
Full Precisionnone4,100 B1.0×100.00%Baseline203 QPS4.91 msLegal, Medical, Financial Ground Truth
Scalar SQ8medium1,028 B4.0×88.60%88.60%220 QPS4.52 msEnterprise RAG standard (75% RAM savings)
Block ScalarI4medium_plus772 B5.3×87.15%87.15%287 QPS3.47 msHigh-throughput microservices (Fastest)
TurboQuantturbo520 B7.9×86.95%99.95% (k=40)218 QPS4.57 msSpherical Lloyd-Max + Orthogonal Rotation
Ternary BitNetternary264 B15.5×41.00%92.60% (k=100)1,420 QPS0.70 msSOTA BitNet weights, 25.2× SIMD popcount dot speed
Optimized PQ (OPQ-64)opq68 B60.3×17.00% (73.4% rk4)99.85% (k=40)1,567 QPS0.63 msUltra-Scale ADC with FWHT rotation
Product Quant (PQ-64)pq68 B60.3×17.20% (73.1% rk4)99.80% (k=40)1,453 QPS0.67 msStandard Product Quantization with ADC
Extreme 1-Bit ADCextreme132 B31.1×35.75%75.45% (k=80)113 QPS8.85 msEdge, Robotics (ROS 2), IoT (< 132 MB / 1M vecs)

🔒 Security

  • API Keys: Secure endpoints with HYPERSPACE_API_KEY environment variable.
  • Header: Clients must send x-api-key: <key>.
  • Zero-Knowledge: Server stores only SHA-256 hash of the key in memory.

🤝 Federated Clustering & P2P Swarm (v3.0)

HyperspaceDB implements two distinct clustering architectures designed for both high availability in the Cloud and dynamic Edge-to-Edge discovery for robotics swarms.

1. Leader-Follower Replication (Cloud / High Availability)
  • Node Identity: Each node generates a unique UUID (node_id) and maintains a Lamport logical clock.
  • Leader: Handles Writes (Coordinator). Streams WAL events. Manages Cluster Topology.
  • Follower: Read-Only replica. Can be promoted to Leader.
2. Edge-to-Edge Gossip Swarm (Robotics / Local-First)

Designed for robotic swarms without a central Leader. Uses raw UDP multicasting to form a decentralized, self-healing network.

  • Zero-Dependency: Built on raw tokio::net::UdpSocket (no heavy libp2p dependencies).
  • Heartbeats: Nodes broadcast state via UDP. Disconnected nodes are automatically evicted after a TTL interval.
  • Auto-Discovery: Discover peers and instantly initiate a Delta Sync handshake to resolve diverging graphs.
  • Enable: Set HS_GOSSIP_PEERS (e.g. 192.168.1.10:7946) or HS_GOSSIP_PORT to join the swarm.
Data Synchronization (Edge-to-Cloud Delta Sync)

HyperspaceDB uses a 256-bucket Merkle Tree for efficient data drift detection, ideal for WASM/Edge targets updating offline:

  • Granular Hashing: Each collection is partitioned into 256 buckets (by vector ID % 256)
  • XOR Rolling Hash: Each bucket maintains an incremental hash of its vectors
  • Fast Diffing: Compare bucket hashes to identify which partition is out of sync
  • Bandwidth Optimization: Sync only affected buckets instead of full collection
WASM Sync Example

When your robot or web client comes back online, initiating a Sync is mathematically minimal:

// 1. Handshake: Send local 256 bucket hashes
const { diffBuckets } = await client.syncHandshake(collection, localBuckets);

if (diffBuckets.length > 0) {
    // 2. Pull only the modified/missing buckets from Cloud
    const stream = client.syncPull(collection, diffBuckets);
    stream.on('data', (vectorData) => applyLocal(vectorData));
    
    // 3. Push local offline edits back to Cloud
    client.syncPush(localEditsQueue);
}
Digest API
# HTTP
GET /api/collections/{name}/digest

# gRPC
rpc GetDigest(DigestRequest) returns (DigestResponse)

Response includes:

  • logical_clock: Lamport timestamp
  • state_hash: Root hash (XOR of all buckets)
  • buckets: Array of 256 bucket hashes
  • count: Total vector count
Cluster Topology API

View the logic state of the cluster via HTTP:

# Get Replication State
curl http://localhost:50050/api/cluster/status

# Get Decentralized Swarm Peers (Gossip)
curl http://localhost:50050/api/swarm/peers
{
  "gossip_enabled": true,
  "peer_count": 2,
  "peers": [
    {
       "node_id": "e8...0e",
       "role": "Leader",
       "addr": "192.168.1.20:50050",
       "logical_clock": 42,
       "healthy": true
    }
  ]
}
Starting a Cluster
# Start Leader
./hyperspace-server --port 50051 --role leader

# Start Follower
./hyperspace-server --port 50052 --role follower --leader http://127.0.0.1:50051

🕸️ WebAssembly (WASM) Support

HyperspaceDB can run directly in the browser via WebAssembly, enabling Local-First AI applications with zero network latency.

  • Zero Latency: Search runs in-memory on the client.
  • Privacy: Data never leaves the device.
  • Optimized: Uses RAMVectorStore backend for browser environments.

👉 Read the WASM Documentation

⚖️ Heterogeneous Tribunal Framework (Tribunal Router)

HyperspaceDB natively supports the confrontational model of LLM routing (Architect vs. Tribunal) directly on the vector graph.

Using the Cognitive Math SDK and the Graph Traversal API, the SDK calculates a Geometric Trust Score for any LLM claim by verifying the logical path length between concepts in the latent hyperbolic space.

If the geodesic distance (hops) between "Claim A" and "Claim B" on the graph is too large (or disconnected), the Trust Score drops to 0.0 (Hallucination).

from hyperspace.agents import TribunalContext

tribunal = TribunalContext(client, collection_name="knowledge_graph")

# Evaluates structural graph distance between concepts. 
# 1.0 = Truth (Identical), 0.0 = Hallucination (Disconnected)
score = tribunal.evaluate_claim(concept_a_id=12, concept_b_id=45)

🧠 Hybrid Search (BM25 + RRF)

Combine the power of Hyperbolic Embeddings with advanced BM25 lexical ranking.

# Search for semantic similarity AND keyword match (e.g. "iPhone 15")
results = client.search(
    vector=[0.1]*8, 
    top_k=5, 
    hybrid_query="iPhone 15", 
    hybrid_alpha=0.7,  # 70% vector, 30% lexical
    bm25={
        "method": "bm25plus",
        "language": "english"
    }
)

📊 Quantization Modes

All quantization is configured per-collection at creation time via HS_QUANTIZATION_LEVEL:

ModeValue (quantization)Bytes/vec (1024D)CompressionSupported MetricsBest for
SQ8 Anisotropicmedium / scalar1,028 B4× (vs f32) / 8× (vs f64)Cosine, L2, Poincaré, LorentzGeneral RAG / Best default recall at 1 byte/dim
Block ScalarI4medium_plus772 B5.3×Cosine, L2High-throughput services (287 QPS)
TurboQuant 4-bitturbo520 B7.9×Cosine, L2Spherical embeddings with Lloyd-Max bias correction
Optimized PQ (OPQ-64)opq68 B60.3×–64×Cosine, L2 (Euclidean tail in Hybrid)Massive scale with FWHT-rotated ADC table lookups
Product Quant (PQ-64)pq68 B60.3×–64×Cosine, L2Standard Subspace Product Quantization ADC
Binary ADC (1-bit)extreme / binary132 B31.1× (vs f32) / 62× (vs f64)Cosine, L2RAM-critical edge/robotics deployment
Lorentz SQ8automatic1,028 B4× / 8×Lorentz metric onlyHyperbolic embeddings with Minkowski time sign preservation
Full Precisionnone4,100 B1×All metricsExact ground truth, medical, legal compliance

⚠️ Metric Compatibility Notice:

  • Cosine & L2: Compatible with ALL quantization modes (none, medium, medium_plus, turbo, opq, pq, extreme).
  • Poincaré & Lorentz: Only compatible with none and medium (Scalar SQ8). Product Quantization (pq/opq) and 1-bit (extreme) assume Euclidean metrics and orthonormal rotations that violate conformal Poincaré boundary conditions ($|x| < 1$) and Lorentzian pseudo-Riemannian signature $(-1, +1, \dots, +1)$.
  • Hybrid (801D = 33D Lorentz + 768D Euclidean): Uses AsymmetricHybrid, where the 33D Lorentz head is kept unquantized/FP64 while the 768D Euclidean tail can be compressed with turbo, opq, or extreme.

The default scalar mode uses a ScaNN-inspired anisotropic loss $L = |e_\parallel|^2 + t_w \cdot |e_\perp|^2$ ($t_w=10$), which penalizes directional error more than magnitude error, improving Recall@10 by +5.3% (Cosine) and +3.8% (L2) versus isotropic SQ8.


Each geometry has its own independent backend, now featuring native support for Qwen3-Embedding (0.6B) and YAR v5 models:

ProviderDescriptionRecommended For
Local ONNXAny .onnx model from diskAir-gapped / Edge
HuggingFaceAuto-download, cache, and chunkHigh accuracy / Long context
Remote APIMistral / OpenAI / Cohere / VoyageCloud API offload

Example — Config for Qwen3 (1024d) and YAR v5 (128d):

HYPERSPACE_EMBED=true

# Cosine via Qwen3 (HuggingFace)
HS_EMBED_COSINE_PROVIDER=huggingface
HS_EMBED_COSINE_HF_MODEL_ID=onnx-community/Qwen3-Embedding-0.6B-ONNX
HS_EMBED_COSINE_DIM=1024
HS_EMBED_COSINE_CHUNK_SIZE=4096   # 32K context window

# Poincaré via YAR Labs v5
HS_EMBED_POINCARE_PROVIDER=huggingface
HS_EMBED_POINCARE_HF_MODEL_ID=YARlabs/v5_Embedding_0.5B
HS_EMBED_POINCARE_DIM=128

Direct Search from SDK:

# Server-side text-to-vector search (v3.0.1)
results = client.search_text("Find similar robotics docs", top_k=5)

For details see embeddings.md.


📉 Binary Quantization (1-bit)

Use Binary quantization mode to compress vectors by 32x-64x (vs f32/f64). Ideal for large-scale datasets where memory is the bottleneck.


🛠 Architecture

HyperspaceDB strictly follows a Command-Query Separation (CQS) pattern:

graph TD
    Client["Client (gRPC)"] -->|Insert| S["Server Service"]
    Client -->|Search| S
    
    subgraph Persistence_Layer ["Persistence Layer"]
        S -->|"1. Append"| WAL["Write-Ahead Log"]
        S -->|"2. Append"| VS["Vector Store (mmap)"]
    end
    
    subgraph Indexing_Layer ["Indexing Layer"]
        S -->|"3. Send ID"| Q["Async Queue"]
        Q -->|Pop| W["Indexer Worker"]
        W -->|Update| HNSW["HNSW Graph (RAM)"]
    end
  1. Transport: gRPC/Tonic server accepts requests (Insert/Search).
  2. Persistence: Data is immediately persisted to WAL and segmented Mmap storage.
  3. Indexing: A background worker updates the HNSW graph asynchronously.
  4. Recovery: Graph snapshots (via rkyv zero-copy) ensure near-instant restarts.

👉 *For deep dive, read ARCHITECTURE.md*


🛠 Operations & Maintenance

Queue Monitoring

Check ingestion backlog via API or collections stats:

{
  "count": 150000,
  "indexing_queue": 45  // Items pending index insertion
}
Rebuild Index (Defragmentation)

Trigger a graph rebuild to optimize layout and remove deleted nodes:

curl -X POST http://localhost:50050/api/collections/my_col/rebuild
Memory Management (Jemalloc)

HyperspaceDB uses Jemalloc for efficient memory allocation. You can tune its behavior via the MALLOC_CONF environment variable:

  • Low RAM (Aggressive Release): MALLOC_CONF=background_thread:true,dirty_decay_ms:0,muzzy_decay_ms:0 - Releases unused memory immediately to OS. Increases CPU usage slightly.
  • Balanced (Default): MALLOC_CONF=background_thread:true,dirty_decay_ms:5000,muzzy_decay_ms:5000 - Keeps some memory for reuse, balanced performance.

To create a manual memory vacuum request (e.g., after large deletions):

curl -X POST http://localhost:50050/api/admin/vacuum

💻 System Requirements

HyperspaceDB is designed to run efficiently on commodity hardware, but specific instruction sets are required for hardware acceleration.

CPU (Critical)
  • Architecture: x86-64 or ARM64.
  • Instructions:
  • x86-64: Must support AVX2 (Intel Haswell 2013+ or AMD Zen 2017+).
  • ARM64: Must support NEON (Standard on Apple Silicon M1/M2/M3 and AWS Graviton).
  • Note: The database will crash or fail to compile on CPUs without SIMD support.
Storage (I/O)
  • Disk Type: SSD / NVMe is highly recommended.
  • HyperspaceDB uses mmap for random access. Spinning HDDs (mechanical drives) will severely degrade search latency due to seek times.
Memory (RAM)
  • Minimum: 512 MB.
  • Recommended: Enough RAM to cache the "hot" part of your dataset.
  • Thanks to ScalarI8 quantization, 1 Million vectors (8-dim) take only ~12 MB of disk space. Even large datasets fit easily into RAM.
  • If the dataset exceeds RAM, the OS will swap pages to disk (performance will depend on SSD speed).
Operating System
  • Linux: Kernel 5.10+ recommended (for efficient memory mapping).
  • macOS: 12.0+ (fully supported).
  • Windows: Supported via WSL2 (native Windows build is experimental).

🏃 Quick Start

1. Build and Start Server

Make sure you have just and nightly rust installed.

# Build release binary
cargo build --release

# Run server (Default HTTP port: 50050)
./target/release/hyperspace-server

# Or with custom ports
./target/release/hyperspace-server --port 50051 --http-port 50050
2. Access Web Dashboard

The built-in React Dashboard provides real-time monitoring and management:

http://localhost:50050

Dashboard Features:

  • 📊 System Overview: Real-time metrics (RAM, CPU, vector count)
  • 🗂️ Collections Manager: Create, delete, and inspect collections
  • �️ Cluster Nodes: Visualize node topology and replication status
  • �🔍 Data Explorer: View recent vectors and test search queries
  • ⚙️ Settings: Integration snippets (Python, cURL) and live logs
  • 📈 Graph Explorer: Visualize HNSW graph structure, Poincaré manifolds, and agent momentum trajectories in real-time.

Authentication: If HYPERSPACE_API_KEY is set, you'll be prompted to enter it on first visit. The key is stored in localStorage for subsequent sessions.

Build Dashboard from Source:

cd dashboard
npm install
npm run build
# Assets are embedded in Rust binary via rust-embed
3. Launch TUI Monitor

Open a new terminal to monitor the database:

./target/release/hyperspace-cli

3. Use Python SDK
pip install hyperspacedb==3.1.2
from hyperspace import HyperspaceClient

# Connect to local instance
client = HyperspaceClient()

# Create a collection with Schema-Driven Cascade (128D Poincaré + MRL)
client.create_collection(
    name="world_model", 
    schema={
        "components": [
            {"name": "primary", "metric": "poincare", "full_dimension": 128, "weight": 1.0}
        ],
        "cascade_pipeline": [
            {"component_name": "primary", "cutoff_dimension": 32, "store_in_ram": True, "rerank_top_k": 100}
        ]
    }
)

# Insert text document (you can provide your own embeddings)
client.insert(id=1, collection="world_model", document="Hyperspace is autonomous.")

# Search 
results = client.search(query_text="autonomous engine", top_k=5)
print(results)

🏘️ Collections Management

HyperspaceDB v1.1+ supports Multi-Tenancy via Collections. Each collection is an independent vector index with its own dimension and metric.

Via Web Dashboard

Access the dashboard at http://localhost:50050:

  1. Create Collection: Enter name, select dimension (8D, 768D, 1024D, 1536D), click Create
  2. View Collections: See all active collections with their stats
  3. Delete Collection: Remove collections you no longer need
Via gRPC/SDK
from hyperspace import HyperspaceClient

client = HyperspaceClient()

# Create a new collection with Schema
client.create_collection(
    name="my_vectors", 
    schema={
        "components": [
            {"name": "main", "metric": "cosine", "full_dimension": 1536}
        ]
    }
)

# Insert into specific collection
client.insert(id=1, document="...", collection="my_vectors")

# Search in specific collection
results = client.search(query_text="...", collection="my_vectors", top_k=5)

# List all collections
collections = client.list_collections()

# Delete a collection
client.delete_collection("my_vectors")

Note: If no collection is specified, operations default to the "default" collection.

🏙️ SaaS & Multi-Tenancy (v2.0)

HyperspaceDB is built for SaaS. Isolate thousands of users on a single node.

1. User Isolation

Data is logically separated by user_id. Each user sees only their own collections.

How to use: Pass the x-hyperspace-user-id header in your requests.

curl -H "x-hyperspace-user-id: tenant_123" http://localhost:50050/api/collections
2. Billing API

Admins can query usage statistics for all tenants:

curl -H "x-hyperspace-user-id: admin" http://localhost:50050/api/admin/usage

⚙️ Configuration & Presets

HyperspaceDB v1.2 introduces flexible configuration presets to support both Scientific (Hyperbolic) and Classic (Euclidean) use cases.

Configure these via .env file or environment variables:

VariableDescriptionSupported ValuesDefault
HS_QUANTIZATION_LEVELCompressionscalar (i8), binary (1-bit), turbo (4-bit), none (f64)none
HS_SHARDSNumber of Thread-per-core CPU shardsInteger (1 to num_cpus * 2)Logical CPU core count
HS_DIRECT_IOEnable Direct I/O (O_DIRECT / F_NOCACHE)1 (true), 0 (false)1

[!IMPORTANT] Since v3.1.0, HS_DIMENSION and HS_METRIC are deprecated. Use CollectionSchema via SDK or CLI for granular control.

🔄 Инструкция по автоматической миграции (v3.x → v4.0.0 Migration Guide)

В версии v4.0.0 реализована раздельная архитектура хранения данных:

  • data/: Папка legacy-данных v3.x.
  • data_v4/: Папка нового формата v4.0.0 (Direct I/O, Thread-per-core, Spatial AABB).
Как работает миграция (Zero-Config Upgrade):
  1. Автоматический запуск: При первом старте HyperspaceDB v4.0.0 сервер автоматически обнаруживает папку data/.
  2. Бесшовная конвертация: Все найденные v3-коллекции конвертируются в формат v4.0.0 и записываются в data_v4/{collection_name}/:
    • Векторы выравниваются по границам страниц 4096 байт для прямого DMA-доступа (Direct I/O).
    • Автоматически рассчитываются и сохраняются пространственные сегменты Spatial AABB.
    • Таблица безопасности и прав доступа (data/security.db) автоматически переносится в data_v4/security.db.
  3. Безопасное архивирование: Исходные v3 файлы атомарно перемещаются в data/legacy_v3_migrated/{collection_name}/ с созданием манифеста целостности .migration_v4_complete.json (с таймштампом и количеством векторов).
  4. Повторные / ручные переносы: Если в будущем пользователь скопирует старые v3 файлы или целую коллекцию в data/ (или data/legacy_v3/), система при следующем перезапуске автоматически обнаружит их и смигрирует в data_v4/.
Настройка путей через переменные окружения:
  • HS_DATA_DIR: Путь к активному v4 хранилищу (по умолчанию: data_v4).
  • HS_LEGACY_V3_DIR: Путь к legacy v3 хранилищу для поиска миграций (по умолчанию: data).
Проверка успешности миграции:
  • В логах сервера отображаются записи:
    🔄 [MigrationEngine] Found 1 legacy v3.x collection(s) to migrate to v4.0.0 (from data to data_v4)
    🚀 [MigrationEngine] Migrating 'my_collection' from data/my_collection to v4 format in data_v4...
    ✅ [MigrationEngine] Successfully migrated 'my_collection' (50000 vectors in 142 ms)
    📦 [MigrationEngine] Archived legacy files to data/legacy_v3_migrated/my_collection
    
  • В папке каждой коллекции data_v4/{collection}/ создается файл .migration_v4_complete.json.
🎯 Supported Presets

1. Classic RAG (Default) Optimized for standard embeddings from OpenAI, Cohere, Voyage, etc.

  • Metric: cosine (Cosine Similarity) - recommended for OpenAI/BGE embeddings
  • Dimensions: 1024, 1536, 2048
  • Note: cosine mode automatically normalizes vectors on insert/search (with zero-copy fast path for already normalized vectors) and uses HNSW-friendly squared L2 ranking internally. For magnitude-sensitive workloads, use l2 with HS_QUANTIZATION_LEVEL=none.

2. Scientific / Hyperbolic Optimized for hierarchical data, graph embeddings, and low-dimensional efficiency.

  • Metric: poincare
  • Dimensions: 16, 32, 64, 128 (Common: 64)
  • Requirement: Input vectors must strictly satisfy ||x|| < 1.0 (Poincaré ball constraint). Server will reject invalid vectors.

📊 Best Practices

HyperspaceDB follows the microservices philosophy: One Index per Instance. To manage multiple datasets, we recommend deploying separate Docker containers or using Metadata Filtering for logical separation within a single index.

1. Vector Dimensionality
  • Recommendation: Choose dimensions matching your embedding model.
  • Support: Native support for 1024 (BGE-M3), 1536 (OpenAI), 768 (BERT), and 8 (Hyperbolic).
  • Reason: HyperspaceDB now uses Const Generics to optimize for specific dimensions at compile time.
2. Quantization Strategy
  • Mode: Use Binary quantization for maximum memory savings.
  • Trade-off: Binary mode reduces precision but compresses vectors by 32x-64x compared to floating-point.
  • When to use: Large-scale datasets where memory is the bottleneck.
3. Indexing Parameters
  • ef_construction: Controls index build time vs. search quality. Higher values = better recall but slower indexing.
  • ef_search: Controls search time vs. recall. Higher values = better recall but slower search.
  • Tuning: Adjust via gRPC without restarting the server.
4. Hybrid Search
  • Enable: Use hybrid_query parameter in search requests.
  • Tuning: Adjust hybrid_alpha (0.0 to 1.0) to balance semantic similarity and keyword matching.

⚡ RAG Performance Benchmarks (v3.1)

We conducted a rigorous evaluation of HyperspaceDB v3.1 against popular vector databases (Qdrant, ChromaDB, Milvus, Weaviate) across 15 distinct RAGBench datasets (ranging from 1,000 to 100,000 documents).

The results highlight HyperspaceDB's Lock-Free ArcSwap Architecture and optimized cache layers.

📋 Benchmark: HYBRID Search (Lexical BM25 + Semantic)

Evaluating retrieval accuracy (Recall@10, Context Precision) and throughput (QPS, Latency) averaged across 15 domains.

📊 Index Size: 1,000 Documents (HYBRID 1000x100)
DatabaseIngest QPSSearch QPSLatency p50Latency p99RAM UsageDisk UsageCPU UsageRecall@10Context Precision
HyperspaceDB55,722 🚀1,374.73 ⚡0.62 ms1.93 ms407.5 MB91.80 MB8.0%64.47%54.60%
ChromaDB1,547218.274.76 ms8.86 ms2,132.0 MB573.75 MB19.4%65.25%54.07%
Milvus495240.804.18 ms8.87 ms970.9 MB524.86 MB19.8%65.28%54.15%
Qdrant6,801204.277.69 ms12.61 ms390.0 MB5.58 MB22.5%65.28%54.12%
Weaviate588465.672.22 ms6.38 ms468.6 MB20.32 MB55.2%63.63%51.49%
📊 Index Size: 100,000 Documents (HYBRID 100000x1000)
DatabaseIngest QPSSearch QPSLatency p50Latency p99RAM UsageDisk UsageCPU UsageRecall@10Context Precision
HyperspaceDB52,572 🚀1,375.53 ⚡0.74 ms1.70 ms1,089.3 MB100.13 MB11.9%55.33%51.29%
ChromaDB1,455196.935.67 ms9.06 ms2,448.0 MB677.44 MB31.0%55.13%50.97%
Milvus2,269191.135.78 ms9.17 ms1,161.8 MB857.11 MB34.0%55.15%51.01%
Qdrant7,023193.208.45 ms12.50 ms409.2 MB16.48 MB37.1%55.25%51.03%
Weaviate1,455482.932.37 ms5.78 ms482.7 MB40.92 MB132.0%53.83%49.15%

🏆 Concurrency & Stress Testing

Measured on the CovidQA dataset under concurrent search queries.

👥 100 Parallel Clients
DatabaseQPSLatency Avgp50p99Max RAM
HyperspaceDB (L2 Cache ON)3,706.53 🚀3.28 ms2.79 ms9.27 ms72.0 MB
ChromaDB422.46185.99 ms165.14 ms414.39 ms3,026.9 MB
Milvus879.1791.39 ms91.54 ms165.00 ms1,880.1 MB
Weaviate631.17130.10 ms120.42 ms269.45 ms843.4 MB
👥 1,000 Parallel Clients
DatabaseQPSLatency Avgp50p99Max RAM
HyperspaceDB (L2 Cache ON)5,261.26 🚀5.63 ms4.50 ms21.48 ms72.0 MB
ChromaDB386.572,014.16 ms1,793.00 ms4,897.77 ms3,026.9 MB
Milvus648.271,201.19 ms1,198.67 ms2,729.93 ms3,708.9 MB
Weaviate597.781,414.36 ms1,322.76 ms3,038.84 ms2,174.0 MB

📉 Why is HyperspaceDB so fast?
  1. Lock-Free Architecture: Readers never block readers using ArcSwap and lock-free atomic references.
  2. L0 Two-Level Caching: Sharded L1 DashMap (~1 µs lookups) coupled with a background-rebuilt L2 HNSW fallback graph (~100 µs lookups).
  3. Anisotropic Quantization: Custom ScaNN-inspired scalar I8 loss quantization maintains high Recall while saving 8x RAM.
  4. Zero-Copy Serialization: Fast memory mapping (mmap) of segment files ensures immediate startup recovery without parsing overhead.

RAG Benchmarks Hardware Config: Apple M4 Pro (64GB RAM), NVMe SSD storage.


🐳 Deployment

Official Docker Images

HyperspaceDB publishes three specialized Docker distribution tags to match different deployment architectures:

Image TagExtensions / PDKEmbedderArchitectureSizeIdeal Use Case
🚀 glukhota/hyperspace-db:latest✅ Built-in & External PDK (/app/plugins)Deterministic Manifold & Remote APIs (ort disabled)Multi-Arch (amd64, arm64)~50 MBDefault / Recommended: Ultra-fast, lightweight vector database for production, local dev, edge, and microservices.
🧠 glukhota/hyperspace-db:latest-embed✅ Full PDK + Active ONNX Runtime✅ Built-in Local ONNX / HF Hub / Remote APIsMulti-Arch (amd64, arm64)~650 MBAll-in-One: Self-contained server that vectorizes raw text directly in-database without external APIs or client-side embedding libraries.
⚡ glukhota/hyperspace-db:latest-saas✅ Core SaaS PDK (shield,eco)❌ Offloaded to microservices (cde-service)linux/amd64~48 MBManaged Cloud SaaS & Kubernetes: Engineered specifically for high-throughput cloud clusters with S3/Cloudflare R2 chunk tiering, AVX-512 SIMD, and EcoMonitor telemetry.

Quick Start
1. Run Standard Engine with PDK Plugins
docker run -d \
  --name hyperspace \
  -p 50051:50051 \
  -p 50050:50050 \
  -v $(pwd)/hs_data:/app/data \
  -v $(pwd)/plugins:/app/plugins \
  glukhota/hyperspace-db:latest
2. Run All-in-One Engine (With Built-In ONNX Embedding Model)
docker run -d \
  --name hyperspace-embed \
  -p 50051:50051 \
  -p 50050:50050 \
  -v $(pwd)/hs_data:/app/data \
  -v $(pwd)/plugins:/app/plugins \
  glukhota/hyperspace-db:latest-embed

Access the Web Dashboard and Plugins Workbench at http://localhost:50050 and gRPC at localhost:50051.

Docker Compose

Run the full stack with mounted data and plugins directories:

docker-compose up -d

🔒 Security & SOC 2 Compliance

HyperspaceDB comes with advanced security controls out-of-the-box, ensuring compatibility with standard enterprise compliance requirements (e.g. SOC 2, ISO 27001):

  • Mutual TLS (mTLS): Built-in TLS and client verification support for both gRPC (port 50051) and HTTP Dashboard/API (port 50050). Configure via .env:
    • HS_TLS_CERT=/path/to/server.crt
    • HS_TLS_KEY=/path/to/server.key
    • HS_TLS_CA=/path/to/ca.crt (enables mutual TLS verification)
  • Role-Based Access Control (RBAC): Fine-grained user role permissions (Admin, ReadWrite, ReadOnly) managed via transaction-safe redb database.
  • Cross-Tenant Collection Sharing: Securely share collections between tenants with read-only/read-write privileges using Namespaced URI references (owner/collection_name).
  • Structured Audit Logs: Structured JSON audit logging (HS_AUDIT_LOG_LEVEL=full) written to stdout or a file, with tenant-isolated logs streamed securely to authenticated users.

[!TIP] For SOC 2 compliance, we recommend deploying HyperspaceDB on LUKS-encrypted drives or encrypted cloud block volumes within isolated Virtual Private Clouds (VPC).


🔌 AI Integrations

HyperspaceDB is ready for the modern AI stack with official high-level integrations:

IntegrationLanguageStatusInstall
🧠 Hyperspace Memory (Mem0 Drop-In)Python✅ v4pip install hyperspace-memory
🧠 Hyperspace Memory (Mem0 Drop-In)TS/JS✅ v4npm install hyperspace-memory
🦜 LangChainPython✅ v4pip install langchain-hyperspace
🦜 LangChainTS/JS✅ v4npm install langchain-hyperspace
🦙 LlamaIndexPython✅ v4pip install llama-index-vector-stores-hyperspace
🦙 LlamaIndexTS/JS✅ v4npm install llamaindex-hyperspace
🔗 n8nNo-Code✅ v4Community Node: n8n-nodes-hyperspacedb
🤖 AI Agent SkillsAny✅ v4npm install hyperspacedb-skills

🛠️ Model Context Protocol (MCP)

Connect HyperspaceDB directly to Claude Desktop, Cursor, Windsurf, Antigravity, or any MCP-compliant agent to give them persistent cognitive spatial memory.

🧠 1. Zero-Code Cognitive Agent Memory (mcp-hyperspace-memory)

Drop-in cognitive agent memory server with 8 specialized memory tools (memory_remember, memory_recall, memory_forget, memory_update, memory_list_sessions, memory_explore_hierarchy, memory_consolidate, memory_verify_claim):

# Start Memory MCP server via npx
npx mcp-hyperspace-memory@latest
Option A: Managed Cloud Memory (Zero Infrastructure)
{
  "mcpServers": {
    "hyperspace-memory": {
      "command": "npx",
      "args": ["-y", "mcp-hyperspace-memory@latest"],
      "env": {
        "HYPERSPACE_API_KEY": "sk_YOUR_YAR_API_KEY",
        "MEMORY_COLLECTION": "agent_memory"
      }
    }
  }
}
Option B: Local DB Instance + Cloud v5 Embedding API Key (Default Auth)

Run glukhota/hyperspace-db:latest locally on your machine. Your vector graph and memory payloads stay 100% private on localhost, while text is vectorized via the state-of-the-art continuous v5_Embedding_801 model in the cloud:

{
  "mcpServers": {
    "hyperspace-memory": {
      "command": "npx",
      "args": ["-y", "mcp-hyperspace-memory@latest"],
      "env": {
        "HYPERSPACE_HOST": "localhost:50051",
        "HYPERSPACE_API_KEY": "sk_YOUR_YAR_API_KEY",
        "MEMORY_COLLECTION": "agent_memory"
      }
    }
  }
}
Option C: Local DB with Custom Password + Cloud v5 Embedding API Key (Two Keys)

If your local .env has a custom security password (HYPERSPACE_API_KEY=my_local_secret), provide two separate keys:

{
  "mcpServers": {
    "hyperspace-memory": {
      "command": "npx",
      "args": ["-y", "mcp-hyperspace-memory@latest"],
      "env": {
        "HYPERSPACE_HOST": "localhost:50051",
        "HYPERSPACE_API_KEY": "my_local_secret",
        "YAR_API_KEY": "sk_YOUR_YAR_API_KEY",
        "MEMORY_COLLECTION": "agent_memory"
      }
    }
  }
}
  • HYPERSPACE_API_KEY: Authenticates to local gRPC database (localhost:50051).
  • YAR_API_KEY (or legacy CDE_API_KEY): Authenticates to cloud https://the.yar.ink/v1/embeddings (v5_Embedding_801). (Get your sk_ API key at yar.ink/dashboard).
⚡ 2. Full Vector Database & Graph MCP Server (mcp-hyperspacedb)

Complete database administration, graph traversal, and cognitive analytics:

# Start Full Database MCP server via npx
npx mcp-hyperspacedb@latest

Available Tools (30+):

  • hyperspace_search_text / hyperspace_search_wasserstein: Semantic & Optimal Transport search.
  • hyperspace_insert_text / hyperspace_delete_points / hyperspace_get_points: Data CRUD.
  • hyperspace_create_collection / hyperspace_delete_collection: Collection management.
  • hyperspace_graph_traverse / hyperspace_explore_graph / hyperspace_get_neighbors: Graph navigation.
  • hyperspace_get_subsumption_tree / hyperspace_get_concept_parents: Hierarchy traversal.
  • hyperspace_analyze_thought_stability / hyperspace_predict_momentum / hyperspace_get_trust_score: Cognitive AI.
  • hyperspace_verify_generation: Tribunal geometric hallucination verification.
  • hyperspace_query_planner: Natural-language sub-query decomposition and planned retrieval.
  • hyperspace_analyze_geometry: Gromov Delta → metric recommendation (cosine/l2/lorentz/poincare/hybrid).
  • hyperspace_rebuild_index / hyperspace_vacuum / hyperspace_cache_*: System maintenance.

📦 SDKs (v4.x Milestone)

Official 1st-party drivers with full Functional Parity, Tribunal Verification (verify_generation), Delta Sync, and Cognitive Math:

LanguagePathStatus
🐍 Pythonpip install hyperspacedb✅ v4.1.0
🦀 Rustcargo install hyperspacedb✅ v4.1.0
🦕 TypeScript/JSnpm install hyperspace-sdk-ts✅ v4.1.0
🕸️ WebAssemblycrates/hyperspace-wasm✅ v4.1.0
🎯 Dart/Flutterhyperspacedb: ^4.1.0✅ v4.1.0
🐹 Gosdks/go✅ v4.1.0
🤖 ROS2 / C++sdks/ros2, sdks/cpp✅ v4.1.0
🧠 AI Agent Skillsnpm install hyperspacedb-skills✅ v4.1.0

🧠 AI Agent Skills (hyperspacedb-skills) are structured SKILL.md files that teach Cursor, Claude Code, Windsurf, Antigravity, and custom agents how to correctly use HyperspaceDB — covering core CRUD, graph traversal, cognitive AI (Lyapunov/Koopman), Tribunal verification, query planning, DePIN node economics, and the full 30+ MCP tool reference. Install once, all your agents understand HyperspaceDB automatically.


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright © 2026 YARlabs

Runs on
GPU support unknown
What shows it
  • no dependency or feature matches a backend row
Native code
Optional
  • Binds native code: ort-sys (feature local-onnx)
Python bindings
No Python binding crate found
License
MIT

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.

hyperspace-db beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
hyperspace-db This page Listed

[H] HyperspaceDB is a high-performance, vector database. It features 1-bit quantization, async replication, and native support for hierarchical datasets (Lorentz, Poincaré ball & Hybrid models).

96 downloads over 30 days 3 163 4.2.0 GPU support unknown Binds native code: ort-sys (feature local-onnx) MIT
kiddo Featured

A high-performance, flexible, ergonomic k-d tree library. Ideal for geo- and astro- nearest-neighbour and k-nearest-neighbor queries

481,504 downloads over 30 days 56 179 6.3.0 GPU support unknown Build uses a native toolchain: cc (feature cpp_competitors) Apache-2.0 OR MIT
qdrant App Featured

Qdrant - High-performance, massive-scale Vector Database and Vector Search Engine for the next generation of AI. Also available in the cloud https://cloud.qdrant.io/

34,017 binary downloads per release Not applicable 35,478 Not measured Not measured Apache-2.0
ruvector Listed

High-performance Rust vector database core with HNSW indexing

39,411 downloads over 30 days 51 4,675 2.5.0 CUDA, WebGPU, Metal Binds native code: libsqlite3-sys, napi-sys, ort-sys, pgrx-pg-sys, pqcrypto-internals and 5 more MIT
pgvectorscale App Listed

Postgres extension for vector search (DiskANN), complements pgvector for performance and scale. Postgres OSS licensed.

33,328 binary downloads per release Not applicable 3,161 Not measured Not measured PostgreSQL
regexr Listed

A high-performance regex engine built from scratch with JIT compilation and SIMD acceleration

8,809 downloads over 30 days 4 28 0.6.2 GPU support unknown No native code found Apache-2.0 OR MIT
edgevec Listed

High-performance embedded vector database for Browser, Node, and Edge

14 downloads over 30 days 1 100 0.9.0 GPU support unknown No native code found Apache-2.0 OR MIT
Why ListedNo archive, New or Featured rule places it, so it is Listed.

What it lacks for Featured

  • It has 0 active dependents and 0 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 163 stars, 20 forks and 5 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
  • Docs are missing: the primary crate publishes no README.

What else the check found

  • The last activity is on 9 Nov 2026, 0 days ago. The rules expect an update within 365 days. Dormancy rule

Exact rules: Listed, Featured library. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: version 4.2.0 base 200, raised to the 365-day floor: E = 365 days
  • dormancy: last activity 2026-11-09, 0 days ago, E = 365: active
  • featured: not featured: active_users 0 < 11 and new_adopters 0 < 9 and repository route stars 163 (needs 4539), forks 20 (needs 434), contributors 5 (needs 79); docs missing
  • listed: listed: no archive, new or featured rule applies
Crates2 crates

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources6 sources
Adoption0 active dependents, 0 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents0crates.io database dumpYes
New dependents (365 days)0crates.io database dumpYes
Peak active dependents0crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: on the check date3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-11-09GitHub repositoryYes
Latest release2026-10-29crates.io database dumpYes
First release2026-02-19crates.io database dumpYes
Latest version4.2.0crates.io database dumpYes
Days the oldest outside issue waits for a reply0GitHub repositoryYes
Maintainer replies over 365 days12GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docsfalsecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution17 releases, 96 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases17crates.io database dumpYes
Downloads over 30 days96crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository163 stars, 20 forks, 5 contributors, 256 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars163GitHub repositoryYes — one part of the repository route
GitHub forks20GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account5GitHub contributorsYes — one part of the repository route
Commits on the default branch256GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseMITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesBinds native code: ort-sys (feature local-onnx)crates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly3crates.io database dumpNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.