Back to glossary

Term

LangGraph

LangGraph is an open-source framework from LangChain for stateful, graph-based LLM workflows — nodes are functions or agents, edges define the control flow including loops and branches.

LangGraph — explained in more detail

Where LangChain links LLM calls linearly (a chain), LangGraph models the flow as a directed graph with explicit state. Each node is a function that reads and mutates the shared state; edges — fixed or conditional — decide which node runs next. This enables loops (agent thinks → use tool → think again), branches (different path depending on tool output) and human-in-the-loop pauses. LangGraph is the foundation behind LangChain’s own agent stack and is often deployed in production with LangGraph Cloud.

Example / Practical context

Typical use: a research agent with three nodes — plan, search, summarize. After plan, a condition decides whether more searching is needed or it is time to summarize. After search it loops back to the planner until it signals “done”. The state carries all intermediate results. Persistence and replay are built in, so interrupted runs can be resumed.

LangChain itself remains the simpler tool for linear pipelines (RAG, basic tool use). CrewAI and AutoGen pursue similar multi-agent goals but abstract more heavily over predefined roles rather than an explicit graph. LangGraph is explicitly for developers who want to keep control flow and state in their own hands.

Entdecke mehr