A ready-to-run example is available here!
AgentSettings gives you a structured, serializable way to define an agent’s model, tools, and optional subsystems like the condenser. Use it when you want to store agent configuration in JSON, send it over an API, or rebuild agents from validated settings later.
Why Use AgentSettings
- Keep agent configuration as data instead of wiring everything together imperatively.
- Validate settings with Pydantic before creating an agent.
- Serialize and deserialize settings for storage, transport, or UI-driven configuration.
- Create different agent variants by changing only the settings payload.
Build Settings
Create anAgentSettings object with the same ingredients you would normally pass to an Agent.
Serialize and Restore Settings
BecauseAgentSettings is a Pydantic model, you can dump it to JSON-compatible data and restore it later.
- Saving agent configuration in a database
- Sending settings through an API
- Letting users edit agent configuration in a form-based UI
- Rehydrating the same agent setup in another process
Create an Agent from Settings
Once validated, create a working agent directly from the settings object.Conversation, or derive another agent by changing the settings payload. For example, the full example below also shows how removing FileEditorTool and disabling the condenser produces a different agent configuration without rewriting the rest of the setup.
Ready-to-run Example
This example is available on GitHub: examples/01_standalone_sdk/46_agent_settings.py
examples/01_standalone_sdk/46_agent_settings.py
The model name should follow the LiteLLM convention:
provider/model_name (e.g., anthropic/claude-sonnet-4-5-20250929, openai/gpt-4o).
The LLM_API_KEY should be the API key for your chosen provider.Next Steps
- Getting Started - Start from a minimal agent and conversation setup
- Context Condenser - Control conversation compaction behavior
- Agent Delegation - Compose specialized agents for larger tasks

