-
Notifications
You must be signed in to change notification settings - Fork 132
feat: implement summarizing conversation manager #112
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
feat: implement summarizing conversation manager #112
Conversation
712e2ba
to
3fa3bd7
Compare
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
02bb209
to
f90af97
Compare
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
Let me know your feedback, I'll hold on the documentation updates until we have a final version (and before merging). |
Can you add an integration test for this implementation as well? We wand to make sure it passes end to end. |
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
f90af97
to
9431bf7
Compare
c0b84b2
to
f1525c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really good, thank you for all the work here!
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
tests-integ/test_summarizing_conversation_manager_integration.py
Outdated
Show resolved
Hide resolved
tests-integ/test_summarizing_conversation_manager_integration.py
Outdated
Show resolved
Hide resolved
565f7ef
to
ddb29f0
Compare
@Unshure thanks for all the feedback and really appreciate your thorough review 🙏 I've pushed the changes following your comments, let me know if I addressed everything. Happy to contribute and help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks great! I was able to pull it locally and the integ tests ran much faster as well 🪄.
Few small things to clean up, and then this is good to merge!
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
tests-integ/test_summarizing_conversation_manager_integration.py
Outdated
Show resolved
Hide resolved
tests-integ/test_summarizing_conversation_manager_integration.py
Outdated
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Show resolved
Hide resolved
src/strands/agent/conversation_manager/summarizing_conversation_manager.py
Outdated
Show resolved
Hide resolved
9776766
to
4cd0ba8
Compare
4cd0ba8
to
a11836e
Compare
Approved and merged! Really appreciate all of the work you did here @stefanoamorelli! If you are feeling up for it, could you also update your docs pr here with the up to date information: strands-agents/docs#63 |
@Unshure sure, thank you! 🎉 Will update the documentation PR as well, consider it ready to review within tomorrow EOD 😊 |
Description
Tip
Follows conventional commits. Better reviewed commit-by-commit.
Introducing a new
SummarizingConversationManager
as an alternative to the existing sliding window approach. It optionally uses AI-powered summarization to retain the semantic context of older messages, rather than discarding them, while staying within model context limits.Related Issues
Closes #90
Documentation PR
strands-agents/docs#63
Type of Change
Testing
hatch fmt --linter
hatch fmt --formatter
hatch test --all
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.