Built in Rust · MIT License · 110 Tests Passing

Vector Search.
Distributed. Fast.

A fault-tolerant, in-memory vector database built from first principles. Raft consensus, HNSW indexing, WAL durability — REST & gRPC ready.

0Tests Passing
O(log N)HNSW Search
<300msLeader Re-election
6Isolated Crates

Three Endpoints. That's It.

Query a distributed vector cluster with plain HTTP. No SDK required.

bash
# Check cluster status
$ curl http://localhost:8080/health

# Or on Fly.io
$ curl https://vajra.fly.dev/health

Live response

{
  "status": "ok",
  "role": "Leader",
  "term": 62,
  "leader": 1,
  "vector_count": 4821,
  "last_applied": 4821
}
bash
# Insert a vector
$ curl -X POST http://localhost:8080/upsert \
  -H "Content-Type: application/json" \
  -d '{ "id": "doc1", "vector": [0.12, 0.84, ...] }'

Response

{
  "status": "ok",
  "id": "doc1",
  "replicated_to": 3,
  "raft_index": 4822
}

Built from First Principles

No off-the-shelf consensus library. No managed search engine. Every component written from scratch in Rust.

Raft Consensus

Full Raft implementation with leader election, log replication, and Pre-Vote extension to prevent term inflation during network partitions.

HNSW Index

Hierarchical Navigable Small World graph in RAM. O(log N) queries, 95%+ recall at sub-ms latency. M=16 sweet spot for 128-dim vectors.

Write-Ahead Log

CRC32-verified WAL with crash recovery. Corrupt tail entries are detected and truncated automatically on restart — zero data loss.

Biased Reactor

Tokio's biased select! ensures heartbeats are never delayed by slow searches. Cluster stability preserved under any load.

gRPC + REST

Native gRPC with streaming upserts for high-throughput clients. Axum HTTP layer for zero-friction access via curl or Postman.

Workspace Crates

6 isolated crates: common, engine, WAL, raft, transport, server. Clean boundaries enable independent testing of every subsystem.

5 Failure Scenarios. All Tested.

Production-grade resilience isn't a claim — it's a test suite.

SCENARIO 1✓ Passing

Leader Crash

Leader dies mid-heartbeat. New leader elected in under 300ms via election timeout.

SCENARIO 2✓ Passing

Network Partition

Leader isolated from majority. Pre-Vote prevents term inflation. Majority side elects new leader.

SCENARIO 3✓ Passing

Split Brain Prevention

Network heals after partition. Higher-term leader wins. Logs reconcile to single consistent state.

SCENARIO 4✓ Passing

WAL Corruption

Crash during write, partial entry. CRC32 detects corruption. Corrupt tail truncated and recovered automatically.

SCENARIO 5✓ Passing

Follower Lag

Follower falls behind leader. Leader sends missing entries via AppendEntries using nextIndex[].

Self-host in minutes.

Clone, build, run. A 3-node Raft cluster with one script.