LangGraph library not compatible with checkpointer base
Checked other resources
- [X] I added a very descriptive title to this issue.
- [X] I searched the LangGraph/LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.
- [X] I am sure that this is a bug in LangGraph/LangChain rather than my code.
- [X] I am sure this is better as an issue rather than a GitHub discussion, since this is a LangGraph bug and not a design question.
Example Code
async for event in graph.astream(initial_state, debug=True):
if "__end__" not in event:
logging.info(f"Event received: {json.dumps(event, default=str)}")
yield event
Error Message and Stack Trace (if applicable)
File "/usr/local/lib/python3.10/dist-packages/langgraph/graph/__init__.py", line 1, in <module>
from langgraph.graph.graph import END, Graph
File "/usr/local/lib/python3.10/dist-packages/langgraph/graph/graph.py", line 26, in <module>
from langgraph.channels.ephemeral_value import EphemeralValue
File "/usr/local/lib/python3.10/dist-packages/langgraph/channels/__init__.py", line 1, in <module>
from langgraph.channels.binop import BinaryOperatorAggregate
File "/usr/local/lib/python3.10/dist-packages/langgraph/channels/binop.py", line 6, in <module>
from langgraph.channels.base import BaseChannel, EmptyChannelError, Value
File "/usr/local/lib/python3.10/dist-packages/langgraph/channels/base.py", line 17, in <module>
from langgraph.checkpoint.base import Checkpoint
File "/usr/local/lib/python3.10/dist-packages/langgraph/checkpoint/__init__.py", line 1, in <module>
from langgraph.checkpoint.base import (
ImportError: cannot import name 'CheckpointAt' from 'langgraph.checkpoint.base' (/usr/local/lib/python3.10/dist-packages/langgraph/checkpoint/base/__init__.py)
Description
Im not sure hyw this is not working
System Info
langgraph==0.2.0 langgraph-checkpoint==1.0.2 langgraph-checkpoint-postgres==1.0.3 langgraph-checkpoint-sqlite==1.0.0
you need to update to langgraph 0.2.3
let me know if you're still facing the issue after updating!
Hi, I am still facing the same issue.. it did not change the error unfortunately
@SellCXHarsha could you please provide full code snippet with minimal reproducible example for the error?
from langgraph.graph import StateGraph, END it fails on this line when i upgrade to langgraph 0.2.3
This is working fine for me - can you send me the entire error trace?
harsha@harsha-Sword-15-A12UE:~/SellCX/Sandbox/api$ /bin/python3 /home/harsha/SellCX/Sandbox/api/Aysnc_Multi_Agent/ProCotAgent/proCoT_agent.py
Traceback (most recent call last):
File "/home/harsha/SellCX/Sandbox/api/Aysnc_Multi_Agent/ProCotAgent/proCoT_agent.py", line 7, in
and the versioning: langgraph==0.2.3 langgraph-checkpoint==1.0.2 langgraph-checkpoint-postgres==1.0.3 langgraph-checkpoint-sqlite==1.0.0
Thank you, looking into it now
Hmm I don't see a CheckpointAt import anywhere in LangGraph.checkpoint.base, could you maybe try uninstalling and then reinstalling the packages and trying again? Lmk if that doesn't work.
@SellCXHarsha please let us know if re-installing the package from scratch fixes the issue!
Closing due to inactivity
FWIW, CheckpointAt was used in opengpts repo here; also available in docs from a simple google search!
However, it was probably removed, so older code breaks if langgraph is upgraded. Not sure what the equivalent migration code looks like...
is thee a solution for this?
We landed-up abandoning the older checkpoint code in openGPTs, and upgraded to using AsyncPostgresSaver. It came with it's own challenges - needing a patch in langgraph to fix type-checking failures in ConfigurableFieldSpec. Debugging this is painful due to so many moving parts and fast-changing interfaces...😢
Following is our working dependency environment:
langchain = "^0.2.16"
langgraph = "^0.2.39" # 0.1.19
langgraph-checkpoint = "^2.0.2"
langgraph-checkpoint-postgres = "^2.0.2"
pydantic = "<2.0"
langchain-core = "^0.2.41"
@nitin-lamba-ck - we had a custom RedisCheckpoint (class RedisCheckpoint(BaseCheckpointSaver): and using like such CHECKPOINTER = RedisCheckpoint( at = CheckpointAt.END_OF_STEP) but now because CheckpointAt enum doesnt exist my chat bot breaks . did you change the native langgraph library ? thank you for the pointers.
Yes, I did change the native langgraph 2.0.x library to get past the error (lot of debugging time to isolate the problem).
From the latest checkpoint packages, I don't see officially/ community supported library for Redis; only sqlite, postgres and duckdb are available. So, unfortunately, you may have to re-implement that custom RedisCheckpoint using the latest 2.0.x version.
FWIW, here's a MongoDB pattern (checkpoint.py) without using those older enums.
Good luck!
thank you so much - good pointers and have something to base my notions on now.
you need to update to langgraph 0.2.3
facing the same issue.
library versions: langchain 0.2.17 langchain-anthropic 0.1.13 langchain-core 0.2.43 langchain-openai 0.1.7 langchain-text-splitters 0.2.4 langgraph 0.2.69 langgraph-checkpoint 2.0.10 langgraph-sdk 0.1.51 langsmith 0.1.147
FWIW, another project (OpenGPT) had a recent commit last week to upgrade, and this checkpoint code in 2cf3bf7 is a good reference to update your old code to the new version.
Good luck!