MV

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:

ItemRole
SystemMessageSets the rules the model should follow.
DeveloperMessageTells the agent how to behave.
UserMessageContains the user's request or information supplied to the model.
FunctionCallA model-generated request to execute a function with specified arguments.
FunctionCallOutputThe result of executing a function, returned to the model.
ReasoningRepresents a reasoning model's intermediate reasoning state, which may be exposed as a summary or preserved in encrypted form.
ModelMessageA 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.

Diagram of LLM context: system message, developer message, user message, function call, function call output, reasoning, and model message, grouped into developer-provided and model-generated items.

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

Back to the glossary