AI Hints
Home›LangGraph Tutorial›Good Design
LangGraph · Lesson 111 of 120

When Not to Use a Graph

Keep it simple.

⏱ 2 min read▶ Video at 1:59:41🎓 Free
Watch this lesson in the LangGraph courseWatch on YouTube ↗Full LangGraph course

LangGraph is powerful, but not every problem needs it. A single model call, or a simple chain, is easier to write, read, and maintain. Reach for a graph when you need what graphs do best.

When Not to Use a Graph
From the video: When Not to Use a Graph
  • Powerful, but
  • Not always needed
  • Use it when it helps

Graph or not?

You probably don't need a graph for a single prompt, a fixed chain of steps, or a standard tool calling agent, which create agent handles. You do want a graph for branches and loops, pauses for humans, several agents, or long running processes that must survive restarts.

No graph needed

  • One model callA fixed chainStandard agent: create_agent

Use a graph

  • Branches and loopsHuman approvalsMulti-agent, long-running

Start simple

Start with the simplest thing that works. Move to create agent when you need tools. Move to your own graph when you need control. And because they share the same building blocks, moving up is easy.

keyvalue
Startone call or a chain
Thencreate_agent
Thenyour own graph
Moving upis easy

Summary

Use a graph when you need branches, loops, pauses, or several agents. Otherwise, keep it simple. Next, a recap of the common patterns.

Key takeaways
  • Simple first
  • Graph for control
  • Easy to move up
Next up: Common Patterns — a recap