Graph, State Machine, or Plain Loop: How to Structure an Agent
How to choose how to structure an agent: the plain while loop, the explicit state machine, and the full graph. What each gives you, what each costs, and when to move up.
6 articles
How to choose how to structure an agent: the plain while loop, the explicit state machine, and the full graph. What each gives you, what each costs, and when to move up.
How to stream LLM tokens, tool progress, and state updates from a LangGraph agent using the v2 stream API, with the custom writer pattern most people miss.
What state, checkpoints, and threads actually are in LangGraph, how to pick a checkpointer, and how persistence powers memory, resume, and human-in-the-loop.
A clear split between an agent's working memory and its cross-session memory, with LangGraph code for checkpointers, stores, and the semantic/episodic/procedural breakdown.
Traditional RAG retrieves once and hopes for the best. Agentic RAG lets the model decide whether, what, and how to retrieve, then check its own work. Here is the difference, with code.
Agents, explained without the hype: what they are, when one is enough, when you need several, and how to build a working multi-agent system with LangChain.