exagent¶
A lightweight Python library for building LLM agents.
exagent gives you the minimum building blocks to create agents that call tools, chain steps, and stream output — without pulling in a large framework.
from exagent import Agent, tool
@tool
def get_weather(city: str) -> str:
"""Return the current weather for a city."""
return f"{city}: 22°C, sunny"
class WeatherAgent(Agent):
def __init__(self):
self.system_description = "You are a helpful weather assistant."
self.set_model("openai", "gpt-4.1-mini")
self.add_tool(get_weather)
super().__init__()
agent = WeatherAgent()
print(agent.run("What's the weather in Tokyo?"))
Why exagent?¶
Most agent frameworks are large. exagent is not. It is a small, focused library that does one thing well: run an LLM agent loop with tool calling.
| exagent | |
|---|---|
| Lines of core code | < 500 |
| Dependencies | Only the provider SDK you choose |
| Providers | OpenAI, Anthropic |
| Python | 3.10+ |
What it includes¶
@tooldecorator — turn any function into a tool the model can call- Agent loop — automatic multi-step tool chaining until the model is done
- Streaming — live token output and tool events via
agent.stream() - Observability hooks — inspect every tool call and model turn
- Skills — markdown files that shape agent behaviour
- Orchestrator — route tasks across multiple specialist agents
- Interactive shell — chat with any agent straight from the terminal
Next steps¶
| Install | Get exagent installed in under a minute. Installation → |
| Quick Start | Build your first agent in five minutes. Quick Start → |
| Tools | Learn how to define tools the model can call. Defining Tools → |
| Orchestrator | Route tasks across multiple specialist agents. Orchestrator → |