Agent Context Explained

Agent Context Explained

What goes into the window, and how an agent remembers beyond it.

An interactive guide to what goes into an agent's context window, retrieval and memory, with every number measured on a real corpus.

BM250.985 @50.785 @1Dense0.950 @50.705 @1RRF0.980 @50.810 @1RRF + rerank0.995 @50.890 @1
Recall at 1 and at 5 for each stage, over all 200 questions (recursive 256-token chunks). Computed by the engine at build time.

How this is checkedEvery retrieval number is measured on 200 SQuAD questions with real MiniLM embeddings and recorded reranker scores, and the TypeScript engine in your browser reproduces the Python reference exactly, with no tolerance. How it is tested →

What you'll learn

A model knows only what is in its context window. Context engineering decides what goes in: which chunks of which documents, found how, cut where, packed in what order, what to drop or summarise when the window fills, and what to remember between sessions. Every claim here is measured, not asserted: on 6 articles of SQuAD and 200 of their questions, each with its answer's exact place in the text, so a retriever either finds the chunk that holds the answer or does not.

The animations are driven by Agent_Loop_Sim's context module. A small embedding model and a cross-encoder ran once, offline; their outputs ship with the site (int8 vectors and recorded scores), and the engine recomputes every chunk boundary, score, ranking and metric from them, identically in Python and in your browser. On this corpus BM25 finds the answer's chunk first 79% of the time, dense retrieval 71%, the two fused 81%, and fused then reranked 89%. No language model runs anywhere.

Part of a family of sixteen companion sites in four tracks, all in the site menu above: Foundations (Decoder, Training), Hardware (Kernels, Systolic, Accelerators, Racks), Inference (Serving, Architectures, Numerics, Trade-offs) and Agents (Harnesses, Protocols, Context, Orchestration, Evals, Security). It is the third of the six agent sites. How this one was built, and how to check it: about.