Feature request: MongoDB support for store.
Checked other resources
- [x] This is a bug, not a usage question. For questions, please use GitHub Discussions.
- [x] I added a clear and detailed title that summarizes the issue.
- [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
- [x] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.
Example Code
I think currently in development we have InMemoryStore and in Production we have Postgres by default, correct me if I'm wrong anywhere.
But Let's say If I want to do some analytics with the data that I'm going to store in long term memory, there is no way for me right now. Because Store default stores everything to Postgres and not sure how to access this long term memory for analytics.
Why dont langraph provides a feasibility where store could use external databases like MongoDB for the long term memory.
Error Message and Stack Trace (if applicable)
Description
Using Latest versions
System Info
Why dont langraph provides a feasibility where store could use external databases like MongoDB for the long term memory.
Solutions could be:
- Either provide access to the postgres store where the long term memory is getting stored.
- Or please provide support for other databases like Mongodb, so that we could create analytics using that long term memory we store in MongoDB.
This would bring more value to the langgraph .
It seems you are talking about LangGraph platform specifically? You can access all the stored memories via the APIs - we don't have immediate plans to allow customization of the persistence layer for the managed version of langgraph platform - if I'm misreading the question and it's actuallyabout a different scenario, please let me know.
@hinthornw could you suggest me any possible way to store the long term memory into Mongodb, ofcourse in production langgrpah platform stores in postgres but at the same time I need to store to Mongodb at the same time.
RIGHT NOW I have a remote graph connected to main application graph. This remote graph runs in the background to store the memory.
My project also needs the data to be stored into Mongodb, so your help here is most appreciated
Is there any Mongo port of store ?
Hi @Saisiva123, @pranavms13 - I think you both are looking for the community-maintained langchain-mongodb package. They offer a MongoDBStore, which is an implementation of LangGraph's BaseStore. If you have any problems with this integration, feel free to open an issue in the langchain-mongodb repository.