A collection of demonstrations showcasing different patterns for implementing multi-agent workflows using LangGraph. Each example highlights specific orchestration approaches to help developers understand and build collaborative AI systems.
- 🏗️ Orchestrates complex workflows with multiple levels of supervision
- 🔄 Seamlessly coordinates specialized agent teams (research, document writing)
- 🧠 Efficiently delegates tasks to lower-level agents with appropriate tools
- 📊 Follows proper escalation and reporting paths in the agent hierarchy
- 👨💼 Models a supervisor-worker relationship for intelligent task delegation
- 🔄 Routes tasks between research and coding agents based on requirements
- 🚦 Manages conversation flow with clear transitions between agents
- 🔍 Makes real-time decisions about which agent should act next
- 🤝 Enables direct peer-to-peer collaboration between agents
- 🛠️ Shares tools and information across collaborating agents
- 📊 Demonstrates fluid conversation flow between specialized agents
- 📡 Facilitates tool calling between different agent types
The demonstrations showcase three distinct multi-agent architecture patterns:
Hierarchical Teams
Agent Supervisor
Multi-Agent Collaboration
This demonstration implements a sophisticated hierarchical team structure with multiple levels of supervision:
- Top-level Supervisor: Coordinates between specialized teams
- Research Team: Combines web search and web scraping capabilities
- Document Writing Team: Creates, edits and manages document creation
- Tool Integration: Implements document creation/editing tools, search tools, and web scraping
- State Management: Shows how to manage complex state across the hierarchy
This demonstration implements a supervisor-worker architecture:
- Supervisor Agent: Makes routing decisions about which agent to activate
- Research Agent: Uses search tools to gather information
- Coding Agent: Executes Python code for calculations and analysis
- Decision Logic: Shows how to implement routing logic for multi-agent systems
This demonstration implements a peer-to-peer collaborative agent system:
- Researcher Agent: Gathers data from web sources
- Chart Generator Agent: Creates visualizations from research data
- Tool Sharing: Shows how tools can be used across agent boundaries
- Collaborative Workflow: Demonstrates agents working together on a shared task
- Python 3.9+
- OpenAI API key
- Tavily API key
- LangChain and LangGraph libraries
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
export OPENAI_API_KEY="your-openai-api-key"
export TAVILY_API_KEY="your-tavily-api-key"
# Optional: Enable LangChain tracing
export LANGCHAIN_TRACING_V2="true"
export LANGCHAIN_PROJECT="Multi-Agent-Workflow"
Each demonstration can be run as a standalone script:
# Run the hierarchical agent teams demo
python scripts/hierarchical_agent_teams.py
# Run the agent supervisor demo
python scripts/agent_supervisor.py
# Run the multi-agent collaboration demo
python scripts/multi_agent_collaboration.py
- Modularity: Each example demonstrates a reusable pattern for multi-agent systems
- Flexibility: Shows different approaches to agent coordination and collaboration
- Adaptability: Provides templates that can be customized for specific use cases
- Scalability: Demonstrates patterns that can scale to complex multi-agent systems