qdrant_edge_flutter library
On-device Qdrant vector search for Flutter, powered by the qdrant-edge
Rust engine over dart:ffi. Everything runs locally — no server, no network.
QdrantEdge is the client/factory: it creates Shards (the vector store)
and the on-device embedders (Bm25 sparse, Dense semantic). Complex
arguments are plain Dart Map/List that are passed to the engine as JSON,
mirroring the Qdrant request model.
final client = QdrantEdge();
final shard = client.createShard('${dir.path}/notes', {
'vectors': {'dense': {'size': 384, 'distance': 'Cosine'}},
});
shard.upsert([
{'id': 1, 'vector': {'dense': embedding}, 'payload': {'title': 'fox'}},
]);
final hits = shard.search({'vector': query, 'using': 'dense', 'limit': 5});
shard.close();
For the simple "add text / search text" workflow, see TextIndex via QdrantEdge.openTextIndex.
Classes
- Bm25
- On-device BM25 sparse embedder. Reusable across texts and shards.
- Dense
- On-device dense (semantic) embedder. Reusable across texts and shards.
- QdrantEdge
- The client / factory. Cheap to construct; the native library loads once.
- Shard
- An open vector shard — the on-device store + index. Operations are synchronous; for large batches run them in an isolate. Unusable after close.
- TextIndex
-
Convenience wrapper for text-first use: it owns a Shard plus a Bm25
embedder (and an optional Dense one) and embeds text for you. Lexical-only
by default; pass
modelDirto QdrantEdge.openTextIndex for hybrid.
Exceptions / Errors
- QdrantEdgeException
- Thrown when a native call fails. The message comes from Rust.