AI Hints
Home›LangChain Tutorial›The Bigger Picture
LangChain · Lesson 115 of 120

LangChain vs LangGraph

When to use which.

⏱ 2 min read▶ Video at 2:11:06🎓 Free
Watch this lesson in the LangChain courseWatch on YouTube ↗Full LangChain course

You've probably noticed LangGraph in our imports, for the checkpointer. LangChain's agents actually run on LangGraph underneath. So when should you use LangGraph directly?

LangChain vs LangGraph
From the video: LangChain vs LangGraph
  • LangGraph in our imports
  • Agents run on it
  • When to use it directly

Which one?

Use LangChain for most apps. Chains, RAG, and agents built with create agent, which handles the loop for you. Use LangGraph when you need full control of the flow. Custom steps, branches, loops, several agents working together, or workflows that pause for days, waiting for a human.

LangChain

  • Chains and RAGcreate_agent loopFast to build

LangGraph

  • Your own graph of stepsBranches and loopsMulti-agent, long pauses

They work together

It isn't either or. LangChain's models, tools, prompts, and retrievers all work inside LangGraph. Many teams start with create agent, and move parts to LangGraph only when they need more control.

keyvalue
Sharedmodels, tools, prompts
Startwith create_agent
Movewhen you need control
Bothsame ecosystem

Summary

LangChain is the fast way to build chains and agents. LangGraph gives full control of complex flows. They share the same building blocks. Next, the wider LangChain ecosystem.

Key takeaways
  • LangChain: most apps
  • LangGraph: full control
  • Same building blocks
Next up: The Ecosystem — integrations