๐Ÿš€
๐Ÿ•ธ๏ธ LangGraph
AI

Langgraph

A journey from single LLM calls to recursive agent state machines.

Mar 202510 min read

What is LangGraph?

A framework for building controllable, persistent agent workflows with built-in support for human interaction, streaming, and state management. It uses the Graph Data Structure to achieve this.


Levels of Autonomy in LLM applications

To understand LangGraph, we first need to look at how LLM applications have evolved in terms of autonomy.

1. Code

  • Code has zero autonomy and is 100% deterministic.
  • Everything is hard-coded; it is not a cognitive architecture.
  • Disadvantage: You'd need to write rules for every possible scenario - making it impossible to handle real-world complexity.

2. LLM call

  • A single LLM call means your app basically does one main thing - you give it an input, it processes it, and gives you back an output.
  • Think of chatbots that just take your message and respond, or apps that translate text.
  • This was a huge leap from hard-coded rules, but it's still simple and is only in the 2nd stage of autonomy.
  • Disadvantage: Trying to get everything done in one shot often leads to confused or mixed responses.

3. Chains

  • Think of chains like having multiple specialists instead of one generalist. We break it down into steps where each AI is really good at one thing.
  • Imagine a customer service chatbot: The first AI reads your complaint, the second AI finds the right solution from help docs, and the third AI turns that solution into a friendly response.
  • Disadvantage: These fixed sequences are like a rigid assembly line - they always follow the same steps defined by the human.

4. Router

  • Now this is where it gets interesting - routers are like smart traffic cops. Instead of a fixed path, the AI itself decides what steps to take next.
  • Imagine a personal assistant bot: it figures out if you need help with scheduling, research, or calculations, then routes your request to the right tool.
  • Disadvantage: While it can choose different paths, it still can't remember previous conversations or learn from mistakes.

5. State Machine (Agent)

  • This combines the Router level but with loops.
  • Agent ~= control flow controlled by an LLM.
  • Features: Human-in-the-loop (approval), Multi-agent systems, Advanced memory management, and the ability to go back in history.

This is where LangGraph comes into the picture.

LevelCategoryDescriptionDecide Output of StepDecide Which Steps to TakeDecide What Steps are Available to Take
1Human-DrivenCode๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป
2LLM Call (one step only)๐Ÿฆพ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป
3Chain (multiple steps)๐Ÿฆพ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป
4Router (no cycles)๐Ÿฆพ๐Ÿฆพ๐Ÿ‘ฉโ€๐Ÿ’ป
5Agent-ExecutedState Machine (cycles)๐Ÿฆพ๐Ÿฆพ๐Ÿ‘ฉโ€๐Ÿ’ป
6Autonomous๐Ÿฆพ๐Ÿฆพ๐Ÿฆพ

Agents in LangGraph

The architecture of an agent in LangGraph can be visualized as a cycle of reasoning and action:


Core Building Blocks

While the Agent Loop is the high-level architecture, LangGraph implements this using three core components and a standardized implementation workflow:


Key features of LangGraph

  1. Looping and Branching Capabilities: Supports conditional statements and loop structures, allowing dynamic execution paths based on state.
  2. State Persistence: Automatically saves and manages state, supporting pause and resume for long-running conversations.
  3. Human-Machine Interaction Support: Allows inserting human review during execution, supporting state editing and modification.
  4. Streaming Processing: Supports streaming output and real-time feedback on execution status.
  5. Seamless Integration with LangChain: Reuses existing LangChain components and supports LCEL expressions.

ยฉ 2026 Driptanil Datta. All rights reserved.

Software Developer & Engineer

Disclaimer:The content provided on this blog is for educational and informational purposes only. While I strive for accuracy, all information is provided "as is" without any warranties of completeness, reliability, or accuracy. Any action you take upon the information found on this website is strictly at your own risk.

Copyright & IP:Certain technical content, interview questions, and datasets are curated from external educational sources to provide a centralized learning resource. Respect for original authorship is maintained; no copyright infringement is intended. All trademarks, logos, and brand names are the property of their respective owners.

System Operational

Built with Love โค๏ธ | Last updated: Mar 16 2026