Please enable JavaScript.
Coggle requires JavaScript to display documents.
L4 - Langchain vs LangGraph - Coggle Diagram
L4 - Langchain vs LangGraph
Challenges in LangChain
Control Flow Complexity
conditional loops, branch, jumps
Glue code in case of langchain
State Handling
LC workflows are stateless
We'll have to maintain global dictionary mannually
Event Driven Execution
Pause and wait for some external trigger
LangGraph - Checkpointer
Fault Tolerance
LangChain ---> short task ---> Run at once
LangGraph
Small Issue - Retry
Big Issue - Recovery using checkpointers, persistence layer, Resume previous state
Human in the loop
LangChain - Not possible for long running workflows - Compute Resource
HITL present by default in LangGraph
Nested Workflows
SubGraph - Graph that is used as a node in another graph
Reusability of graphs
Observability
LangSmith - Partial Observability due to glue code
Monitor all states in LangGraph
When to Use LangChain
Simple, Linear, Sequential
Basic Rag, Prompt Chains
When to use LangGraph
Complex, Non Linear workflows
Conditional execution paths, Loops, Retries
HITL, event driven execution
Capabilities of LangGraph
State Management
Conditional Branching
Looping
Pause and Resume Execution
Fault Tolerance and Recovery