-
Couldn't load subscription status.
- Fork 211
fix(langgraph-checkpoint-aws): Add max_results attribute to AgentCoreMemorySaver
#728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(langgraph-checkpoint-aws): Add max_results attribute to AgentCoreMemorySaver
#728
Conversation
|
Hi @ltoniazzi, thanks for the suggestions in #719 - feel free to try out these changes and let me know if you have any additional feedback. |
libs/langgraph-checkpoint-aws/langgraph_checkpoint_aws/agentcore/saver.py
Outdated
Show resolved
Hide resolved
libs/langgraph-checkpoint-aws/langgraph_checkpoint_aws/agentcore/saver.py
Outdated
Show resolved
Hide resolved
get_tuplelimit attribute to AgentCoreMemorySaver
libs/langgraph-checkpoint-aws/langgraph_checkpoint_aws/agentcore/helpers.py
Show resolved
Hide resolved
limit attribute to AgentCoreMemorySavermax_results attribute to AgentCoreMemorySaver
|
I wonder if it should default to Also, I'm a bit surprised that this change does not break any unit test (I can try add some next week) |
|
@ltoniazzi actually, looking at the ListEvents API reference, |
Addresses #719.
This PR updates the AgentCore memory checkpointer integration to:
max_resultsattribute toAgentCoreMemorySaverfor limiting the number of events processed.Nonecan also be specified to set no upper limit.limitparameter ofAgentCoreMemorySaver.list(). InBaseCheckpointSaver.list(),limitconfigures the max# of checkpoints to return, but we also use this in theget_events()call. Updated this call to use the new class attributelimitinstead.AgentCoreEventClient,get_events(), exit from the response processing loop early if the number of events found exceedsmax_results. If this occurs, a warning will be returned to the user.