Overview
TheRepoMasterAgent is the primary agent class in RepoMaster that orchestrates multiple specialized agents to solve user tasks. It can search for relevant GitHub repositories, analyze repository content, perform web searches, and provide general programming assistance through collaboration between scheduler and user agents.
Class Definition
Constructor
__init__()
Initialize a new RepoMasterAgent instance.
Language model configuration containing model settings, API keys, and other LLM parameters. See Configuration Guide for details.
Code execution configuration containing:
work_dir(str): Working directory for code executionuse_docker(bool): Whether to use Docker for code execution
Example
Methods
solve_task_with_repo()
Main entry point for solving tasks using RepoMaster’s intelligent multi-agent system.
Detailed task description that the user needs to solve
Complete solution report including analysis methods, execution results, and recommendations
Features
-
Three Working Modes:
- Web Search Mode: Search the internet for real-time information, current events, or general knowledge
- Repository Mode: Search and use GitHub repositories or local repositories for specialized tasks with hierarchical analysis
- General Code Assistant Mode: Provide programming assistance without specific repositories
-
Auto-Mode Detection:
- Detects real-time information needs → Web Search Mode
- Detects repository paths/URLs (GitHub or local) → Repository Mode
- Detects general programming questions → General Code Assistant Mode
- Default behavior → Repository Mode
Example
run_repository_agent()
Unified interface for executing user tasks based on a specified repository (GitHub or local).
Task description that the user needs to solve, maintaining completeness without omitting information
Repository path or URL. Can be:
- GitHub repository URL (format:
https://github.com/owner/repo) - Local repository absolute path (e.g.,
/path/to/my/project)
JSON string representing local input data. Format:Required when the task explicitly mentions using local files as input. Pass empty list
[] if no input data needed.Repository type:
'github' or 'local'. If not specified, automatically detected based on the repository parameter.Result of agent executing the task, containing task completion status and output content description
Process
- Automatically detect repository type or use specified type
- Validate repository path or URL validity
- Validate and process input data
- Initialize task environment (create working directory, clone or copy repository)
- Run code agent to analyze and execute tasks
Example
run_general_code_assistant()
Provide general programming assistance without requiring a specific repository.
Programming task or question that needs general coding assistance
Specific working directory for code execution. If not provided, uses default work directory.
Result containing programming guidance, code examples, and execution results
Capabilities
This method creates a clean workspace and uses the code exploration agent to help with:- General programming questions and guidance
- Writing and executing code snippets
- Debugging and troubleshooting
- Creating examples and demonstrations
- Algorithm implementations
- Code explanations and tutorials
Example
web_search()
Perform general web search to find real-time information or solve general problems that don’t require code.
Query for general web search to get real-time information or answer non-code-related questions
Formatted search result information with analysis and answers based on web search
Features
- Search the internet and generate answers based on results
- Provide real-time information about current events and latest data
- Return formatted search result information
- Access information beyond the model’s knowledge cutoff date
Example
github_repo_search()
Search for relevant code repositories on GitHub based on task description.
Description of tasks that need to be solved through GitHub repositories, used to search for the most relevant code libraries
A JSON string containing a list of the most matching repository information with format:
Process
- Search for the most relevant GitHub repositories based on task description
- Carefully read the README file of each repository
- Determine whether the code can solve the task based on README
- Select top 5 repositories most suitable to solve the task
- Return results in JSON format
Example
initialize_agents()
Initialize scheduler agent and user proxy agent for task orchestration.
__init__() and sets up:
scheduler: ExtendedAssistantAgent for task planning and tool selectionuser_proxy: ExtendedUserProxyAgent for tool execution and result collection
register_tools()
Register the enhanced toolkit required by the agent.
__init__() and registers:
web_search: Web search functionalityrun_repository_agent: Unified repository processing moderun_general_code_assistant: General code assistant modegithub_repo_search: GitHub repository search
Complete Usage Example
Architecture
The RepoMasterAgent orchestrates multiple components:- Scheduler Agent: Analyzes tasks, creates plans, and selects appropriate tools
- User Proxy Agent: Executes tools and collects results
- Deep Search Agent: Handles web searches and GitHub repository searches
- Code Explorer: Provides general programming assistance and code execution
- Task Manager & Agent Runner: Manages repository-based task execution