What is LangGraph?Stateful AI Agent Workflows Explained
LangGraph is a Python framework for building stateful, graph-based AI agent workflows. Where simple LLM chains process inputs linearly, LangGraph lets you define workflows as nodes, edges, and state transitions — with conditional branching, loops, tool calling, human-in-the-loop approval gates, and checkpointing built in. It is the production standard for building complex, controllable AI agent systems.
This guide covers what LangGraph is, how it works, key concepts, how it compares to LangChain and CrewAI, integration with RAG and MCP, use cases, best practices, skills needed, and a learning path to get started.
LangGraph Quick Facts
| Item | Explanation |
|---|---|
| What LangGraph is | A Python framework for building stateful, graph-based AI agent workflows and LLM applications |
| Main purpose | Orchestrate complex AI workflows where state, branching, loops, and conditional routing matter |
| Used with | LangChain components, OpenAI / Anthropic / Gemini LLMs, custom tools, RAG retrievers, MCP servers |
| Key concepts | Graph, nodes, edges, state, conditional routing, cycles, checkpoints, human-in-the-loop, supervisor patterns |
| Best use cases | Multi-step agents, human approval workflows, RAG evaluation pipelines, multi-agent systems, enterprise process automation |
| Main benefit | Explicit state management and conditional control — makes complex agent logic debuggable and auditable |
| Main limitation | Steeper learning curve than simple chain frameworks; graph design complexity grows with workflow complexity |
| Related Technovids resource | LangGraph vs CrewAI comparison at /langgraph-vs-crewai |
What is LangGraph?
LangGraph is a framework for building stateful, graph-based LLM and AI agent applications where workflows are represented as nodes, edges, and state transitions. Developed within the LangChain ecosystem, LangGraph extends LangChain's component model with a graph execution layer that supports cycles, conditional routing, checkpointing, and human-in-the-loop patterns.
In a LangGraph workflow, each node performs one processing step — an LLM call, a retrieval, a tool call, a validation check, or any custom function. Edges connect nodes and can be conditional — routing to different next steps depending on the current workflow state. The state is a typed Python object shared across all nodes, persisting everything the workflow has seen and done.
One sentence version
LangGraph turns complex AI agent logic — with state, branching, retries, and human approval — into an explicit, debuggable directed graph.
Why LangGraph Matters
Simple chatbot logic — user sends a message, model responds — does not need a graph framework. But production AI systems often need something more structured.
Production agents need state
A multi-step research agent needs to remember what it has already retrieved, what tools it has called, and what decisions it has made. A linear LLM call chain has no persistent state across steps. LangGraph's typed state object carries this information across the entire workflow.
Workflows need branching
Should the agent retrieve more information, call a calculator tool, or directly generate an answer? That decision depends on context. LangGraph conditional edges route to the right next node based on the current state — without hacky if/else logic outside the framework.
Complex workflows need loops
Retrieval quality might be insufficient on the first attempt. An agent might need to try a tool call, check the result, and retry with different parameters. LangGraph supports cycles — the graph can loop back to a previous node until a condition is satisfied, up to a configurable maximum.
Human approval may be needed
Sensitive actions — sending an email, updating a database record, approving a payment — should require human confirmation before execution. LangGraph's human-in-the-loop checkpoints pause the workflow at defined steps and resume only after a human approves or modifies the pending action.
Debugging and auditability matter
When an agent makes a wrong decision, you need to know which node produced bad output, what state it received, and which edge routing logic was triggered. LangGraph's explicit graph model — combined with LangSmith tracing — makes every step visible, reproducible, and debuggable.
LangGraph vs LangChain
LangGraph is built on top of LangChain — not a replacement for it. Understanding the difference between what each one does is important before choosing when to use which. See the What is LangChain guide for a full walkthrough of LangChain's components and architecture.
| Dimension | LangChain | LangGraph |
|---|---|---|
| Main purpose | Component library for LLM applications — loaders, splitters, retrievers, prompts, chains | Graph execution layer for stateful, conditional AI agent workflows |
| Workflow control | Linear chain model (LCEL) — steps execute in sequence | Graph model — any node can route to any other; cycles supported |
| State handling | No persistent state across chain steps by default | Typed state object persists across all nodes throughout workflow |
| Best use case | RAG pipelines, document processing, simple LLM chains | Multi-step agents, complex branching workflows, multi-agent systems |
| Production control | Limited — output passes through, hard to inspect mid-chain | Full control — inspect state after every node; pause for human review |
| Complexity | Low to medium — quick to build retrieval and simple agent patterns | Higher upfront — graph design, state schema, conditional edge logic |
Practical rule
Use LangChain for RAG pipelines, document loading, and simple prompt chains. Use LangGraph when your workflow needs state, branching, loops, or human approval. In production, most sophisticated agent systems use both: LangChain for retrieval and tool integrations, LangGraph for the orchestration layer on top.
How LangGraph Works
Building a LangGraph workflow follows a consistent pattern. Each step produces something concrete — state schemas, node functions, edge routing logic — that you can test and trace independently.
Define graph state
Create a TypedDict (or Pydantic model) that describes all the information your workflow needs to track — the user query, conversation history, retrieved documents, tool results, quality scores, routing decisions, approval flags. Every field your nodes read or write must be in the state schema.
Create nodes
Write Python functions — one per processing step. Each function takes the current state as input, performs its operation (an LLM call, retrieval, tool execution, validation), and returns a dictionary of state updates. Keep nodes focused: each should do one clear thing.
Connect nodes with edges
Wire nodes together with edges. Fixed edges always go from Node A to Node B. Conditional edges call a routing function that inspects the current state and returns which node to go to next — enabling branching and looping.
Add conditional routing
Write routing functions that return node names based on state. For example: if state["quality_score"] < 0.7, route to the "rewrite_query" node; otherwise route to "generate_answer". This is what makes LangGraph workflows dynamic rather than static.
Add tools and model calls
Define tools as Python functions with clear descriptions. Bind them to an LLM using the model's tool-calling API (OpenAI function calling, Anthropic tool use). The LLM node calls the model, inspects the response for tool call requests, and routes to the relevant tool node.
Run the workflow
Compile the graph and invoke it with an initial state. LangGraph executes nodes in order, updating state at each step. With checkpointing enabled, you can pause the workflow at any point, persist the state to a database, resume later, and branch to alternate paths.
Track state and output
After each node executes, the full state is available for inspection. Use LangSmith tracing to see every node input/output, every LLM call and token count, and every conditional routing decision. The final output is extracted from the state at the END node.
LangGraph Architecture Diagram
A typical LangGraph agent workflow: the user query enters, is processed through several nodes with conditional routing, and produces a final response.
User Input
query + context
Graph State
typed state object initialised
Node A — Query Analyser
LLM call · classifies intent · updates state
Node B — Retriever
RAG retrieval · chunk reranking
Node C — Tool Call
API / calculator / MCP tool
Node D — Evaluator
quality check · loop if insufficient
Human-in-the-Loop Checkpoint (optional)
pause · human reviews · approve or modify
Final Response + Citations
extracted from state at END node
Every node reads the current state, performs its operation, and writes state updates. Conditional edges route to different nodes based on the state. The workflow can loop back to earlier nodes (e.g. Node A → Retriever → Evaluator → Retriever again) until a quality condition is met.
Key Concepts in LangGraph
Graph
The complete workflow structure — a set of nodes connected by edges. Compiled from a StateGraph object.
Nodes
Processing steps in the workflow. Each node is a Python function that receives state, performs an operation, and returns state updates.
Edges
Connections between nodes. Can be fixed (always A → B) or conditional (routes based on state values).
State
A typed Python object shared across all nodes. Persists everything the workflow has seen and decided. Defined as TypedDict or Pydantic model.
Conditional routing
A routing function that inspects state and returns which node to go to next — enabling branching logic without if/else outside the graph.
Cycles
LangGraph supports loops — a node can route back to an earlier node. Used for retry logic, quality improvement loops, and iterative refinement.
Checkpoints
Snapshots of graph state saved at key steps. Enable pause/resume, branching to alternate paths, time-travel debugging, and human-in-the-loop patterns.
Tools
Python functions the LLM can call as part of its response — search, retrieval, calculator, database queries, API calls. Bound to the LLM via tool schemas.
Human-in-the-loop
A pattern where the workflow pauses at a defined checkpoint and waits for human input before continuing. Critical for sensitive enterprise actions.
Supervisor patterns
A multi-agent architecture where a supervisor LangGraph node routes sub-tasks to specialised sub-agent nodes — research agent, writing agent, review agent, etc.
LangGraph and AI Agents
LangGraph is specifically designed for building AI agents — systems that can plan, take actions, observe results, and adapt over multiple steps. Traditional LLM applications respond in a single step; agents reason and act across many.
Planning
A LangGraph node can use an LLM to decompose a complex goal into a sequence of sub-tasks, storing the plan in state. Subsequent nodes execute each step. The plan can be revised mid-workflow if a step fails or returns unexpected results.
Tool calling
Nodes can call any registered tool — a web search, a code executor, a database query, a RAG retriever, a calculator, or an MCP server. The LLM decides which tools to call based on the query and state; LangGraph routes to the corresponding tool nodes.
State persistence
Unlike a single LLM call, a LangGraph agent maintains state across many steps. It knows what it has already tried, what tool results it has received, and what quality checks it has passed. This is what enables multi-step, multi-tool reasoning.
Step-by-step execution
LangGraph makes every step of an agent's reasoning explicit — which node ran, what state it received, what it produced, which edge was taken. This auditability is essential for enterprise deployments where agent decisions need to be explainable.
Controlled workflows
LangGraph lets you set maximum cycle counts (preventing infinite loops), add required checkpoints, define fallback nodes for error conditions, and enforce maximum step budgets. You stay in control of what the agent can and cannot do.
For the full guide to what AI agents are, how they work, and the types of agents used in enterprise systems, see the What Are AI Agents guide.
LangGraph and Agentic AI
Agentic AI describes systems that autonomously plan, act, and adapt across multiple steps to complete a goal — rather than responding once and stopping. LangGraph provides the structural foundation that makes agentic AI workflows deterministic, controllable, and production-ready.
Planning
A planner node decomposes goals and stores sub-tasks in state; executor nodes work through them in sequence or parallel
Actions
Tool nodes execute specific actions — API calls, search, file operations, database writes — triggered by conditional routing
Observation
Each node returns its results to state; subsequent nodes can read tool outputs and adjust behaviour accordingly
Human review
Checkpoints pause the workflow before sensitive actions; a human inspector can approve, reject, or modify the pending action before continuing
Iteration
Quality evaluation nodes check outputs; conditional edges loop back to earlier steps if quality is insufficient, up to a maximum retry count
Auditability
LangSmith tracing records every node, state change, LLM call, and routing decision — enabling post-hoc review of every agent action
For the complete guide to agentic AI system design — what it means, how it differs from traditional automation, and the enterprise considerations — see the Agentic AI Explained guide.
LangGraph and RAG
LangGraph is particularly powerful for orchestrating RAG workflows that go beyond the simple retrieve → generate chain. A basic LangChain RAG chain always retrieves the same way and always generates from whatever it retrieved. A LangGraph RAG workflow can adapt.
Example: adaptive LangGraph RAG workflow
Node 1 — Query rewriter: LLM rewrites the user query into an optimised retrieval query
Node 2 — Retriever: Vector search retrieves top-20 candidates from the knowledge base
Node 3 — Reranker: Cross-encoder reranker selects top-5 most relevant chunks
Conditional edge: If context precision score < 0.7, route back to rewriter with feedback; else continue
Node 4 — Generator: LLM generates an answer grounded in the top-5 chunks
Node 5 — Evaluator: Checks faithfulness of the answer against retrieved context
Conditional edge: If faithfulness < 0.8, loop back to generator with instructions to be more conservative
END: Return answer with source citations
This pattern is described in detail — including all 13 production layers, evaluation setup, and deployment — in the Production RAG System Architecture guide.
LangGraph and MCP
LangGraph workflows can use any Python function as a tool — including functions that communicate with MCP (Model Context Protocol) servers. MCP standardises how AI agents discover, authenticate, and call tools and data sources — replacing one-off custom integrations with a uniform protocol.
What MCP adds to LangGraph
- ▸Standardised tool discovery — LangGraph nodes can query an MCP server for its available tools at runtime
- ▸Reusable tool integrations — build one MCP server for your file system or database; any LangGraph workflow can use it
- ▸Consistent authentication and access control across all tool connections
- ▸Works with any MCP-compatible AI client alongside LangGraph deployments
MCP-connected LangGraph pattern
- ▸LangGraph workflow identifies which tool is needed via the LLM node
- ▸Tool node calls MCP client to invoke the relevant MCP server tool
- ▸MCP server returns structured result to the LangGraph node
- ▸Result is stored in state; workflow continues based on conditional routing
- ▸Same LangGraph workflow can use multiple MCP servers as interchangeable tool sources
For the full guide to MCP architecture, how MCP servers work, and enterprise MCP patterns, see the Model Context Protocol guide.
LangGraph Use Cases
Multi-step research assistant
Plans research tasks, queries multiple tools, synthesises findings across retrieved documents, evaluates completeness, and produces a structured report with citations.
Customer support triage workflow
Classifies incoming tickets, searches the knowledge base, drafts a response, evaluates response quality, and either sends automatically or escalates to a human with full context.
Human approval workflow
Drafts an action (email, database update, contract clause), presents it to a human reviewer via checkpoint, waits for approval or modification, then executes only after confirmation.
RAG evaluation workflow
Runs queries against a RAG pipeline, evaluates each response for faithfulness and context precision, identifies low-scoring cases, and flags them for knowledge base review.
Document review assistant
Ingests a document set, extracts specified fields from each document, cross-references inconsistencies, produces per-document summaries, and generates a consolidated analysis.
Coding assistant workflow
Interprets a feature specification, generates code, runs tests, inspects test output, fixes failures, iterates up to a maximum attempt count, then produces a diff for human review.
Enterprise process assistant
Multi-agent system with a supervisor LangGraph node routing sub-tasks (information retrieval, computation, document generation, approval request) to specialised sub-agents.
LangGraph vs CrewAI: Short Summary
LangGraph and CrewAI are both widely used for AI agent workflows, but with different design philosophies. This is a short summary — for the detailed comparison covering architecture, state management, production readiness, and decision guidance, see the LangGraph vs CrewAI comparison.
LangGraph is stronger for
- ▸Explicit stateful workflows with complex branching
- ▸Deterministic retry and fallback logic
- ▸Human approval gates and compliance audit trails
- ▸Multi-agent systems with supervisor routing
- ▸Production debugging and observability via LangSmith
CrewAI is often easier for
- ▸Role-based multi-agent prototypes
- ▸Research, analysis and content workflows
- ▸Beginners who find role/goal design more intuitive
- ▸Getting a working multi-agent demo quickly
- ▸Workflows that naturally map to team-of-specialists model
Most production AI engineers learn both. The right tool depends on your specific workflow and team. See the full comparison →
LangGraph vs Traditional Workflow Automation
| Dimension | Traditional Workflow Automation | LangGraph |
|---|---|---|
| Rule-based flows | Explicit rules determine every step — "if X then Y" | LLM reasoning determines routing — adapts to input context, not just fixed rules |
| AI reasoning | None — deterministic rule execution | LLM nodes reason about inputs; conditional edges route based on model output |
| Tool use | Call predefined APIs in a fixed sequence | LLM dynamically selects which tools to call based on the query and current state |
| State | Session-level variables; limited cross-step persistence | Typed state object accumulates all decisions, results, and history across the full workflow |
| Flexibility | Low — adding new branches requires code changes | High — add new nodes and conditional edges without restructuring existing logic |
| Risk | Predictable but limited to what rules cover | More capable but requires evaluation and monitoring to manage LLM unpredictability |
| Human review | Typically not built in | Native support via checkpoints — pause, human reviews, resume after approval |
Benefits of LangGraph
Better workflow control
You design the exact flow — every node, every edge, every routing condition. Nothing happens outside the graph.
Explicit state management
State is a typed Python object. You know exactly what it contains, how each node updates it, and what every routing decision is based on.
Branching and conditional logic
Route different query types through different processing paths. Handle errors, retries, and fallbacks as first-class graph patterns.
Human-in-the-loop support
Pause the workflow at any defined checkpoint. Resume only after a human reviews and approves — built into the graph model, not bolted on.
Production agent structure
Checkpointing, tracing, LangSmith integration, and configurable recursion limits are all available out of the box — not custom implementations.
Easier reasoning about agent steps
Each node has a clear input (state), operation, and output (state update). You can inspect any step in isolation, reproduce failures, and debug systematically.
Limitations of LangGraph
Learning curve
Understanding directed graphs, typed state schemas, node design, and conditional edge routing takes time. LangGraph requires more upfront conceptual work than simply chaining LLM calls or using CrewAI's role-based model.
Graph design complexity
As workflows grow — more nodes, more conditional paths, more sub-agents — the graph design becomes harder to reason about. Without disciplined node scoping and clear state schemas, graphs can become difficult to maintain.
Debugging still requires discipline
LangGraph makes debugging possible; it does not make it automatic. You need to add LangSmith tracing, inspect state at key checkpoints, and write unit tests for individual nodes. Complex graphs with poorly designed state are still hard to debug.
Not a magic autonomy layer
LangGraph structures agent execution — it does not make agents more capable on its own. Agent quality still depends on LLM capability, tool quality, prompt design, and retrieval quality. A badly designed agent in LangGraph is still a badly designed agent.
Production deployment still needs work
LangGraph handles workflow orchestration, not deployment. You still need FastAPI wrapping, Docker containerisation, cloud deployment, secrets management, monitoring, evaluation, and security — all the production layers covered in the Production AI Engineering training.
Best Practices for LangGraph
Start with a narrow workflow
Define one clear workflow goal before writing any graph code. Scope creep in graph design leads to unmanageable graphs. Build and test the simplest possible version first.
Define state clearly
Write the full state schema before any nodes. Every field the workflow needs — user query, retrieved chunks, scores, flags, history — should be in the schema from the start. Retrofitting state schema is painful.
Keep nodes small and focused
Each node should do one thing: one LLM call, one retrieval, one validation check. Small, focused nodes are easy to test, debug, and replace independently.
Log every step
Enable LangSmith tracing from the beginning. Inspecting state after each node is the primary debugging mechanism. Add structured logging for production monitoring.
Add evaluation checkpoints
Include a quality evaluation node (faithfulness score, context precision, output format check) before critical branching decisions. Route based on evaluation results, not just model output.
Add human approval for sensitive actions
Any workflow step that takes an irreversible external action — sending an email, writing to a database, approving a purchase — should pause at a checkpoint for human confirmation.
Monitor latency and cost
Track token counts and LLM call counts per workflow execution. A workflow with uncapped retries can incur unexpected LLM costs. Set maximum cycle counts and alert on cost anomalies.
Avoid over-complex graphs
A graph with 20 nodes and 40 conditional edges is a sign of unclear problem decomposition. If your graph is too complex to draw on a whiteboard, refactor into sub-graphs or simplify the workflow scope.
Build production LangGraph agents with live instruction
The Production AI Engineering training builds production-grade LangGraph agents, RAG systems, MCP integrations, and evaluation pipelines with live instructor guidance.
Skills Needed to Use LangGraph
For the complete AI engineer skill map with learning resources for each skill area, see the AI Engineer Skills guide.
LangGraph Project Ideas
Multi-agent research assistant
IntermediateA supervisor LangGraph node routes research sub-tasks to specialist sub-agents — web search agent, RAG retrieval agent, synthesis agent. Outputs a structured research report with citations.
RAG answer validation workflow
IntermediateLangGraph workflow that retrieves documents, generates an answer, evaluates faithfulness with RAGAS, and loops back to improve the answer if faithfulness falls below a threshold.
Customer support triage agent
IntermediateClassifies incoming support queries, searches the knowledge base, drafts a response, evaluates quality, and either sends automatically or pauses at a human-in-the-loop checkpoint for agent review.
Human approval workflow
Beginner–IntermediateDrafts an action (email, form submission, contract update), presents a summary to a human reviewer via checkpoint, resumes only after explicit approval, and logs the approval decision in state.
MCP-connected productivity assistant
AdvancedLangGraph agent that uses MCP tool connections for file access, calendar queries, email search, and web lookup. MCP servers provide the tool layer; LangGraph orchestrates the workflow.
Deployed LangGraph agent API
AdvancedFull production deployment: LangGraph agent wrapped in FastAPI, containerised with Docker, deployed to Cloud Run, with Redis checkpointing, LangSmith tracing, and a CI/CD pipeline.
For full project specifications with architecture requirements, skills demonstrated, and deployment steps, see the AI Engineer Projects guide.
Recommended Technovids Learning Path
| Goal | Resource |
|---|---|
| Understand what AI agents are before learning LangGraph | What Are AI Agents? Guide → |
| Understand agentic AI system design and enterprise context | Agentic AI Explained Guide → |
| Compare LangGraph and CrewAI for your use case | LangGraph vs CrewAI Comparison → |
| Learn LangChain components that LangGraph builds on | What is LangChain? Guide → |
| Understand MCP for tool connections in LangGraph agents | What is MCP? Guide → |
| Build the full AI engineering skill set for production agents | AI Engineer Skills Guide → |
| Build portfolio projects with LangGraph and RAG | AI Engineer Projects Guide → |
| Join structured live AI engineering training | AI Engineering Course → |
| Build production LangGraph agents in a team environment | Production AI Engineering → |
| Explore all Technovids AI engineering resources | AI Engineering Resource Library → |
Want to build production-ready AI agents with LangGraph?
Understanding LangGraph conceptually is the foundation. Building production agent workflows — with state design, tool calling, evaluation, monitoring, and cloud deployment — with live instructor feedback is how the skill actually develops. Technovids covers LangGraph, RAG, MCP integrations, and the full production AI engineering stack in both the AI Engineering Course and the Production AI Engineering programme.
Frequently Asked Questions — LangGraph
What is LangGraph?+
LangGraph is a Python framework for building stateful, graph-based AI agent workflows and LLM applications. It represents workflows as directed graphs where nodes are processing steps (LLM calls, tool calls, custom logic) and edges define transitions between steps — including conditional branching. Built within the LangChain ecosystem, LangGraph adds stateful execution, cycles, checkpointing, and human-in-the-loop support to LLM applications that need more control than simple linear chains provide.
What is LangGraph used for?+
LangGraph is used for building complex AI agent workflows that need state, branching, and controlled execution — including multi-step research assistants, document review workflows, customer support triage agents, human approval pipelines, RAG evaluation workflows, and multi-agent systems where a supervisor routes tasks to specialised sub-agents. It is the production standard for building sophisticated agentic systems where you need to reason about every workflow step and debug deterministically.
Is LangGraph part of LangChain?+
Yes. LangGraph is a library within the LangChain ecosystem, maintained by LangChain Inc. It was built to address the limitations of LangChain's original sequential chain model — specifically, the need for stateful, cyclic, and conditionally branching workflows. LangGraph can use LangChain components (LLMs, tools, retrievers) but can also be used with non-LangChain integrations. If you already use LangChain for RAG pipelines or simple LLM chains, LangGraph is the natural next step when you need agent workflow control.
How is LangGraph different from LangChain?+
LangChain provides components for building LLM applications — document loaders, text splitters, vector store integrations, prompt templates, output parsers, and the LCEL chain composition model. LangGraph uses these components but adds a graph execution layer on top: your workflow is a directed graph with typed state, not a linear chain. This enables conditional branching, loops, cycles, checkpoints, and human approval gates — things LCEL chains cannot express. Use LangChain for retrieval pipelines and simple chains; use LangGraph when your workflow needs state, branching, or agent control.
How is LangGraph different from CrewAI?+
LangGraph uses a graph-based model where you explicitly define every node, edge, and state transition — giving precise control over workflow execution. CrewAI uses a role-based model where agents are defined by role, goal, and backstory and collaborate toward a shared objective — more intuitive for beginners but less controllable. LangGraph is stronger for workflows requiring explicit state checkpointing, deterministic retries, human approval gates, and compliance audit trails. CrewAI is often faster to prototype with for research and content workflows. For the full comparison, see the LangGraph vs CrewAI guide.
Is LangGraph good for production AI agents?+
Yes — LangGraph is widely considered the production standard for complex AI agent workflows. Its explicit state model, conditional routing, checkpointing, and LangSmith tracing integration make it significantly easier to debug, monitor, and reason about than implicit agent frameworks. For production use, you still need to add evaluation, monitoring, security, and deployment infrastructure on top — LangGraph handles workflow orchestration, not the full production stack.
What are nodes and edges in LangGraph?+
In LangGraph, a node is a processing step in the workflow — it can be an LLM call, a tool call, a retriever call, a validation function, or any custom Python function. A node receives the current graph state, performs its operation, and returns an updated state. An edge defines a transition between nodes — either a fixed "always go from Node A to Node B" transition, or a conditional edge that routes to different nodes based on the current state (for example: if the LLM says "insufficient information", route to the retriever; otherwise route to the answer generator).
What is state in LangGraph?+
State in LangGraph is a typed Python object (typically a TypedDict or Pydantic model) that persists and accumulates information across the entire workflow execution. Every node can read from and write to the state. The state might contain: the original user query, retrieved documents, the conversation history, tool results, the current workflow step, a quality score, a human approval flag, or any other information the workflow needs to make decisions. State is what allows LangGraph workflows to have memory, track progress, and make conditional decisions across multiple steps.
Can LangGraph be used with RAG?+
Yes. LangGraph can orchestrate sophisticated RAG workflows that go beyond simple retrieval → generation chains. A LangGraph RAG workflow might: analyse the query to decide the retrieval strategy, retrieve documents, evaluate retrieval quality, conditionally trigger a second retrieval with a rewritten query if quality is low, rerank and filter chunks, generate an answer, evaluate the answer for faithfulness, and either return it or trigger a retry. This kind of conditional, multi-step RAG workflow is difficult to implement cleanly without LangGraph's graph model.
Can LangGraph use MCP tools?+
Yes. LangGraph nodes can call any Python function — including MCP client calls that communicate with MCP servers. This means LangGraph workflows can use tools exposed via MCP (file access, database queries, API calls, web search) as standard node actions. As MCP becomes the enterprise standard for connecting AI agents to tools and data sources, LangGraph workflows will increasingly use MCP servers as their tool layer. See the Model Context Protocol guide for more on how MCP tool connections work.
What skills are needed to learn LangGraph?+
Core skills: Python (including TypedDict or Pydantic for state schemas), LLM API calls (OpenAI, Anthropic, or similar), and prompt engineering. LangGraph-specific skills: understanding directed graphs and state machines conceptually, defining typed state schemas, writing node functions, designing conditional edge routing logic, adding tool integrations, and using LangSmith for tracing and debugging. Production skills: evaluation, FastAPI deployment, Docker, and monitoring. See the AI Engineer Skills guide for the full skill map.
Which Technovids resource should I read next?+
If you are new to AI agents, start with the What Are AI Agents guide. To understand agentic AI workflows broadly, see the Agentic AI Explained guide. To compare LangGraph with CrewAI for your use case, see the LangGraph vs CrewAI comparison. To understand the RAG patterns that LangGraph workflows often orchestrate, see the What is RAG guide. For structured live training building production LangGraph agents, RAG pipelines, and MCP integrations, explore the AI Engineering Course or Production AI Engineering programme.