How-to guides¶
Welcome to the LangGraph how-to guides! These guides provide practical, step-by-step instructions for accomplishing key tasks in LangGraph.
Controllability¶
LangGraph is known for being a highly controllable agent framework. These how-to guides show how to achieve that controllability.
- How to create branches for parallel execution
- How to create map-reduce branches for parallel execution
- How to control graph recursion limit
Persistence¶
LangGraph makes it easy to persist state across graph runs (thread-level persistence) and across threads (cross-thread persistence). These how-to guides show how to add persistence to your graph.
- How to add thread-level persistence to your graph
- How to add cross-thread persistence to your graph
- How to use Postgres checkpointer for persistence
- How to create a custom checkpointer using MongoDB
- How to create a custom checkpointer using Redis
Memory¶
LangGraph makes it easy to manage conversation memory in your graph. These how-to guides show how to implement different strategies for that.
Human in the Loop¶
One of LangGraph's main benefits is that it makes human-in-the-loop workflows easy. These guides cover common examples of that.
- How to add breakpoints
- How to add dynamic breakpoints
- How to edit graph state
- How to wait for user input
- How to view and update past graph state
- Review tool calls
Streaming¶
LangGraph is built to be streaming first. These guides show how to use different streaming modes.
- How to stream full state of your graph
- How to stream state updates of your graph
- How to stream LLM tokens
- How to stream LLM tokens without LangChain models
- How to stream custom data
- How to configure multiple streaming modes at the same time
- How to stream events from within a tool
- How to stream events from within a tool without LangChain models
- How to stream events from the final node
- How to stream from subgraphs
- How to disable streaming for models that don't support it
Tool calling¶
- How to call tools using ToolNode
- How to handle tool calling errors
- How to pass runtime values to tools
- How to pass config to tools
- How to handle large numbers of tools
Subgraphs¶
- How to create subgraphs
- How to manage state in subgraphs
- How to transform inputs and outputs of a subgraph
State Management¶
- Use Pydantic model as state
- Have a separate input and output schema
- Pass private state between nodes inside the graph
Other¶
- How to run graph asynchronously
- How to visualize your graph
- How to add runtime configuration to your graph
- How to use a Pydantic model as your state
- How to add node retries
- How to force function calling agent to structure output
- How to pass custom LangSmith run ID for graph runs
- How to return state before hitting recursion limit
Prebuilt ReAct Agent¶
These guides show how to use the prebuilt ReAct agent. Please note that here will we use a prebuilt agent. One of the big benefits of LangGraph is that you can easily create your own agent architectures. So while it's fine to start here to build an agent quickly, we would strongly recommend learning how to build your own agent so that you can take full advantage of LangGraph.
- How to create a ReAct agent
- How to add memory to a ReAct agent
- How to add a custom system prompt to a ReAct agent
- How to add human-in-the-loop processes to a ReAct agent
- How to create prebuilt ReAct agent from scratch