LangGraph

Introduction

  • It is a library for building stateful, multi-actor applications with LLMs, used to create agent and multi-agent workflows.

  • Cycles and Branching: Implement loops and conditionals in your apps.

  • Persistence: Automatically save state after each step in the graph. Pause and resume the graph execution at any point to support error recovery, human-in-the-loop workflows, time travel and more.

  • Human-in-the-Loop: Interrupt graph execution to approve or edit next action planned by the agent.

  • Streaming Support: Stream outputs as they are produced by each node (including token streaming).

  • Integration with LangChain: LangGraph integrates seamlessly with LangChainarrow-up-right and LangSmitharrow-up-right (but does not require them).

Example

  • The main file is for API end point, streaming the answer for output

  • The graph is to define the workflow , node, the relationship of the node

  • The panda file is to initialize the DB connection to the database

  • The chat function of each node

Last updated