Skip to main content

What is RepoMaster?

RepoMaster is an intelligent multi-agent system designed to understand, analyze, and work with code repositories. The system orchestrates specialized agents to handle complex programming tasks through collaborative intelligence.

Multi-Agent Collaboration

Multiple specialized agents work together to solve complex tasks

Repository Intelligence

Deep understanding of code structure and dependencies

Adaptive Task Routing

Automatic selection of optimal execution strategy

Virtual Environment Management

Isolated execution environments for safe code execution

System Architecture

RepoMaster follows a hierarchical architecture with three main layers:

Core Components

1. RepoMasterAgent (launcher.py:83-414)

The main orchestrator that coordinates all system operations. Located in src/core/agent_scheduler.py. Key Methods:
  • solve_task_with_repo(task: str) - Main entry point for task execution
  • run_repository_agent(task_description, repository, input_data) - Execute repository-based tasks
  • run_general_code_assistant(task_description) - Provide general programming assistance
  • web_search(query) - Search for real-time information
  • github_repo_search(task) - Find relevant repositories
Three Operating Modes:
Uses the AutogenDeepSearchAgent to search the internet for real-time information, current events, or external knowledge.When to use: Questions requiring latest data, documentation lookup, general knowledge queries.
Analyzes and executes tasks within GitHub or local repositories using hierarchical exploration.When to use: Tasks involving specific codebases, repository analysis, code modification.
Provides programming assistance without requiring a specific repository.When to use: General programming questions, algorithm implementations, code examples.

2. TaskManager (git_task.py:159-256)

Manages task initialization and environment setup. Key Methods:
  • initialize_tasks(args) - Initialize task environment and configuration
  • prepare_task_description(task_info, ...) - Generate formatted task prompts
  • get_task_prompt() - Return standard task template
Responsibilities:
  • Create unique working directories for task isolation
  • Parse task configuration from YAML or direct input
  • Generate structured task descriptions with context

3. AgentRunner (git_task.py:258-343)

Executes code agents to complete tasks. Key Methods:
  • run_agent(task_info, retry_times=2) - Run CodeExplorer to execute tasks
  • process_single_task(task_info, args) - Process individual tasks with error handling
Execution Flow:
  1. Create isolated working directory
  2. Setup task environment (clone/copy repository, prepare input data)
  3. Generate comprehensive task description
  4. Initialize and run CodeExplorer
  5. Monitor execution and handle retries

4. CodeExplorer (agent_code_explore.py:24-353)

The intelligent code exploration and execution agent. Initialization:
CodeExplorer(
    local_repo_path: str,
    work_dir: str,
    remote_repo_path: Optional[str],
    task_type: Optional[str],
    use_venv: bool = False,
    is_cleanup_venv: bool = True
)
Key Components:
  • Code_Explorer - Assistant agent that plans and analyzes
  • Coder_Executor - User proxy agent that executes code and tools
  • CodeExplorerTools - Repository analysis toolkit

Data Flow

Understanding the data flow helps you see how information moves through the system from user input to final output.

Configuration Management

RepoMaster uses a flexible configuration system: LLM Configuration (configs/oai_config.py):
  • Multiple API provider support (OpenAI, Claude, DeepSeek, etc.)
  • Service-specific configurations
  • Automatic fallback mechanisms
Execution Configuration:
code_execution_config = {
    "work_dir": "/path/to/workspace",
    "use_docker": False,
    "timeout": 7200  # 2 hours
}
Environment Variables (.env):
  • API keys (SERPER_API_KEY, JINA_API_KEY)
  • Model configurations
  • Service endpoints

Virtual Environment Management

The BaseCodeExplorer class (base_code_explorer.py:15-304) provides sophisticated virtual environment management: Features:
  • Persistent environment reuse for faster startup
  • Automatic dependency installation
  • Base environment copying for efficiency
  • Elegant progress display
Key Methods:
  • _load_venv_context(venv_dir, is_clear_venv, base_venv_path) - Load or create virtual environment
  • _create_virtual_env(venv_path) - Create new environment with dependencies
  • cleanup_venv() - Clean up temporary environments

Next Steps

Multi-Agent System

Learn how agents collaborate

Task Routing

Understand task scheduling

Repository Exploration

Discover code analysis capabilities

Quickstart Guide

Start using RepoMaster

Build docs developers (and LLMs) love