Base Agent Architecture
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Base Agent Architecture serves as the foundational framework for building and orchestrating intelligent agents within the WIREDUP system. It provides a standardized structure for dependency injection, state management, and capability discovery, enabling developers to create specialized agents—such as Research, Execution, or Coordination agents—that seamlessly integrate with the broader ecosystem.
The architecture is built around the BaseAgent abstract class, which handles common concerns like logging, configuration management, and skill registration. By leveraging the Auto-Wiring Engine, agents can automatically resolve dependencies such as MCP protocols, SSH managers, and configuration loaders, reducing boilerplate and ensuring consistent behavior across the multi-agent system.
Sources: src/agents/base_agent.py:1-68, AGENT.md:1-40, README.md:18-35
Core Components
The agent system is organized into a hierarchical structure where the BaseAgent interface interacts with specialized registries and managers.
Component Overview
| Component | Description |
|---|---|
| BaseAgent | The abstract base class providing core lifecycle and utility methods for all agents. |
| AgentContext | A dataclass containing session-specific data, metadata, and state for a single execution. |
| SkillRegistry | A dynamic system for managing and discovering agent capabilities. |
| AutoWire Engine | The dependency injection core that resolves agent requirements at runtime. |
| MCPProtocol | Standardized communication layer for agent-to-system and agent-to-agent interactions. |
Sources: src/agents/base_agent.py:18-68, AGENT.md:42-55, config/default.json:44-53
Class Relationship Diagram
The following diagram illustrates the relationship between the core agent classes and the support systems.
Execution Logic and Data Flow
Agent execution follows a structured pipeline where a task is received, processed within a specific context, and augmented by available skills.
Task Execution Flow
When an agent's execute method is invoked, it typically follows this sequence:
- Context Initialization: An
AgentContextis created or passed, containing session IDs and metadata. - Skill Resolution: The agent checks its internal
_skillsdictionary or the globalSkillRegistryfor required capabilities. - Dependency Usage: The agent utilizes auto-wired services (e.g., SSH, MCP) to perform the task.
- Result Packaging: The agent returns a dictionary containing the success status and output data.
Skill and Capability Management
Skills are discrete, reusable components that agents can use to perform specific actions like web scraping, code execution, or database queries.
Skill Interface
Skills are registered using the add_skill method and invoked via use_skill. The system supports both class-based skills (objects with an execute method) and simple callable functions.
# From src/agents/base_agent.py
def add_skill(self, skill_name: str, skill):
self._skills[skill_name] = skill
self.logger.debug(f"Added skill: {skill_name}")
async def use_skill(self, skill_name: str, **kwargs) -> Any:
if not self.has_skill(skill_name):
raise ValueError(f"Skill '{skill_name}' not available")
skill = self._skills[skill_name]
if hasattr(skill, 'execute'):
return await skill.execute(**kwargs)
# ... handles callables
Sources: src/agents/base_agent.py:73-90, SKILLS.md:15-30
Configuration and Environment
Agents are configured via a centralized config/default.json or environment variables, which are then injected during the auto-wiring process.
Configuration Schema
| Key | Type | Description |
|---|---|---|
agents.{name}.enabled | Boolean | Whether the specific agent is active. |
agents.{name}.model | String | The LLM model used (e.g., gpt-4). |
agents.{name}.timeout | Integer | Execution timeout in seconds. |
agents.{name}.skills | List | Default skills to auto-load for the agent. |
Sources: config/default.json:44-59, AGENT.md:165-185
Dependency Injection (Auto-Wiring)
The BaseAgent architecture relies on the AutoWire system to handle instantiation and dependency resolution. This allows agents to remain decoupled from the specific implementation of services they use.
Summary
The Base Agent Architecture provides the necessary abstraction for a scalable multi-agent system. By isolating core logic into the BaseAgent and delegating capability management to the SkillRegistry and dependency management to the AutoWire engine, WIREDUP ensures that agents are highly configurable, testable, and capable of complex orchestration. This modular approach allows for the rapid development of specialized agents while maintaining a unified interface for task execution and state management.