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

Designing Graphs

Small nodes.

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

A good graph reads like a flowchart a colleague could understand. Each node does one job, and has a name that says what it does. Branches are clear, and every loop has an exit.

Designing Graphs
From the video: Designing Graphs
  • Reads like a flowchart
  • One job per node
  • Clear branches, safe loops

Graph rules

Give each node one job, and a verb for a name, like triage, or check stock. Keep model calls and plain code in separate nodes, so each can be tested. Make every loop's exit obvious. And draw the graph often, to check its shape.

keyvalue
One jobper node
Namesverbs
Separatemodel and code
Draw itcheck the shape

A well-shaped graph

Our support desk is a good example. A clear entry. One decision point. Specialists that each own an area. And a single path to the end for each request.

  1. Entry
  2. Triage
  3. Specialist
  4. Reply
  5. END
A well-shaped graph
From the video: A well-shaped graph

Summary

Good graphs have small, well named nodes, clear branches, and loops with obvious exits. Next, when you shouldn't use a graph at all.

Key takeaways
  • One job per node
  • Verb names
  • Draw it often
Next up: When Not to Use a Graph — keep it simple