Generate agents that belongs to your company.The Agent class is the core agent implementation in Upsonic, providing a powerful and flexible interface for creating AI agents with advanced capabilities including memory management, safety policies, reliability layers, and sophisticated tool integration.
The Agent can be created with minimal configuration or with extensive customization to suit your specific needs. The agent provides a robust foundation for AI-powered applications with built-in support for various advanced features.
from upsonic import Agent, Task# Create an agentagent = Agent("anthropic/claude-sonnet-4-5")# Execute with Task objecttask = Task("What is 2 + 2?")agent.print_do(task)# agent.do(task)# Or execute directly with a string (auto-converted to Task)agent.print_do("What is 2 + 2?")# agent.do("What is 2 + 2?")
When creating an agent without specifying a model, it defaults to "openai/gpt-4o". Make sure you have the appropriate API key set in your environment.