Archon is an AI meta-agent designed to autonomously build, refine, and optimize other AI agents.
It serves both as a practical tool for developers and as an educational framework demonstrating the evolution of agentic systems. Archon will be developed in iterations, starting with just a simple Pydantic AI agent that can build other Pydantic AI agents, all the way to a full agentic workflow using LangGraph that can build other AI agents with any framework. Through its iterative development, Archon showcases the power of planning, feedback loops, and domain-specific knowledge in creating robust AI agents.
The current version of Archon is V3 as mentioned above - see V3 Documentation for details.
Archon demonstrates three key principles in modern AI development:
- Agentic Reasoning: Planning, iterative feedback, and self-evaluation overcome the limitations of purely reactive systems
- Domain Knowledge Integration: Seamless embedding of frameworks like Pydantic AI and LangGraph within autonomous workflows
- Scalable Architecture: Modular design supporting maintainability, cost optimization, and ethical AI practices
- Basic RAG-powered agent using Pydantic AI
- Supabase vector database for documentation storage
- Simple code generation without validation
- Learn more about V1
- Multi-agent system with planning and execution separation
- Reasoning LLM (O3-mini/R1) for architecture planning
- LangGraph for workflow orchestration
- Support for local LLMs via Ollama
- Learn more about V2
- Integration with AI IDEs like Windsurf and Cursor
- Automated file creation and dependency management
- FastAPI service for agent generation
- Improved project structure and organization
- Learn more about V3
- V4: Self-Feedback Loop - Automated validation and error correction
- V5: Tool Library Integration - Pre-built external tool incorporation
- V6: Multi-Framework Support - Framework-agnostic agent generation
- V7: Autonomous Framework Learning - Self-updating framework adapters
- Docker
- LangSmith
- Other frameworks besides Pydantic AI
- Other vector databases besides Supabase
- Alternative embedding models besides OpenAI
Since V3 is the current version of Archon, all the code for V3 is in both the archon
and archon/iterations/v3-mcp-support
directories.
- Python 3.11+
- Supabase account and database
- OpenAI/OpenRouter API key or Ollama for local LLMs
- Streamlit (for web interface)
- Windsurf, Cursor, or another MCP-compatible AI IDE (optional)
There are two ways to install Archon V3:
- Clone the repository:
git clone https://github.com/coleam00/archon.git
cd archon
- Install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
-
Clone the repository as above
-
Run the MCP setup script:
python setup_mcp.py
For running the crawler and graph service later, activate the virtual environment too:
source venv/bin/activate # On Windows: venv\Scripts\activate
This will:
- Create a virtual environment if it doesn't exist
- Install dependencies from requirements.txt
- Generate an MCP configuration file
- Configure your AI IDE:
- In Windsurf:
- Click on the hammer icon above the chat input
- Click on "Configure"
- Paste the JSON that
setup_mcp.py
gave you as the MCP config - Click "Refresh" next to "Configure"
- In Cursor:
- Go to Cursor Settings > Features > MCP
- Click on "+ Add New MCP Server"
- Name: Archon
- Type: command (equivalent to stdio)
- Command: Paste the command that
setup_mcp.py
gave for Cursor
- In Windsurf:
- Configure environment:
- Rename
.env.example
to.env
- Edit
.env
with your settings:
BASE_URL=https://api.openai.com/v1 for OpenAI, https://api.openrouter.ai/v1 for OpenRouter, or your Ollama URL LLM_API_KEY=your_openai_or_openrouter_api_key OPENAI_API_KEY=your_openai_api_key # Required for embeddings SUPABASE_URL=your_supabase_url SUPABASE_SERVICE_KEY=your_supabase_service_key PRIMARY_MODEL=gpt-4o-mini # Main agent model REASONER_MODEL=o3-mini # Planning model
- Rename
-
Set up the database:
- Execute
utils/site_pages.sql
in your Supabase SQL Editor - This creates tables and enables vector similarity search
- Execute
-
Crawl documentation:
python archon/crawl_pydantic_ai_docs.py
- Run Archon either as an MCP Server or with Streamlit:
- After crawling the documentation, start the graph service:
python graph_service.py
Archon runs as a separate API endpoint for MCP instead of directly in the MCP server because that way Archon can be updated separately without having to restart the MCP server, and the communication protocols for MCP seemed to interfere with LLM calls when done directly within the MCP server.
- Restart the MCP server in your AI IDE
- You can now ask your AI IDE to create agents with Archon
- Be sure to specify when you want to use Archon - not necessary but it helps a lot
For an interactive web interface:
streamlit run streamlit_ui.py
The interface will be available at http://localhost:8501
mcp_server.py
: MCP server script for AI IDE integrationgraph_service.py
: FastAPI service that handles the agentic workflowsetup_mcp.py
: MCP setup scriptstreamlit_ui.py
: Web interface with streaming supportrequirements.txt
: Project dependencies
archon/
: Core agent and workflow implementationarchon_graph.py
: LangGraph workflow definition and agent coordinationpydantic_ai_coder.py
: Main coding agent with RAG capabilitiescrawl_pydantic_ai_docs.py
: Documentation crawler and processor
utils/
: Utility functions and database setuputils.py
: Shared utility functionssite_pages.sql
: Database setup commands
CREATE TABLE site_pages (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
url TEXT,
chunk_number INTEGER,
title TEXT,
summary TEXT,
content TEXT,
metadata JSONB,
embedding VECTOR(1536)
);
We welcome contributions! Whether you're fixing bugs, adding features, or improving documentation, please feel free to submit a Pull Request.
For version-specific details: