MISSING_CHECKPOINTER 오류
MISSING_CHECKPOINTER 오류
LangGraph에서 내장 영속성(지속성) 기능을 쓰려고 하는데 MISSING_CHECKPOINTER 오류가 나는 경우가 있어요. 이름 그대로, 체크포인터(checkpointer)가 빠져 있다는 뜻이에요.
LangGraph의 내장 영속성을 쓰려면 체크포인터를 제공해야 해요. 이 오류는 StateGraph의 compile() 메서드나 @entrypoint에 checkpointer가 빠져 있을 때 발생해요.
해결하기
다음 방법이 도움이 될 수 있어요.
- 체크포인터를 초기화해서
StateGraph의compile()메서드나@entrypoint에 전달하기.
from langgraph.checkpoint.memory import InMemorySaver
checkpointer = InMemorySaver()
# Graph API
from langgraph.graph import StateGraph
graph = StateGraph(...).compile(checkpointer=checkpointer)
# Functional API
from langgraph.func import entrypoint
@entrypoint(checkpointer=checkpointer)
def workflow(messages: list[str]) -> str:
...
- LangGraph API를 사용하면 체크포인터를 직접 구현하거나 설정할 필요가 없어요. API가 영속성 인프라를 전부 처리해 주니까요.
관련 자료
- 영속성(Persistence)에 대해 더 읽어보세요.