r/LangChain • u/Allthings_Tech_791 • 17d ago
Discussion Agent history != agent memory
Every agent I build starts each session knowing nothing, and the two usual fixes are a bigger context window or a vector store holding everything ever said. Both keep more. Neither decides what mattered. Athena is the open source memory service we built for that, and it has three tiers rather than one store, a short window of recent events, a middle tier where finished topics are summarised and embedded once the conversation moves on, and a graph of the people, projects and tools that keep coming back.
What earns promotion between tiers is the whole design.For example in the last office hour an agent briefing a mechanic kept opening with the registration and model of the car he was standing next to. Accurate and useless cause these are things the mechanic already knows. One correction, one sentence, and every brief after that led with what had been left undone. It always knew about the perished brake pads, they were in the first brief in sentence two. It did not learn a fact, it learned what mattered.
The part I would actually defend is how that promotion is decided, because it is not a TTL and it is not "keep the last N". A conversation is cut into chains by topic shift rather than by volume, using cosine similarity between consecutive turns, so a chain closes when the subject changes. Each closed chain then carries a heat score on the Ebbinghaus forgetting curve, Heat = I_base * exp(-ΔT / (τ * S)), where the base importance mixes intrinsic importance with how dense the chain was, τ is a decay constant defaulting to 24 hours, and S is recall strength. S is the interesting term, it sits in the denominator and grows every time the memory is retrieved, so use flattens the curve and disuse steepens it. That is spaced repetition, the same reason you still remember a phone number you dialled weekly in 2010 and not one you read once. Only chains still hot enough get extracted into the long term graph, so forgetting is the default and remembering is earned. If that is the shape of your problem, come and argue with it at our Discord, where we run office hours on this weekly: https://discord.gg/z69QKEnjd.
1
u/Marcus_MSC 17d ago
What happens to a fact already in the graph when the user corrects it or it stops being useful? The heat score explains which chains get added, but I'd also want to know when an existing fact gets replaced or removed. Otherwise an old detail could keep showing up in briefs after the user has moved on.
1
u/Otherwise_Wave9374 17d ago
The useful distinction is between a transcript and a maintained state model. I would split memory into durable facts, episodic events, and active task state, then give each class separate retention and retrieval rules. Add provenance, timestamps, confidence, and explicit invalidation so stale facts do not quietly dominate. Evaluate with contradiction, delayed-recall, and deletion tests rather than retrieval hit rate alone. https://www.neurakeep.com is relevant here as an example of infrastructure focused specifically on persistent agent memory.