Lab · RAG Simulator

See how AI answers from your documents.

Retrieval-augmented generation (RAG) is how AI assistants answer from company knowledge instead of guessing. Ask a question about a sample employee handbook and watch every step happen.

1Chunk the knowledge base

Documents are split into small passages so the most relevant pieces can be found. Highlighted chunks are the ones retrieved.

2Retrieve by similarity

Your question is compared to every chunk. Real systems use embeddings; this demo uses a simplified word-weighting score.

Run a question to see the top matches.

3Augment the prompt

Only the retrieved chunks are placed in the prompt, with instructions to stay grounded.

The assembled prompt appears here.

4Generate a grounded answer

The model answers from the retrieved text and cites it. (This demo extracts the best-matching sentence.)

Ask something to see a cited answer. Try the stock price question to see a refusal.
What you’ll learn

Why RAG matters.

Fresh

Always up to date

Update the documents and answers change instantly, with no retraining.

Grounded

Fewer hallucinations

The model answers from real sources and can cite them.

Honest

Knows its limits

No good match? A well-built system says so instead of guessing.

Private

Your data, your rules

Retrieval respects which documents each user is allowed to see.