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
- CollectionRag
- Collection-scoped facade for Multi-Collection workflows.
- MobileRag
- Singleton facade for Mobile RAG Engine.
- 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.