> ## Documentation Index
> Fetch the complete documentation index at: https://cndoc-langchain.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MISSING_CHECKPOINTER

您正尝试使用内置的 LangGraph 持久化功能，但未提供检查点保存器。

当 [`StateGraph`](https://reference.langchain.com/javascript/langchain-langgraph/index/StateGraph) 或 [`entrypoint`](https://reference.langchain.com/javascript/langchain-langgraph/index/entrypoint) 的 `compile()` 方法中缺少 `checkpointer` 时，就会发生此情况。

## 故障排除

以下方法可能有助于解决此错误：

* 初始化一个检查点保存器，并将其传递给 [`StateGraph`](https://reference.langchain.com/javascript/langchain-langgraph/index/StateGraph) 或 [`entrypoint`](https://reference.langchain.com/javascript/langchain-langgraph/index/entrypoint) 的 `compile()` 方法。

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import { InMemorySaver, StateGraph } from "@langchain/langgraph";
const checkpointer = new InMemorySaver();

// 图 API
import { StateGraph } from "@langchain/langgraph";
const graph = new StateGraph(...).compile({ checkpointer });

// 函数式 API
import { entrypoint } from "@langchain/langgraph";
const workflow = entrypoint(
    { checkpointer, name: "workflow" },
    async (messages: string[]) => {
        // ...
    }
);
```

* 使用 LangGraph API，这样您就不需要手动实现或配置检查点保存器。该 API 会为您处理所有持久化基础设施。

## 相关内容

* 阅读更多关于[持久化](/oss/javascript/langgraph/persistence)的信息。

***

<div className="source-links">
  <Callout icon="terminal-2">
    [将这些文档连接](/use-these-docs)到 Claude、VSCode 等工具，通过 MCP 获取实时答案。
  </Callout>

  <Callout icon="edit">
    [在 GitHub 上编辑此页面](https://github.com/langchain-ai/docs/edit/main/src/oss/langgraph/errors/MISSING_CHECKPOINTER.mdx) 或 [提交问题](https://github.com/langchain-ai/docs/issues/new/choose)。
  </Callout>
</div>
