LangGraph is a new package from Langchain which allows building Agentic applications. For "checkpointing" LangGraph supports SqlLite and PostGresDB currently. We want to add support for MongoDB. This has been requested by a customer (Cisco)
Interface required:
- This would be implemented in the langchain_mongodb package and will take the langgraph as a dependency. (even though LangGraph is a separate package from Langchain all the MongoDB specific implementation is requested by the LangChain team to be put into the langchain_mongodb package for now. There is no plan from a langgraph_mongodb type package for now and we want to push that as much into the future as possible)
- There should be a checkpoint.py file in the langchain_mongodb package
- Langchain has asked to base this on following implementation
https://github.com/langchain-ai/langgraph/blob/main/libs/langgraph/langgraph/checkpoint/memory.py
- The following class and methods are required in langchain_mongodb/checkpoint.py
class MongoDBSaver(BaseCheckpointSaver):
Sync methods (required for getting started):
def get_tuple(self, config: RunnableConfig) -> Optional[CheckpointTuple]:
def list()
def put()
def put_writes()
Async methods (Required for users going for parallelism in the implementation):
async def aget_tuple(self, config: RunnableConfig) -> Optional[CheckpointTuple]:
async def alist()
async def aput()
async def aput_writes()
- there is a community provided implementation for MongoDB that can be used - https://langchain-ai.github.io/langgraph/how-tos/persistence_mongodb/#asynchronous-implementation
- is depended on by
-
INTPYTHON-280 Langchain: Update documentation for Checkpointer
- Backlog
-
INTPYTHON-412 Enable linting in langchain-mongodb repo
- Blocked
-
INTPYTHON-293 Add LangGraph Checkpointer to AI-ML CI
- In Progress
-
INTPYTHON-384 Create a release of langgraph-checkpoint-mongodb in langchain-ai partner repo
- In Progress
- is related to
-
INTPYTHON-383 Add MongoStore to langchain-mongodb
- Closed