Context
Context is the information available to a model during a generation, including instructions, messages, tool interactions, and reasoning state.
Context is composed of context items:
| Item | Role |
|---|---|
| SystemMessage | Sets the rules the model should follow. |
| DeveloperMessage | Tells the agent how to behave. |
| UserMessage | Contains the user's request or information supplied to the model. |
| FunctionCall | A model-generated request to execute a function with specified arguments. |
| FunctionCallOutput | The result of executing a function, returned to the model. |
| Reasoning | Represents a reasoning model's intermediate reasoning state, which may be exposed as a summary or preserved in encrypted form. |
| ModelMessage | A message generated by the model, such as an answer or clarification. |
Reasoning models spend additional computation generating intermediate reasoning before answering or calling tools, making them useful for complex planning, coding, mathematics, and decisions involving multiple constraints; this can increase latency and token usage. Reasoning-capable APIs can return Reasoning items, while non-reasoning models do not produce these dedicated items; their exact representation depends on the provider.

Context represents working memory, while agent memory provides long-term storage, including episodic memory of past experiences.