RAG and documents
RAG overview
Understand retrieval-augmented generation in OpenVortexAI and the states required for a reliable answer.
Retrieval-augmented generation searches indexed document chunks and adds the most relevant results to a model request.
Preconditions
RAG requires all of the following:
- A supported source file.
- Successful text extraction or OCR.
- Successful chunking.
- Successful embedding generation.
- Stored vectors and chunk metadata.
- The document selected directly or through project/chat knowledge.
An upload success message confirms only the first storage step. Use the document status to confirm text and RAG readiness.
Default embedding path
The API runs sentence-transformers/all-MiniLM-L6-v2, producing 384-dimensional embeddings. PostgreSQL with pgvector stores the vectors. The embedding model runs in the API container, not in PostgreSQL.
Retrieval modes
- Keyword emphasizes lexical matches.
- Vector emphasizes semantic similarity.
- Hybrid combines both scores.
- Reranking optionally reorders the candidate chunks in a second pass.
Start with representative queries and expected evidence before tuning weights or worker counts.