- On — your assistant stops there and never answers from general knowledge. This is the default for every assistant you have published as a public chatbot, and your organization’s embedded website widget always works this way.
- Off — the default for your other assistants: after saying the documents do not cover it, the assistant may add what it knows from general knowledge, labelled as not coming from your documents.
How retrieval works
1
Rephrase and expand
Before any search runs, Ragen AI rewrites your question into a self-contained standalone query — removing pronouns and references that only make sense in the context of the conversation so far. In the same step, the system generates one alternative phrasing of the question (multi-query expansion). Both queries run in parallel against your knowledge base.Multi-query expansion is on by default at the organization level. A platform administrator can turn it off per organization in the admin panel’s RAG Settings; organization admins see the current state on the organization’s RAG settings page.
2
Hybrid retrieval
Each query runs a hybrid search that combines two complementary signals:
- Dense vectors — semantic similarity using
bge-multilingual-gemma2embeddings, which captures meaning even when the exact words differ - BM25 sparse search — exact-term and morphological matching that catches part numbers, proper names, and technical jargon that dense search can miss
3
Reranking or section selection (optional)
When reranking is enabled, Ragen AI over-retrieves three times the final number of chunks, then passes them through a reranking model that re-scores each passage against the question. The top-scoring chunks move forward; the rest are discarded.Reranking is opt-in and requires
FEATURE_FLAG_RERANKING=1 plus provider credentials in your deployment, so a default install answers from the hybrid results. The default provider, Scaleway qwen3-embedding-8b, re-sorts passages by embedding similarity; RERANK_PROVIDER=cohere uses Cohere Rerank v3.5, a cross-encoder. If the reranker encounters an error, the pipeline falls back to the raw hybrid results, and the answer is never blocked. The organization’s RAG settings page shows reranking as off whenever the deployment does not run it.Section selection is an alternative that takes the reranker’s place: a language model is shown the question and the candidate passages and names the ones worth reading, in one call per turn. It is off by default and switched on per organization (sectionSelection). When it is on, the reranker does not run. If the model times out or answers something unreadable, the pipeline keeps the hybrid order. Measured on Ragen’s own evaluation set, it matched the reranker on prose and did worse on tables, which is why it is not the default.4
Read the neighbouring chunks
Each chunk that survives the previous step is read together with the chunk on either side of it in the same file. The pieces are joined into one passage and the overlap between them is trimmed, so an answer that starts at the end of one chunk keeps its first half. Neighbours are always the same kind of chunk: prose expands into prose, never into the summary or a table chunk.This is on by default and can be turned off per organization (
contextExpansion). The extra context is capped at three times the usual amount, and it adds a few milliseconds per question.5
Answer generation with citations
The surviving chunks become the context for the language model. The model generates an answer that is grounded in those chunks and cites the source documents by name. Only the sources the model explicitly names in its answer are recorded as citations — sources that were retrieved but not referenced are excluded from the citation list.
Model roles
Ragen AI uses up to five model roles across the pipeline. Each role has a default and can be configured independently in your deployment.If you switch to local or self-hosted models, configure every role you use together. The embedding model in particular must stay consistent between ingest and retrieval — if you change it after documents are already indexed, the existing vectors become incompatible with new queries and you will need to re-index your entire knowledge base.
Multilingual support
The default embedding model,bge-multilingual-gemma2, supports cross-lingual retrieval. You can upload documents in one language and ask questions in another — the pipeline matches meaning across languages rather than requiring identical terminology.
Cross-lingual questions are also where each passage’s title-and-section prefix (see Knowledge base) helps most. On Ragen’s own bilingual evaluation set, the figures asked about in the other language reached the model in two or three cases out of eight without the prefix, and in all eight with it. The set is small — 24 questions, three runs — so treat that as a direction, not a guarantee. The benchmark ships in the repository (apps/web/evals/rag-benchmark) so you can run it on your own documents.
Pipeline configuration flags
Pipeline configuration flags
The following environment flags control which pipeline stages are active in your deployment:
Multi-query expansion has no environment flag — it is the per-organization multi-query setting, changed in the admin panel’s RAG Settings and shown read-only on the organization’s RAG settings page.Three more stages are feature keys, set for the whole platform or per organization in the admin panel’s Features page: