mobile_rag_engine 0.3.0
mobile_rag_engine: ^0.3.0 copied to clipboard
A high-performance, on-device RAG (Retrieval-Augmented Generation) engine for Flutter. Run semantic search completely offline on iOS and Android with HNSW vector indexing.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.3.0 - 2026-01-08 #
0.2.0 - 2024-12-08 #
Added #
- LLM-Optimized Chunking: Introduced
ChunkingServicewith Recursive Character Splitting and Overlap support. - Improved Data Model: Separated storage into
Source(original document) andChunk(searchable parts). - Context Assembly: Added
ContextBuilderto intelligently assemble LLM context within a token budget. - High-Level API: New
SourceRagServicefor automated chunking, embedding, and indexing pipeline. - Context Strategies: Support for
relevanceFirst,diverseSources, andchronologicalcontext assembly strategies.
0.1.0 - 2024-12-08 #
Added #
- Initial release
- On-device semantic search with HNSW vector indexing
- Rust-powered tokenization via HuggingFace tokenizers
- ONNX Runtime integration for embedding generation
- SQLite-based vector storage with content deduplication
- Batch embedding support with progress callback
- Cross-platform support (iOS and Android)
Features #
initDb()- Initialize SQLite databaseaddDocument()- Add documents with SHA256 deduplicationsearchSimilar()- HNSW-based semantic searchrebuildHnswIndex()- Manual index rebuildEmbeddingService.embed()- Generate embeddingsEmbeddingService.embedBatch()- Batch embedding
Performance #
- HNSW search: O(log n) complexity
- Tokenization: ~0.8ms for short text
- Embedding: ~4ms for short text, ~36ms for long text
- Search (100 docs): ~1ms