mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-08 02:37:52 +02:00
[docs]: recursion limit info (#1501)
* draft * vadym comments * spelling * final nits * final nits
This commit is contained in:
@@ -38,6 +38,7 @@ _MANUAL = {
|
||||
"visualization.ipynb",
|
||||
"state-model.ipynb",
|
||||
"subgraph.ipynb",
|
||||
"recursion-limit.ipynb",
|
||||
"force-calling-a-tool-first.ipynb",
|
||||
"pass-run-time-values-to-tools.ipynb",
|
||||
"tool-calling.ipynb",
|
||||
|
||||
@@ -401,7 +401,17 @@ def node_a(state, config):
|
||||
...
|
||||
```
|
||||
|
||||
See [this guide](../how-tos/configuration.ipynb) for a full breakdown on configuration
|
||||
See [this guide](../how-tos/configuration.ipynb) for a full breakdown on configuration.
|
||||
|
||||
### Recursion Limit
|
||||
|
||||
The recursion limit sets the maximum number of [super-steps](#graphs) the graph can execute during a single execution. Once the limit is reached, LangGraph will raise `GraphRecursionError`. By default this value is set to 25 steps. The recursion limit can be set on any graph at runtime, and is passed to `.invoke`/`.stream` via the config dictionary. Importantly, `recursion_limit` is a standalone `config` key and should not be passed inside the `configurable` key as all other user-defined configuration. See the example below:
|
||||
|
||||
```python
|
||||
graph.invoke(inputs, config={"recursion_limit": 5, "configurable":{"llm": "anthropic"}})
|
||||
```
|
||||
|
||||
Read [this how-to] to learn more about how the recursion limit works.
|
||||
|
||||
## Breakpoints
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ These how-to guides show how to achieve that controllability.
|
||||
- [How to create subgraphs](subgraph.ipynb)
|
||||
- [How to create branches for parallel execution](branching.ipynb)
|
||||
- [How to create map-reduce branches for parallel execution](map-reduce.ipynb)
|
||||
|
||||
- [How to control graph recursion limit](recursion-limit.ipynb)
|
||||
|
||||
## Persistence
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@ nav:
|
||||
- Create subgraphs: how-tos/subgraph.ipynb
|
||||
- Create branches for parallel execution: how-tos/branching.ipynb
|
||||
- Create map-reduce branches for parallel execution: how-tos/map-reduce.ipynb
|
||||
- Control graph recursion limit: how-tos/recursion-limit.ipynb
|
||||
- Persistence:
|
||||
- Add persistence ("memory"): how-tos/persistence.ipynb
|
||||
- Manage conversation history: how-tos/memory/manage-conversation-history.ipynb
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user