Skip to main content
The Unified Interface provides intelligent orchestration of all RepoMaster agents. It automatically analyzes your task and selects the optimal agent or combination of agents to solve it.

Overview

Implemented in src/core/agent_scheduler.py:349, the solve_task_with_repo() method serves as the main entry point for RepoMaster. It coordinates three specialized agents through intelligent task analysis and automatic mode selection.

Key Features

Automatic Agent Selection

Intelligently determines the best agent for each task

Multi-Agent Orchestration

Coordinates multiple agents for complex workflows

Adaptive Strategy

Switches approaches based on results and feedback

Unified Entry Point

Single method for all RepoMaster capabilities

Usage

Basic Usage

from src.core.agent_scheduler import RepoMasterAgent
from configs.oai_config import get_llm_config

# Initialize
llm_config = get_llm_config()
code_execution_config = {
    "work_dir": "coding/workspace",
    "use_docker": False
}

agent = RepoMasterAgent(
    llm_config=llm_config,
    code_execution_config=code_execution_config
)

# Use unified interface - automatic agent selection
result = agent.solve_task_with_repo(
    "What is the current stock price of Apple?"
)
print(result)

CLI Mode

# Launch unified mode
python launcher.py --mode unified

# Or simply (unified is default)
python launcher.py
🤖 Please describe your task: What are the latest AI research trends?

🔧 Intelligent task analysis...
📊 Selecting optimal processing method...

# System automatically selects Deep Search Agent
🔍 Searching web for real-time information...
📋 Task execution result: [comprehensive answer from web search]

Method Signature

solve_task_with_repo()

Main entry point for RepoMaster with automatic agent selection. Source: src/core/agent_scheduler.py:349
task
str
required
Detailed task description that user needs to solve
Returns: str - Complete solution report including analysis methods, execution results, and recommendations
def solve_task_with_repo(self, task: str) -> str:
    """
    Enhanced RepoMaster that can work with GitHub repositories, 
    local repositories, or provide general programming assistance.
    
    Three Working Modes:
    1. Web Search Mode - Real-time information retrieval
    2. Repository Mode - Repository analysis and execution  
    3. General Code Assistant Mode - Programming assistance
    """

Working Modes

The Unified Interface supports three distinct modes:

1. Web Search Mode

Triggered when:
  • Task requires real-time information
  • Questions about current events or latest data
  • Information beyond model’s knowledge cutoff
  • General knowledge queries
Implementation: Calls web_search() method (source: src/core/agent_scheduler.py:127)
# Example tasks that trigger Web Search Mode
"What is the current price of Bitcoin?"
"Latest developments in quantum computing"
"Top AI research papers published this week"

2. Repository Mode

Triggered when:
  • Task mentions GitHub URLs or repository paths
  • User references specific libraries or frameworks
  • Task requires specialized code from repositories
  • Local repository paths are detected
Implementation: Calls run_repository_agent() method (source: src/core/agent_scheduler.py:178)
# Example tasks that trigger Repository Mode
"Use pdfplumber library to extract PDF text"
"Analyze my local repo at /home/user/project"
"Find and use a GitHub library for image processing"

3. General Code Assistant Mode

Triggered when:
  • General programming questions
  • Algorithm implementation requests
  • Code debugging help
  • No specific repository mentioned
Implementation: Calls run_general_code_assistant() method (source: src/core/agent_scheduler.py:273)
# Example tasks that trigger General Code Assistant Mode
"Write a function to calculate Fibonacci numbers"
"How do I implement binary search in Python?"
"Debug this code: [code snippet]"

Scheduler System Prompt

The intelligent orchestration is guided by a sophisticated system prompt: Source: src/core/agent_scheduler.py:19

Key Responsibilities

  1. Web Search Assessment: First determine if task needs real-time data
  2. Plan Creation: For repository tasks, prioritize:
    • Search for relevant repositories
    • Identify suitable repository
    • Execute using that repository
  • Execute plan by selecting one appropriate tool at a time
  • Repository Mode: Use run_repository_agent (auto-detects GitHub/local)
  • General Code Assistant: Use run_general_code_assistant
  • Web Search: Use web_search for real-time information
  1. Search: Use github_repo_search to find relevant repositories
  2. Execute: Select most promising repo and use run_repository_agent
  3. Evaluate: Critically assess if result satisfies requirements
  4. Retry: If unsuccessful, try next best repository
  5. Persist: Continue until task completed or options exhausted
  • Base subsequent tools on:
    • Outcomes of previous tools
    • Current state of plan
    • Capabilities of available tools
  • Fallback to alternative modes if primary approach fails
  • Be persistent in finding solutions

Available Tools

The scheduler registers four tools for intelligent orchestration: Source: src/core/agent_scheduler.py:334 Perform general web search for real-time information.
query
str
required
Query for general web search to get real-time information

run_repository_agent()

Execute tasks using GitHub or local repositories.
task_description
str
required
Complete task description
repository
str
required
GitHub URL or local path
input_data
str
default:"None"
JSON string of input files
repo_type
str
default:"None"
‘github’ or ‘local’ (auto-detected)

run_general_code_assistant()

Provide general programming assistance.
task_description
str
required
Programming task or question
work_directory
str
default:"None"
Specific working directory
Search for relevant GitHub repositories.
task
str
required
Task description for finding relevant code libraries

Agent Collaboration

The Unified Interface uses two agents that work together:

Scheduler Agent

Name: scheduler_agent Role: Enhanced Task Scheduler Responsibilities:
  • Analyze user input
  • Create structured task plans
  • Select and call appropriate tools
  • Evaluate results and adjust strategy
Source: src/core/agent_scheduler.py:110

User Proxy Agent

Name: user_proxy Role: Execution Proxy Responsibilities:
  • Execute tools and functions
  • Return results to scheduler
  • Never provide user-facing answers directly
  • Avoid repeating scheduler’s content
Source: src/core/agent_scheduler.py:118

Conversation Configuration

The unified interface uses these conversation parameters: Source: src/core/agent_scheduler.py:382
max_turns=12  # Maximum conversation turns
summary_method="reflection_with_llm"  # LLM-based summarization
summary_prompt="Summarize takeaway from the conversation and 
                generate a complete and detailed report at last."

Example Workflows

task = """
I need to convert a PDF to markdown. Find a suitable Python library 
on GitHub and use it to convert my document at /data/report.pdf
"""

result = agent.solve_task_with_repo(task)

# Workflow:
# 1. Scheduler analyzes task
# 2. Uses github_repo_search to find PDF libraries
# 3. Evaluates results: finds 'pymupdf' as top candidate
# 4. Calls run_repository_agent with:
#    - repository: https://github.com/pymupdf/PyMuPDF
#    - input_data: [{"path": "/data/report.pdf", ...}]
# 5. Returns conversion results

Interactive CLI Features

Source: launcher.py:372 The unified mode CLI provides rich interactive features:

Commands

  • quit/exit/q: Exit the session
  • history/h: View conversation history
  • clear/c: Clear conversation history

Conversation Memory

The unified interface maintains conversation context:
from src.core.conversation_manager import ConversationManager

conversation = ConversationManager(user_id, "unified")
optimized_task = conversation.get_optimized_prompt(task)

Benefits of Unified Interface

Simplicity

Single entry point for all capabilities - no need to choose agents manually

Intelligence

Automatic task analysis and optimal agent selection

Adaptability

Switches strategies based on results and feedback

Persistence

Retries with alternative approaches when initial attempts fail

De-duplication Policy

Both agents follow strict de-duplication rules to avoid repetitive responses: Source: src/core/agent_scheduler.py:69 (scheduler) and src/core/agent_scheduler.py:78 (user proxy)
Before sending messages, agents compare with previous two messages. If the response would substantially repeat previously stated content, they avoid restating it or send “TERMINATE” if the task is complete.

Performance Optimization

Caching

The unified interface benefits from LLM caching:
llm_config = {
    "cache_seed": 42,  # Enable caching
    # ... other config
}

Conversation Management

Conversation history is optimized through:
  • Context-aware prompt optimization
  • Automatic summarization after max_turns
  • Message de-duplication

When to Use Unified Interface

Ideal for:
  • Complex tasks requiring multiple steps
  • Tasks where the optimal approach is unclear
  • Users who want automatic agent selection
  • Workflows combining search, repository analysis, and coding
  • Iterative problem-solving with adaptive strategies
Consider direct agent access when:
  • You know exactly which agent you need
  • You want maximum control over the workflow
  • You’re using RepoMaster programmatically with specific requirements
  • You want to minimize conversation turns

Next Steps

Deep Search

Direct web search access

Programming Assistant

Direct coding assistance

Repository Agent

Direct repository access

Build docs developers (and LLMs) love