Long documents get split into chunks, each embedded as a vector. A query is embedded the same way, then retrieval ranks chunks by cosine similarity and keeps only the top-K for the model's limited context window.
sim(q,c) = (q·c) / (‖q‖‖c‖)
context = topK(sim, K) , evict oldest when window is full
- Document chunks — how finely the source text is split before embedding.
- Context window slots — the model's fixed-size working memory; retrieval must fit inside it.
- Top-K per query — how many chunks the retriever pulls in for each query.
- Query rate — how often new queries arrive, competing for window space.
Clusters in the scene represent distinct topics in the document; the beam shows the current query vector reaching for its nearest neighbours, and the ring shows how full the context window is.