Setting a System Prompt
You can customize your agent’s behavior by providing asystem_prompt or instructions parameter. The system_prompt gives you full control over the system message sent to the model, while instructions provides high-level guidance that gets incorporated into the agent’s default prompt.
Using instructions (Recommended for most cases)
Theinstructions parameter is the simplest way to guide your agent’s behavior:
Using system_prompt (Full control)
For complete control over the system message, usesystem_prompt:
Combining with Agent Identity
You can also define your agent’s identity usingrole, goal, and other attributes:
Run your Agent
When running your agent, use theAgent.print_do() method to print the response in the terminal. This is only for development purposes and not recommended for production use. In production, use the Agent.do() or Agent.do_async() methods. For example:
- How do I run my agent? -> See the running agents documentation.
- How do I manage sessions? -> See the memory documentation.
- How do I manage input and capture output? -> See the running agents documentation.
- How do I add tools? -> See the tools documentation.
- How do I give the agent context? -> See the agent attributes documentation.
- How do I add knowledge? -> See the knowledge base documentation.
- How do I handle images, audio, video, and files? -> See the OCR documentation.
- How do I add guardrails? -> See the safety engine documentation.
- How do I cache model responses during development? -> See the task attributes documentation for cache configuration.
Developer Resources
- View the Agent reference
- View the Agent overview

