Embeddable cross-platform vector database with HNSW ANN, hybrid vector + BM25 retrieval, knowledge graph, relational object store, and convergent multi-device sync — all in a single zero-dependency C++ library.
pip install edgevdb
A complete on-device RAG stack — from embedding to sync — in under 500 KB.
384-dim float32 vectors with M=16, ef=200/64. Sub-millisecond query latency at 10K vectors with 96.8% recall.
Union of HNSW vector search and a real BM25 lexical index, re-ranked by α·cosine + β·page proximity + γ·keyword (or RRF fusion). Choose hybrid, vector, or bm25 mode — BM25 needs no embedding model at all.
On-device NER extracts entities, builds a graph, and multi-hop expansion discovers hidden connections.
Bring embeddings from any provider, or use the built-in embedder with real ONNX Runtime inference (dynamically loaded — no link-time dependency). Falls back to a clearly-flagged non-semantic hash when ORT is absent.
Schema-less NoSQL with typed property indexing. Add foreign-key edges between objects for a rich data graph.
Last-Writer-Wins replication with logical clocks, device-partitioned IDs, and delete tombstones. Replicas provably converge under bidirectional delta exchange.
vectordb.h — single header, ABI-stable. One include, one link. Works with any FFI binding.
Pure C++17 — no external libraries required. ONNX Runtime is optional. Core works everywhere.
A layered architecture that separates concerns cleanly — platform SDKs on top, the C++ core underneath.
Text → 384-dim vector (ONNX or pre-computed)
ANN k-NN with 3× overfetch
α·cosine + β·page + γ·keyword
Multi-hop entity graph traversal
Assemble RAG context for LLM
Choose your platform. Bring your own embeddings or use the built-in embedder.
from edgevdb import EdgeVDB
# Open database
with EdgeVDB("./data") as db:
# Use embeddings from ANY provider
embedding = your_provider.embed("Neural networks classify images")
chunk_id = db.insert_chunk(
"Neural networks classify images",
embedding, doc_id=1, page_number=0
)
# Query
query_emb = your_provider.embed("image classification")
results = db.query_vector(query_emb, query_text="image classification", top_k=5)
for r in results:
print(f" [{r.score:.3f}] {r.text}")
results.free()
val db = EdgeVDB.open(context)
val embedding: FloatArray = yourProvider.embed("Neural networks classify images")
val chunkId = db.insertChunk(
embedding, "Neural networks classify images", docId = 1, pageNumber = 0
)
// QueryResults is AutoCloseable — use .use{} to avoid handle leaks
db.queryVector(embedding, "image classification", topK = 5).use { results ->
results.toList().forEach { println("${it.score}: ${it.text}") }
}
db.close()
let db = try EdgeVDB(storageDir: storageDir)
let embedding: [Float] = yourProvider.embed("Neural networks classify images")
let chunkId = try db.insertChunk(
text: "Neural networks classify images",
embedding: embedding, docId: 1, page: 0
)
let results = try db.queryVector(
embedding: embedding, queryText: "image classification", topK: 5
)
defer { results.close() }
for r in results.toArray() {
print("\\(r.score): \\(r.text)")
}
#include "edgevdb/vectordb.h"
EvdbConfig config;
evdb_default_config(&config);
config.storage_dir = "./data";
EvdbHandle* db = evdb_open(&config);
float embedding[384] = { /* from your provider */ };
uint64_t chunk_id;
evdb_insert_chunk(db, "Hello world", embedding, 1, 0, &chunk_id);
EvdbQueryHandle* q = evdb_query_vector(db, embedding, "hello", 5);
printf("Top: %s (%.3f)\\n", evdb_result_text(q, 0), evdb_result_score(q, 0));
evdb_query_free(q);
evdb_close(db);
The entire C API fits in a single header. Every function is documented.
evdb_default_config(EvdbConfig* out)
Fill config with defaults
evdb_open(const EvdbConfig* config) → EvdbHandle*
Open or create a database
evdb_save(EvdbHandle* h) → EvdbError
Flush all data to disk
evdb_close(EvdbHandle* h)
Close and free handle
evdb_insert_text(h, embedder, text, doc_id, page, &id)
Auto-embed and insert
evdb_insert_chunk(h, text, emb384, doc_id, page, &id)
Insert with pre-computed embedding
evdb_remove_chunk(h, chunk_id)
Remove a chunk by ID
evdb_query_text(h, embedder, query, topk, kg) → QueryHandle*
Auto-embed query
evdb_query_vector(h, emb384, text, topk) → QueryHandle*
Query with pre-computed vector
evdb_result_count / text / score / chunk_id / page
Result accessors
evdb_query_free(q)
Free result handle
evdb_object_put(h, type, json, &id)
Insert/update object
evdb_object_get(h, id, out_json, size)
Get object as JSON
evdb_relation_add(h, name, from, to)
Add typed directional edge
evdb_relation_get_targets(h, name, from, ids, &count)
Get relation targets
evdb_sync_create(h, device_id) → SyncEngine*
Create sync engine
evdb_sync_export_delta(s, since, out, size)
Export changes since clock
evdb_sync_apply_delta(s, json, &applied, &skipped)
Apply received delta
hnsw_M16Max connections/node
hnsw_ef_construction200Build search width
hnsw_ef_search64Query search width
ranker_alpha0.70Cosine weight
ranker_beta0.20Page proximity weight
ranker_gamma0.10Keyword weight
token_budget3200Max RAG tokens
All benchmarks are measured on real hardware — Intel i7-1165G7, 16 GB DDR4, Windows 11.
| Capability | EdgeVDB | Chroma | Qdrant | FAISS | Pinecone |
|---|---|---|---|---|---|
| Sub-ms query | ✓ | ✗ | ✗ | ✓ | ✗ |
| Hybrid re-ranking | Built-in | Plugin | Filter | ✗ | Server |
| Knowledge graph | Built-in | ✗ | ✗ | ✗ | ✗ |
| CRDT sync | Built-in | ✗ | Raft | ✗ | Cloud |
| Mobile native SDK | ✓ | ✗ | ✗ | ✗ | REST |
| Zero deps | ✓ | ✗ | ✗ | ✗ | N/A |
| In-process | ✓ | ✓ | ✗ | ✓ | ✗ |
Build once in C++17, deploy everywhere — from Raspberry Pi to flagship phones.
Kotlin SDK with JNI bridge. AAR distribution via Maven Central.
Swift SDK with C bridging header. SPM and CocoaPods support.
Zero-install ctypes binding. PyPI package available.
Static or shared library. CMake FetchContent integration.
One command to build. Tested presets for every target.
# Debug (with tests)
cmake --preset desktop-debug
cmake --build build/desktop-debug
# Release (with benchmarks)
cmake --preset desktop-release
cmake --build build/desktop-release
export ANDROID_NDK="/path/to/ndk"
# ARM64 (physical devices)
cmake --preset android-arm64
cmake --build build/android-arm64
# x86_64 (emulators)
cmake --preset android-x86_64
cmake --build build/android-x86_64
# Run all C++ tests
./build/desktop-debug/tests/test_hnsw
./build/desktop-debug/tests/test_hybrid_ranker
./build/desktop-debug/tests/test_embedder
./build/desktop-debug/tests/test_object_store
./build/desktop-debug/tests/test_sync
./build/desktop-debug/tests/test_e2e_rag
Transforming AI for the real world — making intelligent systems run anywhere, on any device.
XformAI is an AI technology company focused on building on-device intelligence infrastructure. We believe the future of AI is not in the cloud — it's on the edge, running locally, privately, and instantly on the devices people use every day.
EdgeVDB is our flagship open-source SDK — a zero-dependency vector database purpose-built for mobile, desktop, and IoT devices. From smartphones to Raspberry Pi, our technology powers private, offline-first AI experiences without compromising on performance.
All data stays on-device. No cloud. No telemetry. No API keys required.
Sub-millisecond queries. 428 KB footprint. SIMD-optimized for ARM & x86.
One C++ core, native SDKs for Android, iOS, Python, and Desktop.
Apache 2.0 licensed. Build with us, contribute, and shape the future of edge AI.