Prerequisites
Before starting, make sure you have:- Python 3.11 or higher installed
- An API key for an LLM provider (OpenAI, Anthropic, or Google)
Installation
1
Install Agentor
2
Set up your API key
Set your LLM provider API key as an environment variable:
Build your first agent
Create a simple weather agent that can answer questions about the weather:The
get_weather tool is a built-in tool that uses the WeatherAPI.com service. You’ll need to set the WEATHER_API_KEY environment variable to use it.Run with streaming
See agent responses in real-time with streaming:Add custom instructions
Guide your agent’s behavior with custom instructions:Use multiple tools
Combine multiple tools to create more capable agents:Serve as an API
Turn your agent into a REST API with a single line:POST /chat- Send messages to the agentGET /.well-known/agent-card.json- A2A protocol agent card
Query the API
Use curl to interact with your agent API:Deploy to production
Deploy your agent to Celesto AI’s serverless platform:1
Install the Celesto CLI
The CLI is included with Agentor:
2
Create your agent file
Save your agent code to a Python file (e.g.,
agent.py):3
Serve it
serve() runs an ordinary ASGI app under uvicorn, so host it the way you
host any other Python service - a container, a process manager, or a
serverless runtime. See Serve agents as an API.Use different LLM providers
Swap the model string, or pointbase_url at any OpenAI-compatible endpoint:
Get typed output
Ask for a shape instead of prose and you get a validated Python object back:Survive a crash
Give the agent a store and every step is written to disk. A different process can finish the job from the run id alone:Branch a run
Fork any persisted run into a new, independent one — even a finished one, whichresume() won’t re-run. The original is never touched:
resume().
Configure model parameters
Fine-tune model behavior withModelSettings:
Next steps
Now that you’ve built your first agent, explore more advanced features:Building agents
Learn advanced agent patterns and best practices
Custom tools
Create custom tools for your agents
Durable runs
Save runs, resume them after a crash, or fork them into new ones
Structured output
Return validated objects instead of free text
MCP servers
Build MCP servers with LiteMCP
Agent communication
Enable agent-to-agent communication with A2A protocol
