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.
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.
Related terms
Embeddings
Numeric vector representations of text in which semantically similar passages end up close together, enabling search by meaning rather than exact words.
Hybrid Search
A retrieval strategy that combines semantic (vector) search with keyword (full-text) search and merges the results, capturing both meaning and exact matches.
Citations
Links from an AI answer back to the specific source documents used to generate it, allowing users to verify every claim.
Hallucination
When a language model generates fluent, confident content that is factually wrong or entirely invented.
Chunking
Splitting documents into smaller passages before embedding, so retrieval can return the precise section that answers a question rather than a whole page.
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