Context window
Only selected chunks cross this boundary.
Turn the black box inside out. Edit the corpus, inspect token vectors and cosine scores, then watch the exact context cross the model boundary.
RAG does not let a model search by instinct. Documents become chunks. Chunks become vectors. A query becomes another vector. Similarity decides which evidence survives the context budget. The lab below exposes every one of those transitions.
This educational vectorizer uses term frequency and cosine similarity in your browser. It is deliberately small enough to audit line by line.
Only selected chunks cross this boundary.
Scroll the trace from source text to the final handoff.
The local vectorizer lowercases text, removes punctuation, filters common stop words, and counts each remaining term. The shared vocabulary becomes the coordinate system.
Cosine similarity compares vector direction. A focused short chunk can outrank a long chunk because the score is normalized by each vector's magnitude.
Increasing k adds evidence but also noise and token cost. The ranked list shows what was included and what was left behind.
The lab exports the exact context and query that a model could receive. It stops there so the observed result remains truthful without an integrated model service.
Export the corpus, tokens, vectors, rankings, selected evidence, and assembled prompt as durable JSON.