Five Context Components

With each LLM call, the context consists of five parts:

  1. System prompt;
  2. Tool definitions;
  3. User messages;
  4. Model responses (reasoning + content + tool_calls);
  5. Tool execution results.

The first two are a static prefix, unchanged throughout the dialogue; the last three are a dynamic trajectory.

Ablation shows the indispensability of each:

  • without tool definitions the agent cannot act;
  • without tool results it loops;
  • without reasoning decisions contradict each other.

Related: Agent Cycle in Code, Chat Template, Context Engineering