# SwarnDB

A production-grade vector and graph database engine written in Rust, where a vector's identity and its graph node are the same object, so a single query can combine nearest-neighbor similarity search with explicit, typed graph traversal without syncing two separate databases.

SwarnDB is a database engine, written in Rust, that stores a vector and a graph node as the same underlying object rather than as two systems kept in sync through application glue code. Used purely as a vector store, every collection is backed by HNSW for approximate nearest-neighbor search, with optional scalar quantization for larger collections, four distance metrics, per-query recall-versus-latency tuning, batch search and metadata pre-filtering.

Flipping a collection to hybrid mode adds a real typed graph on top of the same identities: directed, typed edges that carry a confidence score and a manual-versus-extracted provenance flag, created explicitly through a put_edge call or extracted by an LLM, never inferred from vector similarity. A single query plan can then scope results by graph structure and rank them by vector similarity in one pass, without a foreign key or a separate mirror table linking the two views of the data.

The vector-only mode requires no extra configuration; the graph mode is opt-in per collection.

Website: https://github.com/SarthiAI/SwarnDB
