RagSession class

One RAG corpus with its index.

The Flutter RAG bridge owns a single native session (matching RN/Web), so RagApi.open rejects a second concurrent session instead of silently superseding the active one. Calls after close throw.

Properties

generates bool
True when the session was opened with an LLM and can answer questions.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() Future<void>
Drop every document from the corpus, keeping the session open.
close() Future<void>
Destroy the index and release native resources.
ingest(RagDocument document) Future<void>
Index document into the corpus.
ingestAll(List<RagDocument> documents) Future<void>
Index every document in documents.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(String question, {RagQueryOptions? options}) Future<RagResult>
Answer question from the corpus.
queryStream(String question, {RagQueryOptions? options}) Stream<RagEvent>
Answer question, emitting retrieved chunks then answer tokens.
Retrieve the chunks closest to query without generating an answer.
stats() Future<RagStats>
Document, chunk, and index-size counts.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited