glossary

Context and retrieval

Context window

A context window is the token budget a model can attend to on a single call, covering the system prompt, the conversation, tool definitions, retrieved passages and the tokens still reserved for the reply.

Abracadabra Team Glossary

How it works

On a single call the model can attend only to tokens inside the window the provider set for that model. The budget is shared by the system prompt, the turns the harness resends, tool definitions, retrieved passages and the allowance held back for the reply. A booklet and a tool schema are not separate pools. The provider tokenizer decides a rejection, so a count from another library will not match the usage fields on the response.

The window is not a store that survives the call. The next request is empty unless the harness assembles it again. A published maximum looks like spare room until standing instructions and the tool list have already taken a large share, before the person types. Hold back an explicit completion allowance, or the reply stops mid-sentence while the history still looks whole. On a failure, keep the provider prompt and completion counts for that call.

A worked example

A windscreen claim that stops mid-sentence

A motor claims assistant at a UK insurer is asked about a cracked windscreen. The harness puts the whole policy booklet, three emails about a closed theft claim, the garage estimate and the payment tool schema into one call. The usage field shows the prompt has already filled the window. The model writes "The excess is" and stops. The windscreen excess sits on page two. The closed theft and the rest of the booklet spent the budget, so the figure never lands beside the page that states it.

Illustrative example, not a production trace and not a measured result.

What goes wrong

  • The call is rejected because the prompt alone exceeds the window, and the harness retries the same payload, so the person sees a stall rather than an answer.
  • The reply is cut at the length limit, which drops a figure or a condition, and the transcript still looks finished to anyone who does not read the finish reason.
  • Tool definitions and a long system prompt consume the budget before the question arrives, so a short message still overflows on a model the team believed was large enough.

How to measure it

Record the provider usage on each call: prompt tokens, completion tokens, and whether the request was rejected or the reply stopped for length. Split the figures by task, because a claims narrative and a short FAQ do not press the same budget.

When a reply stops early, keep that turn beside the token counts and the finish reason. After the harness sends less text, compare task success for the same task and cohort with the previous period, and read the calls that still end mid-sentence.

Further reading

How Abracadabra helps

Read calls the provider rejected or cut short for length, and sessions where the person repeats a fact after a long tool result. After the payload shrinks, compare task success for that task and cohort.

When context is lost, people restate a fact or repeat the request. Abracadabra pins those corrections and repeated intents to the turn. After a change to what the agent keeps, compare task success for that task and cohort with the previous period.

Request access to read this on your own agent.

See it in your own agent's conversations.

Each task, the step where it stops, and the conversations behind every count. Free during early access.