This repository contains the implementation of Symphony, a novel collaborative, hierarchical multi-agent framework for complex task completion as described in the paper Symphony: Hierarchical Sub-Agent Creation and Orchestration for Multi-Agent Applications. You can also find a poster here.
Current LLM systems typically struggle with large, multifaceted prompts that require drawing on completely different areas of expertise. Symphony addresses this challenge through an orchestrator agent that dynamically assembles specialized sub-agents based on specific task requirements.
Key features:
- Dynamic generation of specialized sub-agents rather than relying on predefined agents
- Automatic system prompt creation for specialized sub-agent functions
- Hierarchical planning and orchestration
- Efficient integration of specialized sub-agent outputs
Symphony consists of five key components that work together to handle complex tasks:
- Decomposition: The orchestrator agent analyzes the input task and intelligently breaks it down into distinct "areas of expertise" required for completion. It identifies the necessary skills and knowledge domains, then creates a specialized "team" of sub-agents tailored to the task's requirements.
2. Creating sub-agents: For each identified area of expertise, the orchestrator generates a specialized sub-agent. Each sub-agent autonomously creates its own optimized system prompt based on the orchestrator's initial context, ensuring it's perfectly suited for its specific role in the task.
-
Planning: The orchestrator develops an execution strategy, determining the optimal sequence and dependencies for calling the sub-agents. It considers factors like task dependencies, information flow, and potential parallelization opportunities to create an efficient workflow.
-
Orchestration: The orchestrator manages the execution of the plan, routing information between sub-agents as needed. It handles the timing of agent calls, manages intermediate results, and ensures proper context is maintained throughout the process.
-
Integration: After all sub-agents have completed their tasks, the orchestrator synthesizes their outputs into a unified, coherent response. It resolves any inconsistencies, fills in gaps, and ensures the final output meets the original task requirements with high quality and consistency.
git clone https://github.com/SuperAce100/symphony.git
cd symphony
pip install -r requirements.txt
Create a .env
file in the root directory with the following variables:
OPENROUTER_API_KEY=your_openrouter_api_key
There are two main ways to use Symphony:
- Command Line:
python symphony.py --task "The task to complete" --output-file "outputs/output.md"
- Python Module:
from symphony import Symphony
symphony = Symphony()
response = symphony.run("The task to complete", output_file="outputs/output.md")
You can choose any model from OpenRouter that supports structured outputs and pass it into the text_model
parameter.
If you use Symphony in your research, please cite our paper:
@article{gupta2025symphony,
title={Symphony: Hierarchical Sub-Agent Creation and Orchestration for Multi-Agent Applications},
author={Gupta, Asanshay and Yan, Charlotte},
journal={Stanford CS224N Custom Project},
year={2025}
}
- Asanshay Gupta - Stanford University
- Charlotte Yan - Stanford University