docs: fix delete_old_messages example to properly demonstrate deletion effect#4009
Open
Udit Sharma (uditstocks) wants to merge 1 commit into
Open
Conversation
Contributor
|
Thanks for opening a docs PR, Udit Sharma (@uditstocks)! When it's ready for review, please add the relevant reviewers:
|
b739c77 to
18bf2d3
Compare
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.
Overview
The existing
delete_old_messagesexample in the short-term memory documentation failed to properly demonstratethe deletion effect. After deleting the earliest two messages, the agent could still recall the user's name "Bob" because
the AI's own first response had echoed the name - and that response survived the deletion window.
This PR fixes the example by inserting an unrelated conversation turn (a cat poem)
between the name introduction and the name recall query. This naturally pushes the
name-containing messages out of the window, so when the agent is asked "what's my name?"
it correctly responds that it doesn't know.
Type of change
[Update existing documentation]
Checklist
docs devRelated issues/PRs
closes #3894
Additional notes
The fix is minimal and surgical - only the example code and output block are changed.
No API behavior, no logic, no navigation changes. The updated output block is taken
from an actual local run to ensure accuracy.