mobile_rag_engine
0.24.0, released 4 days ago by glasses-dev.win
Build local, on-device RAG in Flutter with semantic search and hybrid retrieval.
What it does
Provides a Dart package to ingest documents, chunk them, embed them on-device using ONNX, and run hybrid vector (HNSW) and keyword (BM25) search. Works completely offline with local storage and integrates with any LLM.
AI-written summary of version 0.24.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need offline, on-device document search and retrieval for a Flutter app.
- User data must stay on the device for privacy and zero server cost.
- You want to combine vector search and keyword retrieval before feeding context to an LLM.
Skip it when
- You require cloud-hosted vector databases or server-side document processing.
- You need built-in OCR for scanned, image-only PDFs without external setup.
Strengths
- Completely offline and private operation with local embedding and SQLite storage.
- Hybrid retrieval combining HNSW vector search and BM25 keyword search via RRF fusion.
- Compatible with any custom LLM generation function or backend.
Weaknesses
- Requires manual platform configuration and downloading model packs for native dependencies.
- Scanned or image-only PDFs require an external OCR layer.
- Model assets must be bundled and initialized correctly.
Setup
- Kind
- Flutter widgets
- Effort
- High
- Code generation
- Yes (build_runner)
- Direct dependencies
- 6
Requires running a Dart setup script for model presets, adjusting native iOS/macOS host deployment targets, and adding model assets to pubspec.yaml.
final rag = MobileRag.instance;
await rag.addDocument('Refunds are accepted within 14 days of purchase.');
final result = await rag.searchHybridWithContext('How long is the refund period?', tokenBudget: 2000);
print(result.context.text);Alternatives
Packages that do the same job and could replace mobile_rag_engine.
- chromadb
Dart client for the ChromaDB vector database API for AI applications.
75Compare - flutter_edge_ai
On-device AI for Flutter to run Gemma and other LLMs, embeddings, and speech without a server.
87Compare - nobodywho
Run local LLMs, vision, embeddings, RAG, tool calling, STT, and TTS on mobile and desktop.
80Compare - flutter_whisper_kit
On-device speech recognition and transcription using WhisperKit on iOS and macOS
42Compare
Works with
Packages commonly used together with mobile_rag_engine: ones it builds on, ones built on it, and its own family.
- cryptomobile_rag_engine depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- path_providermobile_rag_engine depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- freezed_annotationmobile_rag_engine depends on itAnnotations for the freezed code-generator.
- flutter_rust_bridgemobile_rag_engine depends on itFlutter/Dart and Rust binding generator
- flutter_onnxruntimemobile_rag_engine depends on itA native wrapper plugin for running ONNX Runtime models across multiple platforms.