langchain-ai / langgraphjs

⚡ Build language agents as graphs ⚡
https://langchain-ai.github.io/langgraphjs/
MIT License
612 stars 95 forks source link

`SqliteSaver` ignores `newVersions` argument on `put` - not storing deltas #594

Open benjamincburns opened 2 weeks ago

benjamincburns commented 2 weeks ago

Found while working on #541. Per discussion on #577, SqliteSaver is ignoring the newVersions argument, and as a result it's storing the entire contents of checkpoint.channel_values on every call.

trollboss2572 commented 2 days ago

Good morning, we are a group of students at the University of Toronto currently investigating the issue mentioned and believe that we could help tackle this. Can we get this opened as an issue and assigned to me? I've commented on a similar task and since these tasks are related, I believe that we could handle both of these issues simultaneously. @jacoblee93

benjamincburns commented 1 day ago

@trollboss2572 - not to discourage you from contributing, but I have a fix for this in the works, and I hope to get it into a PR by the weekend.

That said, feel free to DM me on the LangChain community slack if you have any questions about the checkpointer code.

I'm not a member of the LangChain team, so definitely listen to them over me, but if you're looking to make a contribution to this project, I'd be happy to advise you on how to build a checkpointer for a new storage backend.

If you're up to it, one idea may be to contribute a generic RDBMS checkpointer that uses a lightweight ORM instead of directly composing SQL statements. That way it can handle multiple storage backends, depending on what "driver" library you install alongside of it as a peer dependency.

It could also be useful to contribute checkpointers for popular NoSQL storage backends, like DynamoDB, Azure CosmosDB, BigTable, Firebase, etc.

Also as a fellow contributor, it's a good idea to leave a comment saying that you plan on working on something (mostly to find out if someone already is), but for most projects like this they don't assign issues to volunteer contributors, as they quite often disappear before delivering them, and it blocks others from starting a solution of their own.

If you have a simple fix in mind for something already, your best bet is to just drop a PR. The risk though is that it may not be accepted, so you may end up wasting some time. In more complex cases, you can reduce that risk by detailing your planned fix as a comment in the issue, with a request for feedback.

Hope that helps!