Overview
RepoMaster implements a sophisticated multi-agent system where specialized agents collaborate to solve complex programming tasks. The system uses AutoGen framework for agent orchestration and communication.Agent Hierarchy
Primary Agents
1. Scheduler Agent
Thescheduler_agent is the brain of the system, responsible for task analysis and mode selection.
System Message (agent_scheduler.py:19-71):
- Task requirement analysis
- Tool selection and orchestration
- Multi-step planning
- Result evaluation and fallback handling
2. User Proxy Agent
Theuser_proxy acts as an execution proxy that interfaces between the scheduler and tool execution.
System Message (agent_scheduler.py:73-81):
Repository Exploration Agents
Code_Explorer Agent
The intelligent assistant that plans repository exploration and code analysis. Initialization (agent_code_explore.py:180-185):- Current timestamp for context
- Repository path information
- Available tools description
- Task-specific instructions (e.g., Kaggle competition handling)
- Analyze task requirements
- Plan exploration strategy
- Call appropriate analysis tools
- Generate code solutions
- Synthesize final results
Coder_Executor Agent
The execution agent that runs code and tool operations. Configuration (agent_code_explore.py:188-203):Docker Executor Mode
Docker Executor Mode
Uses
EnhancedDockerCommandLineCodeExecutor for containerized execution:Virtual Environment Mode
Virtual Environment Mode
Uses
LocalCommandLineCodeExecutor with isolated virtual environment:Agent Communication Protocol
Message Flow
Tool Registration
Agents communicate through registered tool functions (agent_scheduler.py:334-347):Conversation Management
Token Limit Handling
The system monitors conversation length and summarizes history when needed (agent_code_explore.py:97-142):Chat History Summarization
When conversations exceed token limits, the system summarizes history (base_code_explorer.py:213-304): Summary Structure:Smart Restart: When token limit is reached, the system summarizes the conversation and restarts with the summary as context, allowing continuation of complex tasks.
Deep Search Agent
AutogenDeepSearchAgent
Specialized agent for web search and information retrieval. Integration (agent_scheduler.py:96-99):Web Search
web_search(query) - General internet search for real-time informationRepository Search
github_repo_search(task) - Find relevant GitHub repositoriesIssue Solutions
issue_solution_search(issue_description) - Find programming solutionsDeep Research
deep_search(query) - Comprehensive research queriesAgent Lifecycle
Initialization Sequence
-
Environment Setup
- Load configuration (llm_config, code_execution_config)
- Create working directories
- Initialize virtual environments (if enabled)
-
Agent Creation
- Instantiate scheduler and user_proxy agents
- Setup system messages and termination conditions
- Configure execution environments
-
Tool Registration
- Register available tools with agents
- Setup function signatures and descriptions
- Enable tool calling capabilities
-
Conversation Initiation
Execution Modes
Sequential Execution
Sequential Execution
Tools are called one at a time based on previous results:
- Scheduler analyzes task
- Calls first tool
- Evaluates result
- Decides next action
- Continues until completion
Iterative Refinement
Iterative Refinement
For repository mode, the system tries multiple approaches:
- Search for repositories
- Try most promising repository
- Evaluate results
- If unsuccessful, try next repository
- Continue until success or exhaustion
Best Practices
For Agent Configuration
- Set appropriate
max_turnsbased on task complexity (typically 10-20) - Configure timeout values for long-running operations (default: 2 hours)
- Use
summary_method="reflection_with_llm"for better final summaries
For Tool Design
- Provide clear, descriptive function names
- Use type hints with
Annotatedfor parameter descriptions - Return structured, parseable results
- Include error handling and helpful error messages
For Conversation Management
- Monitor token usage with
token_limit_termination - Enable chat history summarization for long tasks
- Use conversation context from
ConversationManager
Next Steps
Task Routing
Learn how tasks are routed to appropriate agents
Repository Exploration
Understand code analysis capabilities