Passing None as input parameter with Short-Term Memory #4865
Unanswered
ayeletharcz
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm currently using LangGraph with short-term memory backed by SQLite, and I've run into some unexpected behavior regarding input parameters and state persistence.
Here's the scenario:
On the first invocation of the graph (using a specific thread_id), I pass an input parameter B with an initial non-None value.
On the second invocation (using the same thread_id), I pass B=None. This is intentional, as B is defined as an optional parameter, and None is a valid input in my use case.
If I provide any non-None value, the graph proceeds correctly with the new value. This behavior seems to occur only when B is explicitly set to None.
I’m trying to understand:
Why does this behavior occur? Is None being treated as an absence of update rather than an explicit value?
Is there a recommended way to ensure that None is properly handled and used to overwrite prior state?
Any insight or guidance would be much appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions