Documents and RAG
RAG lets an agent retrieve passages from documents it can access, then use them in its answer. There are two stages: index documents, at the request of a user or an automated process, then retrieve useful passages for each question.
The database coordinates jobs for both workers. RAG-Ingestor prepares passages there, then RAG-Embed builds their index. A document becomes searchable once this processing is complete.
Called by RAG-Embed
Metadata
and references
The chat model receives the selected excerpts, question and agent instructions. Workers are not involved in each question. Original documents remain available through the cited sources.
Answer and sources
Chat for answering
and references
and metadata
The question embedding model must be compatible with the one used for indexed passages. Changing the model may require reindexing those documents.
Storage roles
| Resource | Contents | Role in RAG |
|---|---|---|
| Database | Jobs, state and document metadata | Orchestrate processing, keep permissions and passages waiting for embedding |
| Vector database | Vectors, passage text and references | Retrieve relevant passages for a question |
| Object storage | Original files | Read documents during ingestion and allow source consultation |
Text, scans and OCR
RAG ingestion extracts native text and does not automatically invoke an agent’s AI OCR. A mixed PDF retains its native text with a partial coverage diagnostic, while a fully scanned document without usable text is rejected. Specialised OCR belongs to conversation and Studio workflows, with the selected model’s capabilities and resources.
Deployment
Indexing depends on both workers, storage and the embedding model. The first-use check follows this path with a text document and an answer citing its source.
A remote embedding provider receives the text to embed. A remote chat provider receives the passages selected for the answer. These exchanges are part of the deployment flows.