Skip to content

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.

License

Notifications You must be signed in to change notification settings

extrawest/multi_agent_workflow_demo_in_langgraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 Multi-Agent Workflow Demonstrations in LangGraph

Maintenance Maintainer Ask Me Anything ! License GitHub release

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.

📋 Features

Hierarchical Agent Teams

  • 🏗️ 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

Agent Supervision

  • 👨‍💼 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

Multi-Agent Collaboration

  • 🤝 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

🏗️ Architecture

The demonstrations showcase three distinct multi-agent architecture patterns:

Hierarchical Teams

hierarchical_agent_teams

Agent Supervisor

agent_supervisor

Multi-Agent Collaboration

multi_agent_collaboration

📦 Implementation Details

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

🛠️ Requirements

  • Python 3.9+
  • OpenAI API key
  • Tavily API key
  • LangChain and LangGraph libraries

📦 Installation

# 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"

🚀 Usage

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

🏆 Key Benefits

  • 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

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages