Skip to main content

Zero-Gravity Embedded Vector Database - Offline-first, RAM-efficient vector search

Project description

SrvDB: High-Performance Embedded Vector Database

SrvDB is a production-grade, serverless vector database built in Rust. It is designed for edge computing, local AI applications, and high-concurrency environments where low memory footprint and zero-latency persistence are critical.

Unlike client-server vector databases that introduce network overhead, SrvDB runs directly in your application process, utilizing memory-mapped files (mmap) for near-instant access to billion-scale datasets without heavy RAM requirements.

PyPI License Build Status

Core Capabilities

  • Zero-Copy Architecture: Leveraging OS-level memory mapping to serve vectors directly from disk, bypassing the need for massive heap allocations.
  • SIMD Acceleration: Hardware-optimized cosine similarity kernels (AVX-512, NEON) automatically selected at runtime.
  • Acid-Compliant Persistence: Buffered Write-Ahead Logging (WAL) strategy ensures zero data loss even during process termination.
  • Concurrency: Thread-safe architecture demonstrating linear scalability up to 16 cores (beating ChromaDB in high-load benchmarks).

Performance Benchmarks

Benchmarks were conducted on standard consumer hardware (NVMe SSD, 16GB RAM).

Metric SrvDB v0.1.6 Target Status
Ingestion Throughput 797 vectors/sec >500 ✅ Exceeded
Search Latency (P99) 3.8ms <15ms ✅ Exceeded
Recall Accuracy 100.0% 100% ✅ Exact
Storage Efficiency ~192 bytes/vec - -

Benchmark methodology: 10k vectors (1536-dim), k=10, single-node ingestion.

Installation

Python

pip install srvdb

Rust

Add this to your Cargo.toml:

[dependencies]
srvdb = "0.1.6"

Quick Start

Python Example

import srvdb

# Initialize (creates ./search_index if not exists)
db = srvdb.SvDBPython("./search_index")

# Add Data (Auto-persisted via WAL)
db.add(
    ids=["vec_1", "vec_2"],
    embeddings=[[0.1] * 1536, [0.2] * 1536],
    metadatas=['{"source": "prod"}', '{"source": "dev"}']
)

# Search
results = db.search(
    query=[0.1] * 1536,
    k=5
)

print(f"Found ID: {results[0][0]}, Score: {results[0][1]}")

Architecture

SrvDB utilizes a hybrid storage engine:

  1. Index Layer: A flat, memory-mapped binary file (vectors.bin) containing raw Float32 vectors.
  2. Metadata Layer: A durable embedded Key-Value store (metadata.db) mapping string IDs to internal offsets.
  3. Buffer Layer: A 1MB write-buffer (BufWriter) that batches I/O syscalls, providing a 5x improvement in ingestion speed over unbuffered IO.

Licensing

SrvDB is open-source software licensed under the AGPL v3.0.

  • Open Source Use: Free to use in any GPL/AGPL compatible open-source project.
  • Commercial Use: If you wish to embed SrvDB in a proprietary, closed-source application without releasing your source code, you must purchase a Commercial License.

Contact [srinivasvarma764@gmail.com] for commercial licensing inquiries.



### 5. Push to GitHub

Now, execute these commands to push your professional repo:

```bash
# 1. Initialize Git (if not done)
git init

# 2. Add the new files
git add README.md LICENSE CONTRIBUTING.md BENCHMARK.md

# 3. Commit
git commit -m "docs: release preparation v0.1.6"

# 4. Rename branch to main
git branch -M main

# 5. Connect to your repo (Change URL to yours)
git remote add origin https://github.com/Srinivas26k/srvdb.git

# 6. Push
git push -u origin main

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

srvdb-0.1.7.tar.gz (5.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

srvdb-0.1.7-cp312-cp312-manylinux_2_34_x86_64.whl (688.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file srvdb-0.1.7.tar.gz.

File metadata

  • Download URL: srvdb-0.1.7.tar.gz
  • Upload date:
  • Size: 5.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for srvdb-0.1.7.tar.gz
Algorithm Hash digest
SHA256 6ed57cd6f8df36cec2bb582e51c47e16a968306cfe57e63a323c60ac0680fe39
MD5 4625208369d6632a622e7a74028ce949
BLAKE2b-256 336152320d0481252cef98469eab9d661a4cdfbe7ea4c1e62d14fe742c305afd

See more details on using hashes here.

File details

Details for the file srvdb-0.1.7-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for srvdb-0.1.7-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ed03fa891c7c9669ccb100dcc784b95c3eca32ba18b4df771b6432fab0c73668
MD5 a4297d832bfaaf7431fc5aaef95f7624
BLAKE2b-256 ee692e14930d8e29c4984587472856a7dcf25c69dcac84d7546cf1b48c1f87f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page