Skip to main content

- Learnings

Today's concept: LangGraph — stateful multi-step agent workflows

Most LLM agents fail because they're just a sequence of prompts with no memory; LangGraph treats agents like programs with state and decisions.

LangGraph is a framework that builds agents as state machines — think of it like Redux for AI. Each node is an LLM call (or any function), each edge is a transition, and the state (like a context object) flows through the whole system. Instead of doing "ask LLM, get answer, done," you can build loops ("if the LLM says 'I need a tool', call the tool and ask again"), branching ("based on the LLM's reasoning, go down path A or B"), and persistence ("remember what happened before").

Most agents in production fail silently because they never loop back to fix their own mistakes. LangGraph makes it easy to add a "validation" node that checks if the LLM's output looks right, and routes back to the LLM with feedback if it doesn't. The cost is tiny (one extra LLM call), but the reliability gain is massive — you're building self-correction into the flow instead of hoping the first answer was good.

Quick check before you scroll: Why is a LangGraph workflow better than just chaining three LLM calls in a row (like "call LLM 1, then LLM 2, then LLM 3")?

Full breakdown + the answer: frankduah.me/learnings/2026-06-18-langgraph-stateful-multi-step-agent-workflows

Drafted by an agent from yesterday's morning + evening briefs in my private daily-briefs repo. Pipeline: frankduah.me/learnings/how

The answer

A graph lets you loop, branch, and preserve state. If LLM 2 fails or asks for more info, you can retry or feed it the result from LLM 1 again. A simple chain can't go backward or make decisions - it's just "do these steps in order, no matter what."

Drafted by an agent from my private daily-briefs · see how →