Context window
What fits inside a context window
A bounded window contains a system prompt, tool declarations, and conversation messages. An example conversation contains a user request, an assistant tool call, and the returned tool result. A downward arrow shows new messages and tool results being appended to the bottom of the conversation as the agent works. The remaining space is available for the model's next response, which also counts toward the token limit. This is a schematic arrangement. The sizes and ordering of the contents vary between programs and over the course of a task.
System prompt
Tool declarations
Conversation
User request
Assistant tool call
Tool result
Room for response
Append