mobile_rag library
Main entry point for Mobile RAG Engine.
Provides a singleton pattern for easy access throughout your app. Initialize once in main(), use anywhere via MobileRag.instance.
Quick Start
import 'package:mobile_rag_engine/mobile_rag_engine.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await MobileRag.initialize(
tokenizerAsset: 'assets/tokenizer.json',
modelAsset: 'assets/model.onnx',
);
runApp(const MyApp());
}
// Later, anywhere in your app:
final result = await MobileRag.instance.search('What is Flutter?');
Classes
- AddSourceResult
- AssembledContext
- Assembled context ready for LLM consumption.
- AssembledContextV2
- ChunkData
- ChunkExcerptResult
- ChunkSearchResult
- ClearAndRestartConfirmation
-
Typed acknowledgment that the caller understands
clearAndRestartdeletes every on-device embedding BLOB. Required as an explicit parameter so the destructive choice is visible at every call site. - CollectionRag
- Collection-scoped facade for Multi-Collection workflows.
- MigrationAxes
- Read-only snapshot of all migration axes plus the last engine version.
- MobileRag
- Singleton facade for Mobile RAG Engine.
- RagEmbeddingFingerprintLock
- Snapshot of an active embedding fingerprint mismatch.
- RagReembedProgress
-
Progress event emitted during
reembedAll(progress:). - RagSearchResult
- Search result with assembled context.
- SearchHandle
- SearchHitMeta
- SearchMetaResult
- Result of the additive low-level search lane.
- SourceEntry
- SourceStats
- TextChunker
- Utility class for splitting text into smaller chunks for RAG.
Enums
- ChunkingStrategy
- Chunking strategy for document processing.
- ContextStrategy
- Strategy for selecting and ordering chunks.
- SearchHydrationMode
- Hydration mode for high-level hybrid search results.