RAG Pipeline Simulator
A real (if simplified) retrieval pipeline from RAG, running in your browser: real fixed-size chunking, real bag-of-words cosine-similarity ranking, and a real reranking pass — not a scripted animation.
Interactive
RAG Pipeline Simulator
Chunk size
Reranker
24 chunks indexed · showing top 3
#139.7% match
Gradient descent updates parameters by stepping in the direction opposite the gradient of the loss function.
#233.3% match
The learning rate controls step size: too large causes divergence or oscillation, too small makes training
#313.4% match
by setting the gradient of the loss to zero.
Real chunking, real bag-of-words cosine-similarity retrieval, and a real (if simplified) reranking pass -- type any question about the topics covered in the demo corpus and watch retrieval actually respond.
What to Try
- Ask about each topic in the demo corpus — linear regression, gradient descent, overfitting, decision trees, CNNs, attention, the KV cache, and RAG itself — and watch different chunks surface each time.
- Shrink the chunk size to 8 words and watch retrieval get noisier — smaller chunks carry less context, so cosine similarity has less signal to work with, directly the "too small loses context" tradeoff.
- Toggle the reranker off and compare the ranking — the reranker here specifically rewards exact multi-word phrase overlap the bag-of-words retrieval score alone doesn't capture, a small-scale stand-in for why a real cross-encoder reranker improves precision over the fast first-pass retrieval.
- Click any node in the diagram for a one-line explanation of what that stage does.
- Try a question that doesn't match the corpus well ("what's the capital of France?") and watch every match score drop — real evidence that retrieval quality depends entirely on whether the answer's content actually exists in the indexed corpus, not on how the question is phrased.
Back to Visual Lab Overview.