The bitter lesson for agent memory

77 points18 comments2 hours ago
mr_roboto

I hope they figure out a highly effective way that scales. I've found the built in method in Claude is a disaster. I make the only memory a rule that there are no memories allowed. When working on large projects I find it will add all sorts of memories for things it can just figure out JIT and I'll turn around it is injecting 50Kb worth of memories into each session.

I've tried claude-mem and wasn't impressed with the results. Perhaps those methods work for smaller projects but at scale it seems to be a lot of noise. I've become a context purist, prefer absolutely minimal context injection, and would just rather have the agents go searching for what is needed on demand for now.

show comments
btown

> We modelled our dreaming setup after Anthropic's approach: after every task, and before the next task, we ran a reflection loop to let a dreaming agent create notes and wiki using the event log and task feedback.

This does more than it appears to: it also primes the LLM to know that this data store exists, and that it should be consulted proactively. Half the battle is to make sure the system doesn’t jump to conclusions without consulting its memory at all!

Some of this is captured by effort settings, but you can do a lot with a bit of system prompt tuning, even at lower effort, to make sure the system knows there are things it must consult even something seems simple.

wry_xy

I've hated memories from day one, and always turn them off everywhere. I hate large context too, and strategically compact often. Context is a distraction more often than not. Keep the model focused on exactly what it needs. There's nothing quite like the magic of a fresh session with a precise prompt before the model starts losing brain cells.

ksajadi

Most harnesses have this partially but with flaws IMHO. When claude says, something along the lines of "this happened before", if you ask it how does it know, it will tell you that it records memories in ~/.claude/project/... which it does in the form of a MEMORY.md file + other single files. however it also says that claude code "inserts other items in the memory and it doesn't know where they come from". looking back at previous work and learning from it by identifying patterns is a great way to learn for humans and works great for agents too. however, i think there are several issues with the current way memory retrieval happens in harnesses now: first, agents understand all there is to know about what they read, and have no idea about what they don't read. this means the idea of "intuition" is alien to them (obviously, but i mean within the context of memory, as in knowing something without knowing how one knows it). finding correlational information to what agents are looking for and feeding them into their memory recall improves their work quality by a lot (we've run tests with metrics to show).

the second issue, is that learning and memory are different and the best memory systems are good at storage, correlation and retrieval but don't help with learning. by learning i mean summarizing, finding patterns and dropping specifics and generalizing. that is why moving one project's memory is not easy to another project in claude or codex (they are files filled with specifics and stored locally on a disk, which makes them locked into one member of the team, inhibiting organizational learning).

we ran 51 scenarios with and without our memory system (built around the same principles) and these are the result (with vs without): first review acceptance: 81% vs 46% correct past decision recalls: 50% vs 85% token usage drop: 20% (average of 8mm vs 10mm) repeat corrections by a human: 8 vs 10 (in 100 repeats)

CGamesPlay

Neat analysis, but they didn't test how effective vector search is in addition to their simple FTS. For example, in the DolphinBench sample, it's unclear how "blue bottle" gets recalled as a restaurant when the query is "order one small latte". I suspect the simple FTS plus embeddings of the raw events would have the strongest results overall.

show comments
kepano

The conclusion seems somewhat unsurprising: it's more effective to keep unedited logs and let agents search those than compress/compact/summarize.

As ever, many companies will be happy to store your data and sell access back to you. The good news is it's easier than ever to retain ownership of your data in sqlite or markdown files.

show comments
jsemrau

I had good experiences with deepcq to manage the different types of memories. Many agents conflate conversational short term memory with the state of the agent and long-term evidence storage making it difficult to confirm relevance for the intent.

show comments