Skip to main content

Documentation Index

Fetch the complete documentation index at: https://nvd-54.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

你的 LangGraph StateGraph 在达到停止条件之前已达到最大步数限制。 这通常是由于无限循环导致的,例如以下代码:
class State(TypedDict):
    some_key: str

builder = StateGraph(State)
builder.add_node("a", ...)
builder.add_node("b", ...)
builder.add_edge("a", "b")
builder.add_edge("b", "a")
...

graph = builder.compile()
然而,复杂的图可能会自然地达到默认限制。

故障排除

  • 如果你不期望图经历很多次迭代,那你可能存在循环。请检查你的逻辑是否存在无限循环。
  • 如果你有一个复杂的图,可以在调用图时通过 config 对象传入更高的 recursion_limit 值,如下所示:
graph.invoke({...}, {"recursion_limit": 100})