Skip to main content
AEGIBIT
← AEGIBIT Glossary

Retrieval-Augmented Generation (RAG)

An AI architecture where a model retrieves relevant documents from a trusted knowledge base at question time and answers from them, instead of relying on whatever it memorized in training.

Why it matters

Plain language models guess plausibly, which is fatal for business use: stale product facts, invented prices, confident nonsense. RAG matters because it grounds answers in your actual, current content, makes them citable, and lets knowledge update by updating documents rather than retraining or rewriting prompts.

How it works

Content is split into chunks and indexed (lexically, as vectors, or both). At question time the system retrieves the most relevant chunks, injects them into the model's context with instructions to answer only from them, and ideally returns the sources used. Quality hinges on retrieval: good chunking, fresh indexing, and honest fallbacks when nothing relevant exists.

A real-world example

A company chatbot once pitched a retired product for weeks because its knowledge lived in a hardcoded prompt nobody updated. Rebuilt as RAG over the live website, the bot now learns every new page automatically at the next crawl and cites the page it answered from. Ship content, and the bot is current, no prompt edits.

Common mistakes

Best practices

Frequently asked questions

Does RAG eliminate hallucinations?

It reduces them sharply when paired with strict grounding rules and honest empty-retrieval behavior. Discipline in the prompt and architecture matters as much as retrieval itself.

Do I need a vector database?

Not always. Small, well-structured corpora often do excellently with lexical retrieval plus query expansion; vectors earn their complexity as scale and ambiguity grow.

Is RAG secure by default?

No. Retrieved content is untrusted input (see prompt injection), and the index defines what can leak. Security comes from what you index and how the model is constrained.

Aira, the consultant on this site, is RAG over aegibit.com itself: it auto-learns every published page weekly and cites sources under its answers.

Ask Aira anything about AEGIBIT

Related concepts