---
title: "Memory as Prediction"
description: "Agent memory should be selected and stored by utility, meaning how much it improves the agent's response, not by fidelity to past conversations."
url: "https://swe.quest/articles/memory-as-prediction-136dcecfb2251013"
canonical: "https://www.digitalocean.com/blog/memory-as-prediction"
source: "DigitalOcean"
published: "2026-12-01"
difficulty: "medium"
kind: "Research"
reading_minutes: 8
tags: ["ai-agents","llms","rag","evals"]
---

# Memory as Prediction

A post on [DigitalOcean](https://swe.quest/sources/digitalocean.md), published 2026-12-01, 8 min read, Research. Original: [https://www.digitalocean.com/blog/memory-as-prediction](https://www.digitalocean.com/blog/memory-as-prediction)

## Summary

Agent memory should be selected and stored by utility, meaning how much it improves the agent's response, not by fidelity to past conversations. Leto implements this with three mechanisms. It indexes retained conversations by atomic facts that point back to their source spans. It replays the store between sessions to compose a user profile and task state that reach the agent regardless of the request. It runs a utility loop that scores memories from confirmation and correction signals and serves only those above a threshold. Against Mem0, LangMem, Hindsight, Letta, Zep and Memobase on five benchmarks, Leto reaches 60.5% on PrefEval versus 44.2% for the next-best system and leads MemoryArena. It trails RAG by 2.8 points on LoCoMo but beats it on LongMemEval while using far fewer tokens.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [RAG & retrieval](https://swe.quest/tags/rag.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)

## Prerequisites

- LLM agents ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- retrieval-augmented generation

## Keywords

Leto, Mem0, Letta, Zep, PrefEval, MemoryArena, LoCoMo, LongMemEval

## Related posts

- [Give Your Coding Agents a Memory You Own](https://swe.quest/articles/give-your-coding-agents-a-memory-you-own-a4b8ff1b9b62d4a5.md): Hugging Face · 2026-09-03 · Medium · 9 min read · AI agents, AI for coding, RAG & retrieval, Search, Developer tools
  funes is an open-source, single-binary memory layer that indexes the session traces of coding agents (Claude Code, Codex, pi, Hermes) so any agent can recall past decisions and rationale with exact provenance.
- ["I'm Sorry, Have We Met?" — Frictionless Memory for AI](https://swe.quest/articles/i-m-sorry-have-we-met-frictionless-memory-for-ai-e2b06b8840d066bb.md): trivago tech · 2026-10-16 · Medium · 11 min read · LLMs, AI agents, RAG & retrieval, Search, Vector search
  LLM APIs are stateless, so conversational memory must be built in the application layer, and the right design depends on scale.
- [The components of agent memory](https://swe.quest/articles/the-components-of-agent-memory-6ad54605491f6c6e.md): Anthropic Engineering · 2026-11-06 · Medium · 21 min read · AI agents, LLMs, Evaluation
  Agent memory works best as a layered hierarchy: transcripts as an event log, notes Claude writes in-session, richer representations such as wikis, and context injected into every session, with an offline "dreaming" pass that reflects on transcripts to correct and reorganize memory.
- [ReasoningBank: Enabling agents to learn from experience](https://swe.quest/articles/reasoningbank-enabling-agents-to-learn-from-experience-c24d005f6ce31b05.md): Google Research · 2026-04-21 · Hard · 5 min read · AI agents, LLMs, Evaluation
  ReasoningBank is an agent memory framework that distills generalizable reasoning strategies from both successful and failed trajectories, stored as structured items (title, description, content) in a closed loop of retrieval, LLM-as-a-judge self-assessment, extraction and append-only consolidation.
- [How to build a retrieval system for agents](https://swe.quest/articles/how-to-build-a-retrieval-system-for-agents-08b9b297721895b1.md): Turso · 2026-02-20 · Medium · 5 min read · AI agents, Vector search, SQLite, AI for coding, RAG & retrieval
  Memelord is a fully local memory system for coding agents that keeps a per-project SQLite database (via Turso) of corrections, insights and user-requested memories, embedded with all-MiniLM-L6-v2 and retrieved by cosine vector search at task start.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
