Agent A2As is a high-performance, modular, and extensible AI agentic framework designed for complex, autonomous task execution. Built upon a robust hook-based architecture, it allows for seamless integration of specialized agents, custom tools, and experimental AI behaviors.
- 🤖 Multi-Agent Orchestration: Hierarchical superior/subordinate delegation models for complex problem-solving.
- 🧩 Deep Extensibility: A unique
@extensiblehook system that allows for non-invasive logic injection at runtime. - 🛠 MCP Support: Full integration with the Model Context Protocol (MCP) for nearly infinite capability expansion.
- 🌐 Robust Web UI: A specialized interactive dashboard with real-time reasoning and response streaming.
- 🕒 Task Scheduler: Built-in cron-like system for automating background agent tasks.
- 🚇 Secure Tunneling: Integrated support for exposing local agent APIs via secure tunnels (Cloudflare, etc).
- 📦 Self-Updating: Keep your framework, tools, and agents fresh with automated update paths.
- 📚 Localized Assets: Zero reliance on external CDNs; optimized for performance via mirrored vendor assets.
Agent A2As comes equipped with a suite of sophisticated tools enabling it to interact with the physical and digital world:
- 🔍 Document Intelligence: Query and analyze complex documents with the
document_querytool. - 🌐 Full-Featured Browser: Navigate the web, interact with pages, and extract data using integrated browser tools.
- 🖼️ Vision Capabilities: Process and understand visual information with
vision_load. - 🤝 Subordinate Delegation: Scalable task management via
call_subordinate, allowing agents to spawn specialists. - 📡 Agent-to-Agent (A2A): Collaborative multi-agent communication via the
a2a_chatprotocol. - 🗓️ Background Scheduler: Defer and automate actions over time with the
scheduler.
Agent A2As follows a multi-layered architecture where logic is decoupled from the user interface and the underlying language models.
graph TD
UI[Web UI / API Clients] <--> API[Modular API Backend]
API <--> AC[AgentContext]
subgraph Core Engine
AC --> A0[Agent 0 - Primary Orchestrator]
A0 --> ML[Monologue Loop]
ML --> P[Prompt Builder]
ML --> LLM[Chat / Utility Models]
ML --> T[Tool Execution Engine]
T --> TS[Tools / Skills / MCP]
end
subgraph Extensibility Layer
E[Extension Hooks] -.-> ML
E -.-> P
E -.-> T
E -.-> A0
end
subgraph Multi-Agent Layer
A0 <--> SA[Subordinate Agents]
SA --> R[Researcher]
SA --> D[Developer]
SA --> H[Hacker]
end
The AgentContext is the lifecycle manager for a session. It maintains the state of the conversation, handles background tasks, and manages the primary agent (Agent0).
- Context Management: Multi-context support allows running several independent tasks simultaneously.
- Process Chains: Handles the hierarchical delegation between "Superior" and "Subordinate" agents.
The Agent class is the "brain" that executes the Monologue Loop. It transforms user intentions into actions.
- Thought Process: Implements reasoning and planning before taking actions.
- History Management: Sophisticated tracking of conversation history, tool results, and system instructions.
- Prompt Engineering: Dynamic prompt generation that incorporates real-time context and "extras."
The framework is built around Implicit Extension Points. Using the @extensible decorator, almost any function in the system can be hooked into (start/end) without modifying the source code.
- Plugin-like System: Add new features by placing Python scripts in specialized folders.
- Customizable Pipelines: Modify prompts, filter outputs, or intercept tool calls on the fly.
When a user sends a message, Agent A2As enters a recursive execution cycle known as the Monologue Loop:
- Ingestion: User input is wrapped in a
UserMessageand passed toAgentContext.communicate(). - Initialization: The
monologueloop begins. Extension hooks likemessage_loop_startare triggered. - Prompt Building:
- The system identifies the current agent's personality and configuration.
- It compiles the system prompt, conversation history, and any transient "extras" (temporary context).
- Tokens are calculated to ensure context window limits are respected.
- LLM Call:
- The LLM is invoked with the compiled prompt.
- Reasoning: If supported, the agent's internal reasoning is streamed separately.
- Response: The agent's final output or tool request is streamed.
- Tool Execution:
- The framework parses the response for tool calls (typicA2A JSON).
- It validates the tool request against available skills/tools/MCP servers.
- The tool is executed (e.g., running code, searching the web, modifying files).
- Resolution:
- Tool output is formatted and added back to the history.
- If the agent has fulfilled the task, it provides a final response to the user.
- If more work is needed, the loop repeats from Step 3.
- Final Delivery: The final response is delivered to the UI, and the context waits for the next user input.
/agents: Specialized agent profiles (Developer, Researcher, Hacker)./api: ASGI backend handlers for real-time interaction./extensions: Backend logic hooks for lifecycle events./skills: Modular Python skillsets for high-level capabilities./tools: System-level integration drivers./webui: Optimized frontend dashboard and component system.agent.py: Principal framework orchestrator and monologue implementation.run_ui.py: Primary server entry point.
- Installation:
pip install -r requirements.txt
- Environment Setup:
Copy
.env.exampleto.envand configure your API keys (OpenAI, Anthropic, etc.). - Run the UI:
python run_ui.py
- Access: Open
http://localhost:portin your browser.
Generated by Agent A2As - Powering the next generation of autonomous intelligence.