kalan_db 0.1.0
kalan_db: ^0.1.0 copied to clipboard
Offline hybrid search for Flutter (Android). HNSW + BM25, RRF-fused, with on-device ONNX query embedding — no server required.
0.1.0 #
Initial public release of Kalan DB.
- Embedded, offline hybrid search: HNSW vector + BM25 keyword, fused with
Reciprocal Rank Fusion (configurable
alpha). - On-device text embedding via ONNX Runtime (
flutter_onnxruntime): ship a small int8 model and embed queries at runtime — no server, no pre-computed query vectors.TextEmbedderwith a pure-Dart BERT WordPiece tokenizer (validated against the HuggingFace reference), CLS/mean pooling, L2 normalization.EmbeddedKalanDBconvenience wrapper:search(String text)embeds then searches in one call.- Tuned defaults for
bge-small-en-v1.5(CLS pooling + query instruction); configurable for e5 / all-MiniLM (mean pooling).
- Memory-mapped, read-only
.vdbformat with header + xxHash64 integrity check. - Metadata pre-filtering (subject, grade, chapter, language, book id).
- Python offline builder (PDF → chunks → embeddings →
.vdb) and a nativevdb_build/vdb_queryhost tool. - On-device KPI harness (example): Precision@5, Recall@10, NDCG@10, MRR plus embed/search latency, evaluated against Gemini-graded relevance judgments.
- Android (arm64-v8a) only in this release.