RunAnywhere.rag.open creates a session that owns one corpus and its index. The session loads the
embedding model and, when you pass one, the language model.
llmModel null for a retrieval-only session. search still works; query and queryStream
throw.
open
SDKException when a model cannot be loaded or the index cannot be created. The RAG backend
registers itself here, so there is no separate wiring step.
RagConfig
The session
clear drops every document but keeps the session open. close destroys the index.
Ingesting
RagDocument.file reads UTF-8 text and throws when the path does not exist. It sets sourceUri for
you. ingestAll runs the documents one at a time and stops at the first failure.
Retrieval without generation
Match carries text, score, and metadata. topK overrides the session config for one call.
Answering
RagResult carries answer, sources (the Match list the answer was grounded in), and metrics,
a full GenerationResult for the generation half.
Streaming an answer
RagRetrieved arrives before any token. RagEvent is sealed.
Statistics
Models
RAG needs an embedding model, and an embedding model needs its vocabulary next to the weights, which means a multi-file registration.await Onnx.register() before opening a session.
Complete example
See also
Embeddings
Vectors and reranking
Models
Multi-file registration