Skip to content

Hierarchical Sub-Agent Creation and Orchestration for Multi-Agent Applications

Notifications You must be signed in to change notification settings

SuperAce100/symphony

Repository files navigation

Symphony: Hierarchical Sub-Agent Creation and Orchestration

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.

Overview

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

Approach

Symphony consists of five key components that work together to handle complex tasks:

  1. 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.

Decomposition 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.

  1. 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.

  2. 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.

  3. 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.

Planning, Integration, and Orchestration

Setup

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

Usage

There are two main ways to use Symphony:

  1. Command Line:
python symphony.py --task "The task to complete" --output-file "outputs/output.md"
  1. Python Module:
from symphony import Symphony

symphony = Symphony()
response = symphony.run("The task to complete", output_file="outputs/output.md")

Model Support

You can choose any model from OpenRouter that supports structured outputs and pass it into the text_model parameter.

Citation

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}
}

Reach Out

About

Hierarchical Sub-Agent Creation and Orchestration for Multi-Agent Applications

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published