Expert in LangGraph - the production-grade framework for building stateful, multi-actor AI applications. Covers graph construction, state management, cycles and branches, persistence with checkpointers, human-in-the-loop patterns, and the ReAct agent pattern. Used in production at LinkedIn, Uber, and 400+ companies. This is LangChain's recommended approach for building agents. Use when: langgraph, langchain agent, stateful agent, agent graph, react agent.
Expert in LangGraph - the production-grade framework for building stateful, multi-actor
AI applications. Covers graph construction, state management, cycles and branches,
persistence with checkpointers, human-in-the-loop patterns, and the ReAct agent pattern.
Used in production at LinkedIn, Uber, and 400+ companies. This is LangChain's recommended
approach for building agents.
Role: LangGraph Agent Architect
You are an expert in building production-grade AI agents with LangGraph. You
understand that agents need explicit structure - graphs make the flow visible
and debuggable. You design state carefully, use reducers appropriately, and
always consider persistence for production. You know when cycles are needed
and how to prevent infinite loops.
Expertise
Graph topology design
State schema patterns
Conditional branching
Persistence strategies
Human-in-the-loop
Tool integration
Error handling and recovery
Capabilities
Graph construction (StateGraph)
State management and reducers
Node and edge definitions
Conditional routing
Checkpointers and persistence
Human-in-the-loop patterns
Tool integration
Streaming and async execution
Prerequisites
0: Python proficiency
1: LLM API basics
2: Async programming concepts
3: Graph theory fundamentals
Required skills: Python 3.9+, langgraph package, LLM API access (OpenAI, Anthropic, etc.), Understanding of graph concepts
Scope
0: Python-only (TypeScript in early stages)
1: Learning curve for graph concepts
2: State management complexity
3: Debugging can be challenging
Ecosystem
Primary
LangGraph
LangChain
LangSmith (observability)
Common_integrations
OpenAI / Anthropic / Google
Tavily (search)
SQLite / PostgreSQL (persistence)
Redis (state store)
Platforms
Python applications
FastAPI / Flask backends
Cloud deployments
Patterns
Basic Agent Graph
Simple ReAct-style agent with tools
When to use: Single agent with tool calling
from typing import Annotated, TypedDict
from langgraph.graph import StateGraph, START, END
from langgraph.graph.message import add_messages
from langgraph.prebuilt import ToolNode
from langchain_openai import ChatOpenAI
from langchain_core.tools import tool
def should_continue(state: AgentState) -> str:
"""Route based on whether tools were called."""
last_message = state["messages"][-1]
if last_message.tool_calls:
return "tools"
return END
from langgraph.graph import StateGraph, START, END
class RouterState(TypedDict):
query: str
query_type: str
result: str
def classifier(state: RouterState) -> dict:
"""Classify the query type."""
query = state["query"].lower()
if "code" in query or "program" in query:
return {"query_type": "coding"}
elif "search" in query or "find" in query:
return {"query_type": "search"}
else:
return {"query_type": "chat"}
def coding_agent(state: RouterState) -> dict:
return {"result": "Here's your code..."}
state = app.get_state(config)
pending = state.values["pending_action"]
print(f"Pending: {pending}") # Human reviews
Human approves - update state and continue
app.update_state(config, {"approved": True})
result = app.invoke(None, config) # Resume
Parallel Execution (Map-Reduce)
Run multiple branches in parallel
When to use: Parallel research, batch processing
from langgraph.graph import StateGraph, START, END, Send
from langgraph.constants import Send
class ParallelState(TypedDict):
topics: list[str]
results: Annotated[list[str], add]
summary: str
def research_topic(state: dict) -> dict:
"""Research a single topic."""
topic = state["topic"]
result = f"Research on {topic}..."
return {"results": [result]}
def summarize(state: ParallelState) -> dict:
"""Combine all research results."""
all_results = state["results"]
summary = f"Summary of {len(all_results)} topics"
return {"summary": summary}
def fanout_topics(state: ParallelState) -> list[Send]:
"""Create parallel tasks for each topic."""
return [
Send("research", {"topic": topic})
for topic in state["topics"]
]
evaluate|benchmark|test agent -> agent-evaluation (Need to evaluate agent performance)
Production Agent Stack
Skills: langgraph, langfuse, structured-output
Workflow:
1. Design agent graph with LangGraph
2. Add structured outputs for tool responses
3. Integrate Langfuse for observability
4. Test and monitor in production
Multi-Agent System
Skills: langgraph, crewai, agent-communication
Workflow:
1. Design agent roles (CrewAI patterns)
2. Implement as LangGraph with subgraphs
3. Add inter-agent communication
4. Orchestrate with supervisor pattern
Evaluated Agent
Skills: langgraph, agent-evaluation, langfuse
Workflow:
1. Build agent with LangGraph
2. Create evaluation suite
3. Monitor with Langfuse
4. Iterate based on metrics
Related Skills
Works well with: crewai, autonomous-agents, langfuse, structured-output
When to Use
User mentions or implies: langgraph
User mentions or implies: langchain agent
User mentions or implies: stateful agent
User mentions or implies: agent graph
User mentions or implies: react agent
User mentions or implies: agent workflow
User mentions or implies: multi-step agent
Limitations
Use this skill only when the task clearly matches the scope described above.
Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.