本页还没有译文
本页 5 段还没译成日本語,下面显示的是英文原文。GRAPH_RECURSION_LIMIT
还没翻译译自英文(docs.langchain.com)本页 5 段都还没译
Your LangGraph StateGraph reached the maximum number of steps before hitting a stop condition.
This is often due to an infinite loop caused by code like the example below:
import { StateGraph, StateSchema } from "@langchain/langgraph";
import { z } from "zod/v4";
const State = new StateSchema({
someKey: z.string(),
});
const builder = new StateGraph(State)
.addNode("a", ...)
.addNode("b", ...)
.addEdge("a", "b")
.addEdge("b", "a")
...
const graph = builder.compile();However, complex graphs may hit the default limit naturally.
Troubleshooting
-
If you are not expecting your graph to go through many iterations, you likely have a cycle. Check your logic for infinite loops.
-
If you have a complex graph, you can pass in a higher
recursionLimitvalue into yourconfigobject when invoking your graph like this:
await graph.invoke({...}, { recursionLimit: 1000 });AI 翻译查看英文原文