LangGraph - Multi-Agent Workflows



AI Summary

Summary: Lang Graph Library Introduction

  • Introduction to Lang Graph:
    • Presented by Harrison from Lang chain.
    • Lang graph is a new library for creating multi-agent workflows as graphs.
    • Allows dynamic creation of agent-like workflows, running language models in loops with various structures.
    • Comparable to state machines with nodes (agents) and edges (communication between agents).
  • Using L Graph:
    • Define graphs to track state over time.
    • Add nodes and edges to represent agents and their interactions.
    • Can be used like other Lang chain tools.
  • Multi-Agent Workflow Variants:
    1. Multi-Agent Collaboration:
      • Agents share a state of messages, adding to a global message state over time.
      • Example includes a researcher agent and a chart generator agent.
      • Workflow involves researcher querying, calling tools, and chart generator visualizing results.
    2. Agent Supervisor:
      • Supervisor routes tasks between independent agents.
      • Agents work independently and return final answers to the supervisor.
      • Supervisor only sees final outputs, not the internal process of agents.
    3. Hierarchical Agent Team:
      • Similar to Agent Supervisor but with sub-teams having their own supervisors.
      • Each agent node is a supervisor-agent setup, creating a more complex hierarchy.
  • Practical Implementation:
    • Demonstrated using Lang Smith for debugging.
    • Showed how to define helper functions, create agents, and set up graphs.
    • Walked through examples of each workflow variant, including the setup and execution of tasks.
    • Highlighted the benefits of compartmentalizing functions within a system.
  • Conclusion:
    • Multi-agent workflows help in organizing complex tasks and provide a clear mental model for system functions.
    • L graph offers flexibility in creating various multi-agent workflows.
    • Encourages exploration of other potential multi-agent workflow configurations with L graph.