An agent was recalling too much
I investigated how much stored context my personal agent retrieved for a question. Removing duplicate memories seemed like a possible way to reduce the amount, but the tests pointed elsewhere: most of the retrieved entries were distinct.
Deleting duplicates would therefore have done little to address the problem I was investigating. I needed to examine how much the agent retrieved, rather than assume the stored collection needed cleaning up.
Changing the retrieval limit
I chose a lower retrieval limit without deleting memories. That kept the change focused on the context supplied for a question. It also left a way to reverse the decision if the smaller result set omitted information I needed.
We checked a small set of questions to see whether the required answers remained available. They did for that test set. That was useful evidence for the adjustment, with a clear limit: it did not establish that a smaller retrieval set would suit every future question.
The decision came from the test
In this case, distinguishing duplicate entries from excessive retrieval changed the proposed fix. I could reduce the context being returned while preserving the information already stored.