Skip to main content

Overview

Agentor agents are built on top of the Agent class from the agents library, providing a high-level abstraction for creating production-ready AI agents with tools, skills, and external integrations.

Agent Class

The core Agentor class (src/agentor/core/agent.py:138) provides the primary interface for building agents:

Constructor Parameters

name
str
required
Agent name used in logs, traces, and A2A protocol agent cards
instructions
str
System prompt defining agent behavior and personality
model
str | LitellmModel
default:"gpt-5-nano"
Model identifier. Supports any LiteLLM provider format:
  • "gpt-5-mini" - OpenAI models
  • "gemini/gemini-2.5-pro" - Google models
  • "anthropic/claude-3.5" - Anthropic models
tools
List[FunctionTool | str | MCPServerStreamableHttp | BaseTool]
Tools available to the agent. Can be:
  • String names from the tool registry (e.g., "get_weather")
  • FunctionTool instances decorated with @function_tool
  • BaseTool subclasses with @capability methods
  • MCP server connections
output_type
type[Any] | AgentOutputSchemaBase
Pydantic model for structured output validation
model_settings
ModelSettings
Model configuration including temperature, top_p, max_tokens
skills
List[str]
Paths to skill directories (see Skills)
enable_tracing
bool
default:false
Enable Celesto AI tracing and observability
api_key
str
API key for the LLM provider

Creating Agents from Markdown

Agents can be defined in markdown files with YAML frontmatter (src/agentor/core/agent.py:236):
Load the agent:

Agent Lifecycle

Synchronous Execution

The run() method (src/agentor/core/agent.py:367) provides synchronous execution:

Asynchronous Execution

The arun() method (src/agentor/core/agent.py:370) supports async execution with batch processing:

Fallback Models

Handle rate limits gracefully with fallback models (src/agentor/core/agent.py:415):
If the primary model fails with rate limit or API errors, Agentor automatically retries with fallback models in order.

Streaming Responses

Stream agent responses in real-time (src/agentor/core/agent.py:487):
The stream_chat() method (src/agentor/core/agent.py:498) returns an async iterator of AgentOutput objects:

Model Configuration

Configure model behavior with ModelSettings (src/agentor/core/agent.py:211):

Multi-Agent Systems

Agentor supports hierarchical multi-agent orchestration. The framework includes specialized agents:
  • Concept Research Agent - Topic research and information gathering
  • Coder Agent - Code-related operations
  • Google Agent - Workspace integration
  • Main Triage Agent - Request routing and delegation
See src/agentor/agenthub/main.py for the orchestration implementation.

Agent Context

Agents receive a RunContextWrapper with configuration (src/agentor/tools/registry.py:33):

Tracing and Observability

Enable automatic tracing with Celesto AI (src/agentor/core/agent.py:119):
Traces are automatically sent to https://celesto.ai/observe. To disable auto-tracing:

Next Steps

Tools

Learn how to add tools to your agents

Skills

Add specialized skills to improve agent performance

Deployment

Deploy your agent to production

A2A Protocol

Enable agent-to-agent communication
Last modified on May 5, 2026