blog: What We Got Wrong About Agent Memory - #4092
Draft
benfrank241 wants to merge 1 commit into
Draft
Conversation
Six decisions we shipped and later reversed, each traced to a commit in this repository rather than invented for the piece: 1. Retain's memory profile was misdiagnosed. Embeddings were the obvious suspect and measurement showed two whole-document operations dominated, both running before a fact or embedding existed. 2. #4039 attributed a retain throughput figure to embedding-request serialization and predicted 3.1x end-to-end. The attribution was wrong; the follow-up claims no end-to-end number. 3. count_tokens_windowed, its helpers and its six call sites were deleted when a tokenizer change made the workaround unnecessary and gave exact counts for less memory than the approximation cost. 4. Three separate reversals in one direction: silent config defaults, Memory Defense skipping screening on a malformed policy, and reflect storing a placeholder when a run produced no answer. 5. Commit diffs and chat transcripts consolidated into one belief set, so an idea floated and never implemented was indistinguishable from committed behaviour. It could not be fixed by configuration. 6. Passthrough rerankers were detected by noticing identical scores, which a real cross-encoder can also produce. The caller now passes a flag. The closing groups them: three were believing a plausible story instead of measuring one, three were making failure invisible. The second is the sharper lesson for memory systems, where the artifacts of graceful degradation persist and get recalled instead of ending with the request. Cover is the gradient lockup style. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AE4NCnCKXUzNDF3N9FaQja
benfrank241
marked this pull request as draft
September 3, 2026 20:59
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.
Six decisions we shipped and later reversed. Every one is traced to a commit in this repository rather than invented for the piece — the commit bodies here are unusually candid, so the material was already written.
The six
count_tokens_windowed, its helpers, and six call sites, all removed when a tokenizer change made the problem disappear and gave exact counts for less memory than the approximation cost.Why it closes the way it does
Read together they're two mistakes wearing different clothes: three were believing a plausible story instead of measuring one, three were making failure invisible.
The second is the sharper lesson for this domain specifically. In a stateless service a placeholder is one bad request. In a memory system it's a wrong fact that persists and gets recalled — the artifacts of graceful degradation don't end when the request does.
Notes for review
Content score
Composite 88.2/100 (humanity 100, specificity 100, readability 90, zero long paragraphs).
🤖 Generated with Claude Code
https://claude.ai/code/session_01AE4NCnCKXUzNDF3N9FaQja