fix: update parameter added to the update function which is exposed t…#3799
Merged
whysosaket merged 4 commits intomem0ai:mainfrom Mar 26, 2026
Merged
Conversation
…o the client, with all the relevant doc strings updated
|
Hey, big +1 on this PR. Currently hitting the Since the underlying |
Verify that both sync Memory.update() and async AsyncMemory.update() correctly forward the metadata parameter to _update_memory, including None default, populated dict, and empty dict cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge origin/main into fix/metadata-param-update-function, combining the new Mock import (for metadata update tests) with the datetime imports and UTC timestamp tests added on main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
utkarsh240799
previously approved these changes
Mar 24, 2026
Remove unused `asyncio` import and unused `result` variable assignments flagged by ruff linter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
utkarsh240799
approved these changes
Mar 24, 2026
whysosaket
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #3795
Adds the
metadataparameter to the publicupdate()method in bothMemoryandAsyncMemoryclasses. The internal_update_memory()function already supported metadata updates, but this parameter was not exposed to the client-facing API. This change allows users to update memory metadata when updating memory content.Type of change
How Has This Been Tested?
Automated Tests
6 new unit tests were added covering both sync and async update paths:
tests/test_main.py(syncMemory):test_update— verifiesNonemetadata is passed by default when not specifiedtest_update_with_metadata— verifies a metadata dict ({"category": "sports", "priority": "high"}) is forwarded to_update_memorytest_update_with_empty_metadata— verifies empty{}is passed through (not coerced toNone)tests/memory/test_main.py(asyncAsyncMemory):test_async_update_without_metadata— same as sync, confirmsNonedefaulttest_async_update_with_metadata— same as sync, confirms metadata forwardingtest_async_update_with_empty_metadata— same as sync, confirms empty dict passthroughAll 6 tests verify that the
metadataargument is correctly forwarded from the publicupdate()API to the internal_update_memory()method.Checklist
Maintainer Checklist