The Repository Agent provides advanced capabilities for working with code repositories. It can analyze repository structure, understand codebases, and execute tasks using existing code from GitHub or local repositories.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/QuantaAlpha/RepoMaster/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Implemented insrc/core/agent_scheduler.py:178, the run_repository_agent() method provides a unified interface for executing tasks based on repositories. It automatically detects repository type (GitHub or local) and orchestrates the complete task execution workflow.
Key Features
Unified Interface
Single method handles both GitHub and local repositories automatically
Repository Analysis
Hierarchical analysis of repository structure and code
Autonomous Execution
Independent code exploration and task execution
Input Data Support
Process tasks with user-provided input files
Usage
Basic Usage
CLI Mode
- Direct Mode
- Via Unified Interface
Method Signature
run_repository_agent()
Unified interface for executing user tasks based on specified repository. Source:src/core/agent_scheduler.py:178
Task description that the user needs to solve. Maintain completeness without omitting any information.
Repository path or URL. Can be:
- GitHub repository URL:
https://github.com/owner/repo - Local repository absolute path:
/path/to/my/project
JSON string representing local input data. Format:Must be provided when task requires local files as input.
Repository type:
'github' or 'local'. Auto-detected if not specified.str - Result of agent executing the task, including completion status and output description
Repository Type Detection
The agent automatically detects repository type based on therepository parameter:
Source: src/core/agent_scheduler.py:206
Input Data Format
When your task requires input files, provide them in JSON format:Single File
Multiple Files
Validation
Source:src/core/agent_scheduler.py:232
The agent validates input data structure:
- Must be valid JSON array
- Each element must be a dictionary
- Each dictionary must have
pathanddescriptionfields
Task Workflow
The Repository Agent follows this workflow:Implementation Details
Source:src/core/agent_scheduler.py:246
- Repository Configuration: Build config based on type
- Task Initialization: Call
TaskManager.initialize_tasks() - Agent Execution: Run
AgentRunner.run_agent()with retry logic - Result Return: Provide execution results and output descriptions
Example Use Cases
- GitHub Repository
- Local Repository
- Data Processing
Integration with Task Manager
The Repository Agent usesTaskManager and AgentRunner for execution:
Source: src/core/agent_scheduler.py:258
Scheduler Integration
The Repository Agent is part of the RepoMaster multi-agent system and can be invoked automatically: Source:src/core/agent_scheduler.py:19 (scheduler system message)
Automatic Selection Triggers
The scheduler automatically selects Repository Agent when:- User mentions local file paths or directories
- User provides GitHub URLs or repository paths
- Task requires specialized tools/libraries from repositories
- User wants to find existing solutions
GitHub Repository Search
Before using repositories, you can search for relevant ones: Source:src/core/agent_scheduler.py:142
Error Handling
The agent includes comprehensive validation:Common Errors
Invalid Repository Path
Invalid Repository Path
Invalid GitHub URL
Invalid GitHub URL
https://github.com/owner/repoInvalid Input Data
Invalid Input Data
Missing Required Fields
Missing Required Fields
Performance Considerations
Repository Cloning: GitHub repositories are cloned on first use, which may take time for large repos. Consider using shallow clones for faster initialization.
Retry Logic: The agent runner includes retry logic (
retry_times=1) to handle transient failures gracefully.Limitations
Next Steps
Unified Interface
Learn about intelligent multi-agent orchestration
Deep Search Agent
Search for repositories and information