All demos

RAG Explorer

Give a language model evidence to work with

Retrieval-augmented generation (RAG) searches a collection for relevant text and puts that evidence into the model's context. The model weights stay the same. Can better evidence produce a better answer?

Try this
  1. Explore the fictional university's documents and choose a question.
  2. Retrieve relevant documents and inspect the selection.
  3. Compare answers, then change the evidence and try again.

1. Explore The Collection

These short documents describe the fictional Juniper University. Each document is already a single chunk of text.

2. Find Relevant Documents

MiniLM sentence embeddings

The question and documents become vectors. Cosine similarity ranks their directions; a high score does not guarantee that a document answers the question.

IncludeDocumentSimilarityText
Retrieve to inspect the ranked documents.

3. Generate And Compare

FLAN-T5 Base
Retrieve documents first.

Question Only

The model receives only your question.

Question + Selected Context

The same model also receives the selected documents.

Exact prompt with retrieved context
Retrieve documents to assemble the context.

Instructions ask the model to use the evidence, but do not guarantee that it will. Check whether each answer is supported by the documents. No training occurs here.