agentor
AGENTS.md213 starsChanged 12 months agoApache-2.0View on GitHub
Agentor is an open-source framework for building AI agents with secure integrations across email, calendars, CRMs, and more. It connects LLMs to tools and services, and speaks both the Model Context Protocol (MCP) and Agent-to-Agent (A2A) protocols. Since v0.1.0 it runs on its own agent engine; the openai-agents dependency is gone. See docs/dev/MIGRATION_PLAN.md for why. Key Features: Or using pip: The project uses the following tools for code quality: The project uses pre-commit hooks (configured in .pre-commit-config.yaml): Run the full…
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 0 are common, 14 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 79
Use virtual environments for isolation
- Distinctive: line 88
isort: Import sorting (part of dev dependencies)
- Very specific: line 119
Use type hints where applicable (see src/agentor/type_helper.py for custom types)
- Distinctive: line 120
Keep functions focused and single-purpose
- Distinctive: line 121
Document public APIs with docstrings
- Very specific: line 122
Never use placeholders like # ...
- Distinctive: line 126
Run the full test suite:
- Very specific: line 143
Test files follow the pattern test_*.py
- Distinctive: line 153
Use pytest conventions and fixtures
- Distinctive: line 154
Test files should mirror the source structure
- Distinctive: line 156
Ensure tests are isolated and reproducible
- Distinctive: line 157
Prefer the functional style tests
- Very specific: line 295
Create test file in tests/ directory
- Distinctive: line 296
Follow existing test patterns
- Distinctive: line 297
Run tests locally before committing
- Distinctive: line 298
Ensure coverage for new code paths
- Distinctive: line 302
Make minimal changes: Only modify code directly relevant to the specific request
- Very specific: line 303
No placeholders: Always include complete code, never use # ...
- Distinctive: line 307
Logging: Add console logs when needed to gather more information
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agentor
Project Overview
Agentor is an open-source framework for building AI agents with secure integrations across email, calendars, CRMs, and more. It connects LLMs to tools and services, and speaks both the Model Context Protocol (MCP) and Agent-to-Agent (A2A) protocols.
Since v0.1.0 it runs on its own agent engine; the openai-agents dependency is gone. See docs/dev/MIGRATION_PLAN.md for why.
Key Features:
- An agent loop the project owns end to end, emitting a typed event stream
- Durable runs: the event stream is persisted, so a run resumes after a crash
- Any OpenAI-compatible provider via
base_url, with litellm as the escape hatch - LiteMCP - FastAPI-compatible MCP server with decorator API
- A2A Protocol support for agent interoperability
- Tool registry and extensible tool system
Repository Structure
agentor/
├── src/agentor/ # Main package source code
│ ├── core/ # Agentor, the user-facing agent class
│ ├── engine/ # The agent loop: events, tools, models, store, tracing, mcp
│ ├── mcp/ # LiteMCP server, API router, proxy
│ ├── tools/ # Tool registry and implementations
│ ├── durable/ # Deprecation shim; durability moved into engine/store.py
│ ├── a2a.py # Agent-to-Agent protocol
│ ├── skills.py # Agent Skills loading
│ └── tool_search.py # Tool Search API
├── tests/ # Test suite
├── examples/ # Usage examples
├── docs/dev/ # Design and migration records
├── .github/ # GitHub configuration and workflows
└── pyproject.toml # Project metadata and dependenciesDevelopment Setup
Prerequisites
- Python 3.11 or higher
- pip or uv package manager
Installation
- Clone the repository:
git clone https://github.com/CelestoAI/agentor.git
cd agentor- Install dependencies using uv (recommended):
pip install uv
uv venv
uv syncOr using pip:
pip install -e .- Install development dependencies:
uv sync --group dev
# or with pip:
pip install -e ".[dev]"Environment Setup
- Python version is specified in
.python-version(currently>=3.11) - Use virtual environments for isolation
Code Style and Linting
The project uses the following tools for code quality:
Linting and Formatting
- Ruff: Fast Python linter and formatter (configured in
pyproject.toml) - isort: Import sorting (part of dev dependencies)
- mdformat: Markdown formatting
Pre-commit Hooks
The project uses pre-commit hooks (configured in .pre-commit-config.yaml):
# Install pre-commit hooks
pre-commit install
# Run pre-commit on all files
pre-commit run --all-filesManual Linting
# Run ruff linter
uv run ruff check .
# Run ruff formatter
uv run ruff format .
# Auto-fix issues
uv run ruff check --fix .Code Style Guidelines
- Follow PEP 8 conventions
- Use type hints where applicable (see
src/agentor/type_helper.pyfor custom types) - Keep functions focused and single-purpose
- Document public APIs with docstrings
- Never use placeholders like
# ... rest of code ...- always include complete implementations
Running Tests
Run the full test suite:
uv run pytestWith coverage:
uv run coverage erase
uv run coverage run -m pytest
uv run coverage report -mTest Structure
- Tests are located in the
tests/directory - Test files follow the pattern
test_*.py - Main test files:
test_agents.py- Agent functionality teststest_a2a.py- Agent-to-Agent protocol teststest_memory.py- Memory system teststest_sdk.py- SDK client teststest_text_formatter.py- Text formatting tests
Writing Tests
- Use pytest conventions and fixtures
- Test files should mirror the source structure
- Include unit tests for new features
- Ensure tests are isolated and reproducible
- Prefer the functional style tests
Build and Deployment
Building the Package
# Build distribution packages
uv build
# Install from source
pip install -e .CLI Commands
This package ships no console script and does not depend on the separate
celesto package. Install that package separately if you need its sandbox and
computer-use CLI. celesto deploy and celesto ls were retired with the hosted
platform. Nothing under src/ imports the celesto package.
tests/test_cli.py and tests/perf/test_init_time.py::test_cli_time exercise
that CLI and skip when it is absent.
Serving Agents
from agentor import Agentor
agent = Agentor(name="My Agent", model="gpt-5-nano")
agent.serve(port=8000) # Serves with A2A protocol enabledArchitecture and Key Components
1. The Agent Loop
Location: src/agentor/engine/loop.py
AgentLoop is the whole engine: call the model, run the tools it asked for, feed
the results back, repeat until it stops asking. Everything it does is emitted as
a typed event (engine/events.py) rather than logged, which is what makes
durability and tracing projections of one stream rather than separate features.
Bounded by max_turns and by max_tool_failures - a tool that keeps raising is
disabled rather than allowed to consume every turn. That budget is enforced at
execution, not just by withdrawing the schema, because a model will happily go on
calling a tool it can no longer see.
2. Models
Location: src/agentor/engine/models.py
One shape reaches almost every provider: an OpenAI-compatible
/chat/completions endpoint behind base_url. LiteLLMModel is the escape
hatch for providers that offer nothing compatible.
3. Durable Runs
Location: src/agentor/engine/store.py
An append-only event log, fsynced per event, with replay_messages to rebuild
the conversation. FileStore survives process death; MemoryStore is for tests.
Concurrent resume of one unfinished run is not safe - the bundled stores carry no
lease.
fork_run copies a log to a new id (full trace, reasoning included, plus a
fork marker naming the parent); Agentor.fork / AgentLoop.afork build on it
to branch a conversation - even a completed one, which resume refuses to
re-execute - into an independent run.
4. Tracing
Location: src/agentor/engine/tracing.py
A projection of the event stream onto Celesto's trace format. Opt-in: pass
enable_tracing=True, or tracing= on a single run. Holding CELESTO_API_KEY
is not consent to ship prompts and tool results to a remote endpoint.
The model's reasoning text, when a provider returns it, is persisted in run
logs, carried on generation events, and included in generation spans - it is
never streamed as text_delta chunks, only delivered whole. Treat run logs
and traces as holding everything the model produced, not just what the caller
saw.
5. Model Context Protocol (MCP)
Location: src/agentor/mcp/api_router.py, src/agentor/mcp/server.py, src/agentor/engine/mcp.py
- LiteMCP: native ASGI MCP server with FastAPI-like decorators
- Tool and resource registration, JSON-RPC, built-in CORS
- Client side (
engine/mcp.py) runs on the officialmcppackage
6. Agent-to-Agent (A2A) Protocol
Location: src/agentor/a2a.py
- Standard agent communication specifications
- Automatic agent card generation at
/.well-known/agent-card.json - JSON-RPC-based messaging
- Support for streaming and non-streaming responses
7. Tool Registry
Location: src/agentor/tools/registry.py
- Extensible tool registration system
- Function decorators for tool creation
Common Development Workflows
Adding a New Tool
from agentor import function_tool
@function_tool
def my_tool(param: str) -> str:
"""Tool description for LLM"""
return f"Result: {param}"Creating a New Agent
from agentor import Agentor
agent = Agentor(
name="My Agent",
model="gpt-5-nano",
tools=[my_tool],
instructions="Agent behavior instructions",
)Adding Tests
- Create test file in
tests/directory - Follow existing test patterns
- Run tests locally before committing
- Ensure coverage for new code paths
Development Guidelines
- Make minimal changes: Only modify code directly relevant to the specific request
- No placeholders: Always include complete code, never use
# ... rest of processing ... - Incremental approach: Break problems into smaller steps, think through each separately
- Evidence-based: Provide complete PLAN with REASONING based on evidence from code and logs
- Clear observations: Explain OBSERVATIONS clearly, then provide REASONING to identify issues
- Logging: Add console logs when needed to gather more information
CI/CD
GitHub Actions Workflows
- test.yml: Runs pytest across multiple OS and Python versions (3.11-3.13)
- release.yml: Handles package releases to PyPI
There is no docs workflow. User-facing documentation is published from the
separate mintlify-docs repository to https://docs.celesto.ai/agentor.
CI Test Matrix
- Operating Systems: Ubuntu, macOS, Windows
- Python Versions: 3.11, 3.12, 3.13
Additional Resources
- Documentation: https://docs.celesto.ai/agentor
- Examples: the
examples/directory - Discord Community: https://discord.gg/KNb5UkrAmm
Core Business Value
The system delivers value through:
- An owned agent loop, so behaviour and observability are not gated on a vendor SDK
- Durable runs that survive process death
- Secure Google Workspace integration
- Extensible tool registration and execution
- Standard protocol support (MCP, A2A) for interoperability
<!--
This file is the single source of contributor guidance.
.github/copilot-instructions.md points here rather than duplicating it: the
two were kept "in sync" by hand, drifted anyway, and both went on describing
subsystems (agenthub/, memory/) that had been deleted.
-->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

