Skip to content
pubscout

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.

$ flutter pub add mobile_rag_engine
Source repository

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.

  • flutter_edge_ai

    On-device AI for Flutter to run Gemma and other LLMs, embeddings, and speech without a server.

  • nobodywho

    Run local LLMs, vision, embeddings, RAG, tool calling, STT, and TTS on mobile and desktop.

  • flutter_whisper_kit

    On-device speech recognition and transcription using WhisperKit on iOS and macOS

Works with

Packages commonly used together with mobile_rag_engine: ones it builds on, ones built on it, and its own family.