Skip to content
Learn/

Retrieval-Augmented Generation

1 / 7

The model is not your source of truth

A model's parameters contain broad learned patterns, but they are a poor place for product facts that change tomorrow, private documents, or evidence a user must be able to inspect. Retrieval-augmented generation (RAG) adds a non-parametric memory: an external corpus searched at request time.

There are two paths. The ingestion path loads documents, splits them into chunks, computes embeddings, and writes those vectors plus source metadata to an index. The query path embeds the user's question, retrieves nearby chunks, optionally reranks them, and places the winners into the model prompt.

RAG does not guarantee truth. It makes relevant evidence available. The model can still ignore it, the retriever can miss it, the source can be stale, and an untrusted document can contain instructions. Retrieval quality and generation quality must be evaluated separately.

INGESTION (offline / asynchronous)
documents → parse → chunk → embed → vector index

QUERY (latency-sensitive)
question → embed → retrieve top-k → rerank → prompt → model
                           │
                           └──────── citations / source ids
Traffic
100req/s
p50
3.4s
p99
6.29s
Errors
0.09%
Availability
99.91%
Cost
$4.16M/mo