Glossary/Generation & Quality

What is RAG (Retrieval-Augmented Generation)?

An AI architecture that retrieves relevant documents from a trusted knowledge source and passes them to a language model, so answers are grounded in real content instead of the model's training data.

Large language models answer from what they memorized during training — which is frozen at a point in time, knows nothing about your company, and is happy to fill gaps with plausible-sounding fiction. Retrieval-augmented generation fixes this by splitting the job in two: a retrieval step finds the most relevant passages from a curated knowledge source, and a generation step writes an answer using only those passages as context.

The quality of a RAG system is mostly determined by retrieval quality. If the right passage is retrieved, modern LLMs summarize it faithfully; if the wrong passages are retrieved, no amount of prompting saves the answer. This is why production RAG systems invest in hybrid search, careful chunking, and evaluation rather than just prompt engineering.

RAG also enables provenance: because the system knows exactly which passages informed an answer, it can cite them — something a bare LLM fundamentally cannot do.

In BeforeQuery

How BeforeQuery uses this

BeforeQuery is a RAG platform end to end: sources are crawled and normalized to markdown, chunked heading-aware, embedded, and stored; questions run hybrid retrieval (vector + full-text with rank fusion); and answers stream with numbered citations to the exact source documents. Low-confidence retrievals trigger a transparent fallback instead of a guess.

From definition to deployment

Connect a knowledge source and see cited AI answers on your own content in minutes — free, no credit card required.

Get Started Free