Skip to main content

Overview

Backend modes provide direct command-line access to RepoMaster’s specialized AI agents. Each mode offers unique capabilities optimized for specific task types.

Description

From launcher.py:9 and 372-435, the unified mode provides intelligent multi-agent orchestration with automatic task routing. Key Features:
  • 🧠 Automatic agent selection based on task analysis
  • 🤝 Seamless coordination between multiple agents
  • 🎯 Context-aware routing for optimal performance
  • ⚡ Zero configuration required

Launch Command

python launcher.py --mode backend --backend-mode unified

Welcome Screen

From launcher.py:394, unified mode displays a custom welcome panel with:
  • Working directory information
  • Available capabilities
  • Usage instructions
  • Interactive command prompt

How It Works

From launcher.py:372-435, the unified mode:
  1. Creates RepoMasterAgent with LLM and execution configs
  2. Initializes ConversationManager for context tracking
  3. Displays welcome message via print_unified_mode_welcome()
  4. Enters interactive loop:
    • Accepts user task description
    • Optimizes prompt with conversation context
    • Analyzes task intelligently
    • Selects and coordinates optimal agents
    • Returns comprehensive results

Task Processing

The unified mode uses solve_task_with_repo() method (launcher.py:423):
result = agent.solve_task_with_repo(optimized_task)
This method automatically:
  • Analyzes task requirements
  • Selects appropriate agent(s)
  • Coordinates multi-agent workflows
  • Synthesizes final results

Example Session

$ python launcher.py --mode backend --backend-mode unified

🤖 Unified Multi-Agent Interface Ready!
📂 Work Directory: /home/user/RepoMaster/coding/cli_user/1234567890_123

 Available Capabilities:
   🔍 Deep Search & Web Research
   💻 Programming & Code Generation
   🏗️  Repository Analysis & Execution

--------------------------------------------------
🤖 Please describe your task: Create a Python script to analyze CSV data
🔧 Intelligent task analysis...
   📊 Selecting optimal processing method...

📋 Task execution result:
[Detailed implementation with code generation...]

--------------------------------------------------
🤖 Please describe your task: quit
👋 Multi-Agent system service stopped

Interactive Commands

CommandAction
quit, exit, qExit the program
history, hDisplay conversation history
clear, cClear conversation context

Use Cases

Best for:
  • General programming tasks
  • Complex multi-step workflows
  • Tasks requiring multiple agent types
  • When you’re unsure which specific agent to use
The unified mode is recommended for most users. It intelligently handles task routing and agent coordination automatically.

DeepSearch Mode

Description

From launcher.py:10 and 154-215, DeepSearch mode provides direct access to advanced web search and information synthesis capabilities. Key Features:
  • 🔍 Advanced search query optimization
  • 🌐 Real-time web information retrieval
  • 📊 Information synthesis and analysis
  • 🎯 Research-focused outputs

Launch Command

python launcher.py --mode backend --backend-mode deepsearch

Implementation Details

From launcher.py:154-215, DeepSearch mode:
  1. Imports AutogenDeepSearchAgent from src.services.agents.deep_search_agent
  2. Creates agent with LLM and execution configurations
  3. Initializes conversation manager for context
  4. Displays welcome message with features:
    • ”🔍 Advanced search & query optimization”
    • ”🌐 Real-time web information retrieval”
  5. Processes queries via agent.deep_search() async method

Search Processing

From launcher.py:209-212:
optimized_query = conversation.get_optimized_prompt(query)
conversation.add_message("user", query)
result = asyncio.run(agent.deep_search(optimized_query))
conversation.add_message("assistant", result)

Example Session

$ python launcher.py --mode backend --backend-mode deepsearch

🔍 Deep Search Agent Ready!
📂 Work Directory: /home/user/RepoMaster/coding/cli_user/1234567890_456

 Features:
   🔍 Advanced search & query optimization
   🌐 Real-time web information retrieval

💡 Instructions:
 Enter search question or research topic
 Enter 'quit' to exit, 'history'/'clear' to view/clear chat history

🤔 Please enter search question: Latest developments in LLM reasoning
🔍 Searching...

📋 Search results:
[Comprehensive search results with sources...]

🤔 Please enter search question: history
[Displays conversation history...]

🤔 Please enter search question: quit
👋 Deep Search Agent service stopped

Use Cases

Best for:
  • Research tasks requiring web search
  • Information gathering and synthesis
  • Technical documentation lookup
  • Market research and competitive analysis
  • Fact-checking and verification

General Assistant Mode

Description

From launcher.py:11 and 217-284, General Assistant mode provides direct access to programming assistance capabilities. Key Features:
  • 💻 General purpose programming assistance
  • 🔧 Code writing, debugging and optimization
  • 📚 Algorithm implementation & debugging help
  • 🎓 Educational programming support

Launch Command

python launcher.py --mode backend --backend-mode general_assistant

Implementation Details

From launcher.py:217-284, General Assistant mode:
  1. Creates RepoMasterAgent with configurations
  2. Initializes conversation manager for “general_assistant” mode
  3. Displays welcome with features:
    • ”💻 General purpose programming assistance”
    • ”🔧 Code writing, debugging and optimization”
    • ”📚 Algorithm implementation & debugging help”
  4. Processes tasks via run_general_code_assistant() method

Task Processing

From launcher.py:275-278:
result = agent.run_general_code_assistant(
    task_description=optimized_task,
    work_directory=execution_config.get("work_dir")
)

Example Session

$ python launcher.py --mode backend --backend-mode general_assistant

Programming Assistant Ready!
📂 Work Directory: /home/user/RepoMaster/coding/cli_user/1234567890_789

 Features:
   💻 General purpose programming assistance
   🔧 Code writing, debugging and optimization
   📚 Algorithm implementation & debugging help

💡 Instructions:
 Describe programming task or ask questions
 Enter 'quit' to exit, 'history'/'clear' to view/clear chat history

💻 Please describe your programming task: Implement quicksort in Python
🔧 Processing...

📋 Task result:
[Code implementation with explanations...]

💻 Please describe your programming task: quit
👋 Programming Assistant Agent service stopped

Use Cases

Best for:
  • Algorithm implementation
  • Code debugging and optimization
  • Programming concept explanations
  • Code refactoring
  • Learning programming patterns

Repository Agent Mode

Description

From launcher.py:12 and 286-370, Repository Agent mode provides direct access to repository exploration and task execution. Key Features:
  • 📁 Repository analysis & structure modeling
  • 🔧 Autonomous code exploration and execution
  • 🏗️ Multi-repository coordination
  • 🎯 Task-oriented repository interaction

Launch Command

python launcher.py --mode backend --backend-mode repository_agent

Implementation Details

From launcher.py:286-370, Repository Agent mode:
  1. Creates RepoMasterAgent with configurations
  2. Initializes conversation manager for “repository_agent” mode
  3. Displays welcome with features:
    • ”📁 Repository analysis & structure modeling”
    • ”🔧 Autonomous code exploration and execution”
  4. Accepts task description AND repository path/URL
  5. Optionally handles input data files
  6. Processes via run_repository_agent() method

Input Workflow

From launcher.py:322-367, the agent prompts for:
  1. Task Description: What you want to accomplish
  2. Repository: GitHub URL or local path
  3. Input Data (optional): Additional data files needed
task_description = input("📝 Please describe your task: ").strip()
repository = input("📁 Please enter repository path or URL: ").strip()

use_input_data = input("🗂️  Do you need to provide input data files? (y/N): ").strip().lower()
if use_input_data in ['y', 'yes']:
    input_path = input("📂 Please enter data file path: ").strip()

Task Processing

From launcher.py:360-364:
result = agent.run_repository_agent(
    task_description=optimized_task,
    repository=repository,
    input_data=input_data
)

Example Session

$ python launcher.py --mode backend --backend-mode repository_agent

Repository Agent Ready!
📂 Work Directory: /home/user/RepoMaster/coding/cli_user/1234567890_012

 Features:
   📁 Repository analysis & structure modeling
   🔧 Autonomous code exploration and execution

💡 Instructions:
 Provide task description and repository (GitHub URL or local path)
 Optional: add input data files | Enter 'quit' to exit, 'history' to view chat history, 'clear' to clear history

📝 Please describe your task: Analyze the project structure and generate documentation
📁 Please enter repository path or URL: https://github.com/user/project
🗂️  Do you need to provide input data files? (y/N): n
🔧 Processing repository task...

📋 Task result:
[Repository analysis and documentation generation...]

📝 Please describe your task: quit
👋 Repository Exploration Agent service stopped

Use Cases

Best for:
  • Repository exploration and understanding
  • Code analysis across multiple files
  • Automated task execution in repositories
  • Documentation generation from code
  • Cross-repository operations

Conversation Management

All backend modes include conversation management from launcher.py:

ConversationManager

Each mode creates a conversation manager:
from src.core.conversation_manager import ConversationManager, get_user_id_for_cli

user_id = get_user_id_for_cli()
conversation = ConversationManager(user_id, "<mode_name>")

Context Optimization

All modes optimize prompts with context:
optimized_prompt = conversation.get_optimized_prompt(user_input)
conversation.add_message("user", user_input)
# ... process task ...
conversation.add_message("assistant", result)
This enables:
  • Multi-turn conversations
  • Context-aware responses
  • Conversation history tracking
  • Prompt optimization

Configuration

LLM Configuration

All modes use configuration from ModeConfigManager:
llm_config = config_manager.get_llm_config(config_manager.config.api_type)
execution_config = config_manager.get_execution_config()

Execution Configuration

Includes:
  • Working directory
  • Code execution settings
  • Timeout values
  • Resource limits

Best Practices

Mode Selection

Choose the right mode for your task:
  • Unified: Most tasks, especially complex ones
  • DeepSearch: Research and information gathering
  • General Assistant: Pure coding tasks without repos
  • Repository Agent: Working with specific repositories

Performance Optimization

For better performance:
  • Use specific modes when you know the task type
  • Provide clear, detailed task descriptions
  • Use conversation history for context
  • Clear context when switching topics

Error Handling

Common issues:
  • Missing repository access (Repository Agent)
  • Network timeouts (DeepSearch)
  • Invalid task descriptions (all modes)
  • Working directory permissions (all modes)

Advanced Usage

Scripting with Backend Modes

You can script backend modes using input redirection:
echo -e "Implement binary search\nquit" | \
  python launcher.py --mode backend --backend-mode general_assistant

Custom Work Directories

python launcher.py --mode backend \
  --backend-mode repository_agent \
  --work-dir /tmp/repo-analysis

API Provider Selection

# Use Claude for creative tasks
python launcher.py --mode backend \
  --backend-mode unified \
  --api-type claude \
  --temperature 0.7

# Use DeepSeek for code-heavy tasks
python launcher.py --mode backend \
  --backend-mode general_assistant \
  --api-type deepseek

Comparison Table

FeatureUnifiedDeepSearchGeneral AssistantRepository Agent
Web Search✅ Auto✅ Primary✅ Auto
Code Generation✅ Auto✅ Primary✅ Auto
Repo Analysis✅ Auto✅ Primary
Multi-Agent
Auto-Routing
Best ForGeneral UseResearchPure CodingRepo Tasks

See Also

Build docs developers (and LLMs) love