Agent State
The agent exposes its state viaagent.state:
State Mutations
System Prompt
Model Selection
Thinking Level
Tools
Thinking Budgets
Configure token budgets for thinking levels:Message Management
Adding Messages
Accessing Messages
Message Queues
The agent supports two types of queued messages:Steering Messages
Steering messages interrupt the agent while tools are running:- Remaining tools are skipped with error results
- Steering messages are injected
- LLM responds to the interruption
Follow-up Messages
Follow-up messages queue work after the agent would otherwise stop:- There are no more tool calls
- No steering messages are queued
Delivery Modes
- one-at-a-time
- all
Deliver one message, wait for response, then deliver the next.
Clearing Queues
Custom Message Types
ExtendAgentMessage for app-specific types:
convertToLlm:
Context Transformation
Transform the context before sending to the LLM:Reset and Control
Next Steps
Agent Overview
Core agent concepts
Transport
Custom backends and proxies
API Reference
Complete Agent API