Skip to main content

Home AI Compass Builder

RAG (retrieval-augmented generation)

Letting a model answer from your documents — first find the relevant passages, then answer based on them.

Builder path · 1 of 6

What it is

RAG combines search with generation. The system retrieves passages relevant to the question — usually through embeddings and a vector database — and gives them to the model together with the question, so the answer is grounded in your sources and can cite them.

Example

An employee asks about the travel policy; the assistant answers from the current policy document and links to the paragraph.

What can go wrong

Retrieval can expose documents the user shouldn't see, and a poisoned document can carry instructions into the model (indirect prompt injection).

How to secure it

Enforce access rights when retrieving, not only in the interface; keep track of where every passage came from; test with planted malicious documents.

Related

Related service: Applied AI