सूत्र DB (SutraDB) v5.5.0: Zero-Build Embedded Developer Workbench & Distributed Edition
सूत्र (Sūtra): An aphorism or thread of knowledge designed to hold vast wisdom in the most concise, unbreakable form.
SutraDB is an industrial-grade, ultra-fast vector & BM25 hybrid search engine built with a native Rust core and zero-overhead PyO3 Python bindings. It combines runtime hardware CPU auto-dispatch (AVX-512, AVX2, ARM NEON), Rayon GIL-free multicore parallel processing, an advanced Linguistic NLP Analyzer Pipeline (Porter stemming, Spanish/French/German suffix stemmers, CJK bigrams, code identifier splitting), Product Quantization (PQ) (up to 64x RAM reduction with Asymmetric Distance Computation), 1-Bit Binary Quantization (BQ) (32x RAM reduction), SQ8 Scalar Quantization (75% RAM reduction), dynamic online HNSW deletion & healing, geo-spatial metadata filtering, IVF-Flat indexing, multi-tenant namespace isolation, zero-copy memory mapping (memmap2), and official connectors for LangChain and LlamaIndex.
⚡ 5-Second 1-Click Launch (Embedded Workbench)
No compilers, Node, or npm required. Launch the complete dual-daemon stack (Rust gRPC on :50051 + REST/Workbench on :8765):
docker run -d \
--name sutradb \
-p 8765:8765 \
-p 50051:50051 \
-v sutra_data:/data \
samcodesai/sutradb:latest
# Open the Zero-Build Developer Workbench immediately:
# 👉 http://localhost:8765/ui
Designed specifically for production RAG (Retrieval-Augmented Generation), local AI agents, enterprise document retrieval, and low-latency voice AI where cloud vector database round-trips (>40ms) or Chroma's heavy memory overhead are unacceptable.
🏗️ Architecture
CLIENT REQUEST
[ Text Query: "P99 latency bug" | Vector: [0.12, ...] | Namespace: "tenant_42" ]
[ Metadata Filter: {"status": "resolved", "priority": {"$lte": 2}} ]
│
▼
┌──────────────────────────────┐
│ Rust Engine Core (GIL-Free)│
└──────────────┬───────────────┘
│
┌────────────────────────────┼────────────────────────────┐
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Secondary Index │ │ Dense Vector Core│ │ Sparse BM25 Core │
│ & AST Bitmask │ │ (HNSW / SQ8 SIMD)│ │ (Lexical Tokens) │
└────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
│ │ │
│ Dynamic Bitmask │ Dense Scores │ Lexical Scores
│ [1, 0, 1, 0, ...] │ [0.94, 0.41, ...] │ [8.2, 0.0, ...]
└─────────────┬─────────────┴──────────────┬─────────────┘
│ │
▼ ▼
┌───────────────┐ ┌───────────────┐
│ Masked Dense │ │ Masked BM25 │
│ Top-K Heap │ │ Top-K Heap │
└───────┬───────┘ └───────┬───────┘
│ │
└────────────┬───────────────┘
│
▼
┌───────────────────────────────┐
│ Reciprocal Rank Fusion (RRF) │
│ Merges semantic + exact words │
└───────────────┬───────────────┘
│
▼
┌───────────────────────────────┐
│ Ranked Final Results │
│ P50: <0.15ms | Recall: >98% │
└───────────────────────────────┘
⚡ Industrial Capabilities (v3.4)
- Hardware SIMD Auto-Dispatch & Multicore Rayon Acceleration: Dynamic runtime detection of AVX-512, AVX2, and ARM NEON CPU vector extensions. Batch distances and unindexed candidate scoring automatically scale across all available CPU cores using Rayon parallel iterators with zero GIL contention.
- Linguistic NLP Analyzer Pipeline for BM25: Production-ready multi-lingual text processing with zero external C dependencies:
- Algorithmic Porter Stemmer for English.
- Suffix stemmers for Spanish, French, and German.
- Pre-compiled zero-allocation stopword pruning across multiple languages.
- CJK (Chinese, Japanese, Korean) bigram sliding window tokenization (
自然语言->["自然", "语言"]). - Code & identifier sub-token splitting (
getUserProfile->["get", "user", "profile"],fetch_jwt_token->["fetch", "jwt", "token"]).
- Native Rust SIMD Core: Pure Rust computation core releasing the Python GIL during query execution and batch ingestion for zero-overhead multicore scaling.
- Product Quantization (PQ) with Asymmetric Distance Computation (ADC): Decomposes high-dimensional vector spaces into $M$ orthogonal sub-spaces with k-means codebooks, achieving up to 64x RAM reduction. Query vectors compute precomputed Look-Up Tables (LUT) in L1 cache for sub-millisecond ADC similarity calculation with full-precision two-stage reranking.
- 1-Bit Binary Quantization (BQ): Compresses 64 float32 dimensions into a single 64-bit word (
u64), delivering a staggering 32x RAM reduction and sub-microsecond hardwarePOPCNTHamming distance evaluation with two-stage candidate pruning + exact reranking for $>95%$ recall. - SQ8 Scalar Quantization (8-Bit): Compresses vectors from 32-bit floats to 8-bit unsigned integers, slashing RAM consumption by 75% while retaining $>98%$ recall via asymmetric dot product queries.
- Dynamic Online HNSW Graph Deletion & Healing: Instant node removal with real-time edge re-wiring, neighbor reconnection, and entry point re-election without tombstones or graph fragmentation.
- Geo-Spatial Filtering (
$geo_within&$geo_box): Native great-circle Haversine distance in meters and rectangular bounding box queries supporting coordinate arrays[lat, lon]and dictionaries{"lat": ..., "lon": ...}. - Dual ANN Indexing (HNSW & IVF-Flat):
- HNSW: Hierarchical Navigable Small World graphs for $O(\log N)$ vector search and dynamic streaming additions.
- IVF-Flat: Sublinear Voronoi cell clustering with k-means++ for high-density batched workloads.
- Official AI Framework Connectors: First-class integrations for LangChain (
sutradb.integrations.langchain) and LlamaIndex (sutradb.integrations.llamaindex). - Nested JSON Metadata & Array Filtering: Dot-notation path resolution (
user.profile.city) and operators ($eq,$ne,$gt,$gte,$in,$all,$size,$regex,$geo_within,$geo_box). - First-Class Multi-Tenancy (Namespaces): Strict hardware/logical isolation (
namespace="tenant_123"). Zero cross-tenant data leaks. - Zero-Copy Memory-Mapped Files (
memmap2): Direct OS page-cache mapping of.sutrabinary vectors. Instant cold-start queries without loading gigabytes of data into heap RAM. - Resilient Write-Ahead Log (WAL): Atomic append-only transaction logging with CRC32 integrity checks, automatic snapshot compaction, and corrupted-tail power-cut auto-healing.
- Zero-Dependency Web Console (
/ui&/dashboard): Real-time monitoring dashboard with in-browser 2D Canvas PCA vector projection and hybrid query builder.
📊 Verified v5.5.0 Benchmarks
Measured on a 2-vCPU Linux x86_64 host (AMD EPYC 7763, AVX2 / FMA, Python 3.14.2, Cosine metric, top_k=10). Full reproducible scripts live in benches/benchmark.py and benches/scale_benchmark.py.
Out-of-L3-Cache Scale (100,000 vectors × 768 dims — 293.0 MiB raw FP32)
| Variant | Ingest / Build | P50 (ms) | P99 (ms) | QPS | Vector/Index RAM | Recall@10 |
|---|---|---|---|---|---|---|
| NumPy (Exact GEMV baseline) | - | 35.019 | 56.064 | 27.4 | 293.0 MiB | 100.00% |
| SutraDB Flat (Rust AVX2 SIMD) | 29,228 docs/s | 14.236 | 21.737 | 68.1 | 293.0 MiB | 100.00% |
SutraDB HNSW Unfiltered (m=16) |
1,063 docs/s (build) | 0.417 | 0.645 | 2,291.2 | 326.2 MiB | 100.00% |
| SutraDB HNSW 1%-Filtered (Cost-Based Roaring SIMD) | 1,063 docs/s (build) | 0.187 | 0.297 | 4,913.9 | 326.2 MiB | 100.00% |
| SutraDB SQ8 (Mmap-Evicted 4x) | 18,966 docs/s | 6.516 | 10.836 | 141.5 | 73.2 MiB | 97.90% |
| SutraDB 1-Bit BQ (Mmap-Evicted 32x) | 19,243 docs/s | 2.043 | 3.580 | 436.2 | 9.2 MiB | 92.10% |
- Instant-Restart Snapshot (
.sutra+.sutra.idxsidecar): Saves308.3 MiB+14.9 MiBin1,991 msand restores full HNSW search with exact parity in3,066 ms(vs.94.1 srebuilding HNSW on 2 vCPUs).
Multi-Modal Suite (10,000 vectors × 128 dims)
| Variant | Ingestion (docs/s) | P50 (ms) | P99 (ms) | QPS | Vector/Index RAM | Recall@10 |
|---|---|---|---|---|---|---|
| NumPy (Exact Brute-Force) | 3,749,940 | 0.153 | 0.263 | 6,285 | 4.9 MB | 100.00% |
| SutraDB Flat (Rust SIMD) | 15,237 | 0.480 | 0.618 | 2,068 | 4.9 MB | 100.00% |
SutraDB HNSW Graph ANN (m=32) |
710 (741 build) |
0.321 | 0.402 | 3,075 | 9.0 MB | 99.20% |
| SutraDB SQ8 (4x Quantized) | 16,103 | 0.467 | 0.571 | 2,117 | 1.2 MB | 98.70% |
| SutraDB 1-Bit BQ (32x POPCNT) | 16,564 | 0.332 | 0.465 | 3,008 | 0.2 MB | 91.80% |
SutraDB PQ (M=16, 32x ADC) |
2,471 | 0.344 | 0.399 | 2,907 | 0.2 MB | 90.30% |
| SutraDB BM25 Lexical | 16,287 | 0.488 | 0.634 | 2,032 | 1.9 MB | N/A |
| SutraDB Hybrid RRF (Dense+BM25) | 16,209 | 1.275 | 1.468 | 778 | 4.9 MB | N/A (Hybrid) |
🚀 Quickstart (Python)
1. Installation
pip install sutradb-core
Or build locally with maturin:
git clone https://github.com/Sam-CodesAI/SutraDB.git
cd SutraDB
maturin develop --release
2. Automated Text Ingestion & Instant Search (add_texts & search)
SutraDB features an end-to-end automated embedding and ingestion pipeline. Ingest raw text strings directly without manual vectorization:
from sutradb import SutraDB, DefaultEmbeddingFunction, OpenAIEmbeddingFunction
# Initialize SutraDB with disk persistence
db = SutraDB(persist_directory="./sutra_data")
# Create collection (defaults to zero-dependency 384-dim DefaultEmbeddingFunction)
col = db.get_or_create_collection("support_kb")
# 1. Ingest raw text strings with automatic embedding & BM25 indexing
col.add_texts(
texts=[
"Rust delivers memory safety without garbage collection and zero-cost abstractions.",
"Python is the lingua franca of machine learning, PyTorch, and AI agents.",
"SutraDB combines SIMD hardware acceleration with multi-modal hybrid retrieval."
],
metadatas=[
{"tier": "gold", "lang": "rust"},
{"tier": "silver", "lang": "python"},
{"tier": "gold", "lang": "hybrid"}
],
namespace="tenant_enterprise"
)
# 2. Instant multi-modal search directly with query string!
results = col.search(
query="vector search in rust with SIMD",
namespace="tenant_enterprise",
filter={"tier": "gold"},
top_k=2
)
for r in results:
print(f"[{r.score:.4f}] {r.text} | Metadata: {r.metadata}")
# Pluggable embeddings: OpenAI, FastEmbed (ONNX local + SPLADE), HuggingFace:
# col_openai = db.create_collection("openai_docs", embedding_function=OpenAIEmbeddingFunction())
3. Multi-Tenant Hybrid Search & SQ8 Quantization
from sutradb import SutraDB, Document
# 1. Initialize SutraDB with disk persistence
db = SutraDB(persist_directory="./sutra_data")
col = db.get_or_create_collection("enterprise_kb", dimension=4, metric="cosine")
# 2. Insert multi-tenant documents
col.insert([
Document(
id="doc_1",
namespace="tenant_acme",
vector=[0.95, 0.05, 0.10, 0.00],
text="Deploying Kubernetes microservices and container ingress",
metadata={"category": "devops", "env": "prod"}
),
Document(
id="doc_2",
namespace="tenant_globex",
vector=[0.02, 0.98, 0.05, 0.01],
text="PostgreSQL connection pooling and query optimization",
metadata={"category": "database", "env": "prod"}
)
])
# 3. Build HNSW index for O(log N) ANN vector search
col.build_hnsw(m=16, ef_construction=64, ef_search=32)
# 4. Enable SQ8 8-bit quantization (75% RAM savings)
col.enable_sq8()
# 5. Hybrid search isolated to tenant_acme
results = col.query(
vector=[1.0, 0.0, 0.0, 0.0],
text="Kubernetes microservices",
namespace="tenant_acme",
filter={"category": "devops"},
top_k=5,
hybrid=True
)
for r in results:
print(f"[{r.score:.4f}] ({r.namespace}) {r.id}: {r.text}")
4. Direct Native Rust Acceleration (Python)
from sutradb import NativeCollection
# Direct zero-overhead C/Rust engine
col = NativeCollection("fast_kb", dimension=128, metric="cosine")
col.insert(docs, vectors)
col.build_hnsw()
results = col.query(vector=q_vec, top_k=10, use_ann=True)
5. Official LangChain VectorStore Integration
from sutradb import SutraDBVectorStore
from langchain_openai import OpenAIEmbeddings
embeddings = OpenAIEmbeddings(model="text-embedding-3-small")
store = SutraDBVectorStore(
collection_name="production_rag",
dimension=1536,
embedding_function=embeddings,
persist_directory="./sutra_data",
hybrid=True, # Combines dense embeddings + BM25Okapi via RRF
)
# Standard similarity search or Maximal Marginal Relevance (MMR)
results = store.similarity_search("How to optimize vector search?", k=5)
diverse_results = store.max_marginal_relevance_search("P99 latency", k=4, fetch_k=20)
retriever = store.as_retriever(k=3)
6. Official LlamaIndex VectorStore Integration
from sutradb import SutraDBLlamaIndexVectorStore
from llama_index.core import VectorStoreIndex, StorageContext
vector_store = SutraDBLlamaIndexVectorStore(
collection_name="knowledge_vault",
dimension=1536,
hybrid=True,
)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_documents(documents, storage_context=storage_context)
# Query with hybrid mode
query_engine = index.as_query_engine(vector_store_query_mode="hybrid")
response = query_engine.query("Explain memory mapping persistence")
7. Nested JSON Metadata & Array Filtering
Filter nested object paths with dot-notation and advanced operators:
results = col.query(
text="distributed microservices",
filter={
"user.profile.city": "San Francisco",
"user.profile.score": {"$gte": 90.0},
"tags": {"$all": ["cloud", "docker"]},
"tags": {"$size": 3},
"env": {"$in": ["prod", "staging"]}
},
top_k=5
)
8. 1-Bit Binary Quantization (32x RAM Reduction & Two-Stage Search)
Compress high-dimensional vectors by 32x and evaluate Hamming candidate distances via hardware POPCNT:
# Enable 1-bit quantization
col.enable_bq()
# Queries automatically run Two-Stage Search:
# Stage 1: Fast Hamming distance scan over 1-bit bitmasks to select top candidates
# Stage 2: Exact full-precision distance reranking of top candidate pool
results = col.query(vector=query_vector, top_k=5)
9. Geo-Spatial Metadata Filtering ($geo_within & $geo_box)
Filter vectors using great-circle Haversine distances in meters or rectangular bounding boxes:
# Radius query within 5,000 meters of San Francisco center
sf_results = col.query(
vector=query_vector,
filter={
"location": {
"$geo_within": {
"center": [37.7749, -122.4194],
"radius_meters": 5000.0
}
}
},
top_k=10
)
# Bounding box query covering SF Bay Area
bay_results = col.query(
text="local restaurants",
filter={
"location": {
"$geo_box": {
"bottom_left": [37.70, -122.50],
"top_right": [37.85, -122.20]
}
}
},
top_k=10
)
10. Product Quantization (PQ) & Asymmetric Distance Computation (ADC)
Compress high-dimensional vectors by up to 64x using sub-space decomposition and evaluate similarities in sub-milliseconds via L1-cache Look-Up Tables (LUT):
# 1. Train codebook using k-means across sub-spaces
codebook = col.train_pq(num_subspaces=16, k_centroids=256, max_iter=20)
# 2. Enable PQ mode for the collection
col.enable_pq(codebook)
# 3. Two-Stage ADC Query:
# Stage 1: Asymmetric Distance Computation via precomputed query-to-centroid Look-Up Table (LUT)
# Stage 2: Top candidate pool reranked with full-precision vectors
results = col.query(vector=query_vector, top_k=5)
11. Linguistic NLP Pipeline & Hardware SIMD Dispatch
Configure advanced stemming, stopword pruning, identifier splitting, and CJK tokenization directly on collections:
from sutradb import SutraDB, Analyzer, AnalyzerConfig
# 1. Initialize collection with custom multi-lingual analyzer
db = SutraDB()
col = db.create_collection(
name="multilingual_kb",
dimension=128,
analyzer={
"language": "english", # "english", "spanish", "french", "german"
"stemmer": True, # Algorithmic Porter / Romance suffix stemmer
"stopwords": True, # Pre-compiled stopword removal
"split_identifiers": True, # getUserProfile -> ["get", "user", "profile"]
"cjk_bigrams": True # 自然语言处理 -> ["自然", "语言", "处理"]
}
)
# 2. Inspect host CPU SIMD acceleration features at runtime
from sutradb._sutradb import detect_simd, batch_vector_distances
simd_level = detect_simd()
print(f"Host SIMD Acceleration: {simd_level}") # e.g., "AVX-512", "AVX2", "ARM NEON"
# 3. Multicore batch distance calculation (GIL-free via Rayon)
distances = batch_vector_distances(
query=[0.1] * 128,
vectors=[[0.2] * 128 for _ in range(10000)],
metric="cosine",
is_normalized=True
)
12. Distributed Multi-Node Cluster & Raft Consensus
SutraDB v5.0 introduces native multi-shard horizontal partitioning and Raft consensus replication:
from sutradb import DistributedCluster
# Initialize multi-node cluster coordinator
cluster = DistributedCluster(node_id="coordinator-0", vnodes_per_node=64)
# Create collection partitioned across 3 logical shards
col = cluster.create_collection("enterprise_wiki", dimension=384, shard_count=3)
# 1. Ingest texts with automatic consistent-hash partition routing
col.add_texts(
texts=[
"Kubernetes container orchestration and ingress controllers.",
"Raft consensus protocol for distributed state machines.",
"ColBERT multi-vector token late interaction retrieval."
],
metadatas=[{"tier": "gold"}, {"tier": "gold"}, {"tier": "silver"}],
namespace="tenant_alpha"
)
# 2. Parallel scatter-gather search across all shards with global top-K RRF fusion
results = col.search(
query="Raft consensus in distributed systems",
namespace="tenant_alpha",
top_k=2
)
for r in results:
print(f"[{r.score:.4f}] {r.text} | Metadata: {r.metadata}")
🛠️ Zero-Build Embedded Developer Workbench (/ui)
SutraDB v5.5.0 ships with an industrial, zero-build, zero-external-CDN Developer Workbench served natively directly from the engine at http://localhost:8765/ui.
┌────────────────────────────────────────────────────────────────────────┐
│ ⚡ SutraDB Console | Developer Workbench v5.5.0 │
├────────────┬─────────────┬──────────────┬──────────┬──────────┬────────┤
│ Hybrid Lab │ Batch Ingest│ Doc Explorer │ 2D PCA │ Admin │ Code │
├────────────┴─────────────┴──────────────┴──────────┴──────────┴────────┤
│ Query: [ "p99 latency in SIMD vector engine" ]│
│ Filter: [ {"status": "resolved", "tier": "gold"} ]│
│ RRF Balance: [===●=======] Dense 0.40 / BM25 0.60 Latency: ⚡ 0.12ms │
├────────────────────────────────────────────────────────────────────────┤
│ 1. [RRF: 0.9412] "Hardware SIMD auto-dispatch (AVX-512 / NEON)..." │
│ 2. [RRF: 0.8120] "ColBERT token late-interaction MaxSim scoring..." │
└────────────────────────────────────────────────────────────────────────┘
1-Click Launch Options
Option A: Instant Docker Container (Recommended)
docker run -d \
--name sutradb \
-p 8765:8765 \
-p 50051:50051 \
-v sutra_data:/data \
samcodesai/sutradb:latest
# Open your browser at:
# 👉 http://localhost:8765/ui
Option B: Python CLI
pip install sutradb-core
python3 -m sutradb.server 8765
Interactive Workbench Panels
| Panel | Core Features & Capabilities |
|---|---|
| ⚡ Hybrid Query Lab | • Real-time Dense Vector + BM25 Lexical search execution. • Interactive Reciprocal Rank Fusion (RRF) balance slider ( 0.0 dense-only to 1.0 BM25-only).• Full AST JSON metadata filter expression support ( {"tier": "gold", "price": {"$lte": 100}}).• Real-time microsecond query latency stopwatch ( ⚡ 0.12ms). |
| 📥 Ingestion & Batch Upsert | • Single-document manual insertion with raw vector and metadata editors. • Bulk JSON array and newline-delimited JSONL drag-and-drop or copy-paste ingestion zone. • Automatic schema validation and vector dimension verification. |
| 🗂️ Document Explorer | • Paginated collection document browser (GET /collections/{name}/documents).• Real-time Document ID filtering and search. • In-place modal metadata patcher ( PATCH /collections/{name}/documents/{id}/metadata).• 1-click document deletion with automatic secondary index and BM25 term pruning. |
| 📊 2D Vector Projection (PCA) | • Zero-dependency in-browser HTML5 Canvas covariance eigenvector decomposition. • Color-coded cluster scatter plot with responsive zoom and pan. • Interactive hover tooltips displaying Document ID, text preview, and metadata. |
| 🛠️ Collection Administration | • Live collection inventory with document counters, dimensionality, and storage breakdown. • 1-click index builders: HNSW Graph, SQ8 Quantization (75% RAM savings), 1-Bit BQ (32x savings), PQ (up to 64x savings), and WAL Compaction. • Collection drop confirmation modal. |
| 💻 Dynamic Code Generator | • Automatically synchronizes with your active query, filters, and RRF weights. • Live, syntax-highlighted snippets ready to copy for Python SDK, LangChain, cURL REST, and Rust gRPC. |
🔒 Zero-Build & Air-Gapped Supply-Chain Guarantee
- No Node.js / npm required: Embedded entirely inside
sutradb/ui.pyusing standard HTML5, CSS Grid, and vanilla ES6. - Zero External CDNs: 100% offline and air-gapped compliant. No external fonts, icons, or JavaScript bundles that could leak telemetry or cause supply-chain poisoning.
- Unprivileged Runtime: Packaged inside Docker running strictly under non-root UID
10001:10001.
⚡ High-Throughput Binary gRPC Server (sutradb-server)
SutraDB v4.0 introduces a native, asynchronous binary gRPC engine built directly in Rust using tonic (HTTP/2) and prost (Protocol Buffers). By streaming raw IEEE-754 binary floats directly across network interfaces, SutraDB eliminates the ~3–5ms JSON serialization overhead of traditional REST endpoints, driving query round-trip latency below 0.4ms.
Running the Standalone Native Server
# Build & run high-performance release binary
cargo run --release --bin sutradb-server -- --host 0.0.0.0 --port 50051 --data-dir ./sutra_data
# Or inspect options
sutradb-server --help
Protocol Buffers Contract (proto/sutra.proto)
syntax = "proto3";
package sutra;
service SutraService {
rpc Query(QueryRequest) returns (QueryResponse);
rpc BatchQuery(BatchQueryRequest) returns (BatchQueryResponse);
rpc Insert(InsertRequest) returns (InsertResponse);
rpc Delete(DeleteRequest) returns (DeleteResponse);
rpc Health(HealthRequest) returns (HealthResponse);
rpc CreateCollection(CreateCollectionRequest) returns (CreateCollectionResponse);
rpc DropCollection(DropCollectionRequest) returns (DropCollectionResponse);
rpc ListCollections(ListCollectionsRequest) returns (ListCollectionsResponse);
rpc GetStats(CollectionStatsRequest) returns (CollectionStatsResponse);
rpc BatchDistances(BatchDistanceRequest) returns (BatchDistanceResponse);
}
🌐 REST Microservice Endpoints
GET /ui&GET /dashboard- Zero-Build Embedded Developer WorkbenchGET /ui/stats- Telemetry metrics for developer workbenchGET /health- Health check & collection registryGET /metrics- Prometheus metrics exporterGET /collections/{name}/documents- Paginated document explorer (limit,offset)GET /collections/{name}/documents/{id}- Single document retrievalDELETE /collections/{name}/documents/{id}- Document deletion with index cleanupGET /collections/{name}/sample_vectors- Sample vectors for 2D visual projectionPOST /collections/{name}/upsert- Idempotent upsertPATCH /collections/{name}/documents/{id}/metadata- In-place metadata patchPOST /collections/{name}/hnsw- Trigger HNSW graph buildPOST /collections/{name}/pq- Train & enable Product Quantization (up to 64x RAM reduction)POST /collections/{name}/bq- Enable 1-Bit Binary Quantization (32x RAM reduction)POST /collections/{name}/sq8- Enable SQ8 vector quantizationPOST /collections/{name}/query- Hybrid, vector, or lexical search
🚀 Production Deployment (Docker & Kubernetes)
SutraDB is packaged as a supply-chain hardened, multi-stage container image conforming strictly to production security invariants:
- Unprivileged Execution: Runs strictly under non-root UID/GID
10001:10001. - Zero Attack Surface: All compilers, Rust toolchains, and package managers are excluded from the runtime image (
python:3.12-slim). - Dual-Daemon Orchestration: Native binary gRPC daemon on port
50051and FastAPI REST / Developer Workbench on port8765. - Graceful Signal Handling: Intercepts
SIGTERMandSIGINTto safely flush Write-Ahead Logs and drain active connections without data loss.
Official Container Images
| Registry | Image Name | Pull Command |
|---|---|---|
| Docker Hub | samcodesai/sutradb |
docker pull samcodesai/sutradb:5.5.0 |
| GitHub Packages (GHCR) | ghcr.io/sam-codesai/sutradb |
docker pull ghcr.io/sam-codesai/sutradb:5.5.0 |
1. Docker Compose (Quickstart)
# Clone and launch dual daemons (gRPC :50051 & REST :8765) with persistent volume
docker compose up -d
# Verify container status and automated healthcheck
docker compose ps
docker compose logs -f
2. Standalone Docker Run
# Run in dual-daemon mode (default with Developer Workbench on :8765)
docker run -d \
--name sutradb \
-p 50051:50051 \
-p 8765:8765 \
-v sutra_data:/data \
samcodesai/sutradb:latest
# Run strictly as high-throughput binary gRPC engine
docker run -d \
--name sutradb-grpc \
-p 50051:50051 \
-v sutra_data:/data \
-e SUTRA_MODE=grpc \
samcodesai/sutradb:latest
# Run strictly as REST microservice + Developer Workbench
docker run -d \
--name sutradb-rest \
-p 8765:8765 \
-v sutra_data:/data \
-e SUTRA_MODE=rest \
samcodesai/sutradb:latest
3. Kubernetes Deployment (k8s/)
Deploy SutraDB as a production StatefulSet with persistent volume claims, automated liveness/readiness probes, and unprivileged security context:
# Apply with Kustomize
kubectl apply -k k8s/
# Or apply individual manifests
kubectl apply -f k8s/sutradb-namespace.yaml
kubectl apply -f k8s/sutradb-configmap.yaml
kubectl apply -f k8s/sutradb-service.yaml
kubectl apply -f k8s/sutradb-statefulset.yaml
# Check rollout status
kubectl rollout status statefulset/sutradb -n sutradb
🧪 Test Suite
Run both native Rust and Python test suites:
# 1. Rust engine, cluster & gRPC integration tests (65 tests)
cargo test
# 2. Python test suite (117 tests)
pytest -v
📜 License
MIT License. Engineered by Samarth.
Metadata
Release files for sutradb-core 5.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sutradb_core-5.5.0.tar.gz | 473.5 kB | Without provenance | Details for sutradb_core-5.5.0.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sutradb_core-5.5.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for sutradb_core-5.5.0-cp310-abi3-win_amd64.whl |
| sutradb_core-5.5.0-cp310-abi3-manylinux_2_34_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.34+ x86-64 | Details for sutradb_core-5.5.0-cp310-abi3-manylinux_2_34_x86_64.whl |
| sutradb_core-5.5.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for sutradb_core-5.5.0-cp310-abi3-macosx_11_0_arm64.whl |
Total release size: 4.5 MB
Release files / sutradb_core-5.5.0.tar.gz
| Download URL | sutradb_core-5.5.0.tar.gz |
|---|---|
| Size | 473.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1dbd511529780dfd9b6c0474bfcb7452feac6649f08a134f8bbc21cad86d90c6
|
|
BLAKE2b-256 checksum How to use checksums |
58c8674ea66bb3e65f0136cf406582a30a11a48a45cf1bed550ca06d04ce3eb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / sutradb_core-5.5.0-cp310-abi3-win_amd64.whl
| Download URL | sutradb_core-5.5.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
273626fc1ae9a36f937b7eb21df0089680f2ddd0c114474c84f8700a527782fd
|
|
BLAKE2b-256 checksum How to use checksums |
a09b834928237f95e0868770e5255fb005a6b35a17534158e93a59fb3b8f6fe6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / sutradb_core-5.5.0-cp310-abi3-manylinux_2_34_x86_64.whl
| Download URL | sutradb_core-5.5.0-cp310-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
63cb664581220602f5a200e0572aca47472e7ed21d6fd2e1cb07b4519a401ffa
|
|
BLAKE2b-256 checksum How to use checksums |
4e19baefaee834a7aca98f550ac00977cd9bb4ed9ad6826b15b072df585083ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / sutradb_core-5.5.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | sutradb_core-5.5.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8680ff3b98ec75805468dbbf6346b4fad369ae4013a4a4dc9d46ab9c92529aca
|
|
BLAKE2b-256 checksum How to use checksums |
e4ef50ec5b7a2afd11664a3bfff6b55ddf3a5f43950f73998d84e27166ac972d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for sutradb-core 5.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.