---
title: 'Agent memory'
description: "A system for capturing, retaining, selecting, and delivering prior state so it can influence an agent's later decisions."
canonical_url: 'https://darkfactory.dev/glossary/agent-memory'
markdown_url: 'https://darkfactory.dev/glossary/agent-memory.md'
collection: glossary
date_published: '2026-08-03T00:00:00-04:00'
date_modified: '2026-08-26T00:00:00-04:00'
---

# Agent memory


## Definition

Agent memory is a system for capturing, retaining, selecting, and delivering prior state so it can influence later decisions. The stored material may include task progress, observations, decisions, user preferences, failure history, verified facts, or procedures. It becomes useful memory only when the system can surface the right material at the right decision point.

Memory therefore has a write path, a storage form, a retrieval or trigger mechanism, a context-delivery path, and a lifecycle. A vector database can be one storage component, but storage alone does not decide what deserves to be saved, when it should appear again, or whether it is still true.

Several architectures make this system boundary explicit. MemGPT manages tiers of information around a model's limited context window. Swapnanil Saha's 2026 coding-agent study separates memory content from memory delivery: in its tested task, a seeded store and instructions produced no voluntary memory calls across 114 turns, while harness-controlled injection delivered cued records. The study is small and product-specific, but it demonstrates why memory availability and memory use are different claims.

## DarkFactory operating model

Where possible, keep raw session events or source documents as the durable record and treat summaries, extracted facts, and embeddings as rebuildable projections. That lets retrieval improve without pretending an old model-generated summary is the original event. Some intent never enters a transcript, so important reasons and corrections still need explicit capture.

## Distinguish it from nearby terms

- **Context** is what the model can see during the current call. Memory is one mechanism for constructing future context.
- **Retrieval** selects external material for a query. Agent memory adds temporal continuity, ownership, and update rules around retained state.
- **Model parameters** contain patterns learned during training. Writing a memory record does not train the model.
- **Working memory** supports the current task or session. **Durable memory** survives across runs.

## Operational significance

Every memory item needs provenance, scope, authority, freshness, and a correction or deletion path. Treat model-written memories as untrusted interpretations until verified. Protect retrieval and injection from malicious stored content. Measure useful recall, harmful recall, stale delivery, missed triggers, context cost, and whether the agent acts on delivered information.

## Check your understanding

An agent records a database migration rule but never retrieves it when editing a migration. The store contains information, but the system has failed as memory at the moment that mattered.

## Also called

memory

## Related terms

- [Working memory](https://darkfactory.dev/glossary/working-memory)
- [Durable memory](https://darkfactory.dev/glossary/durable-memory)
- [Context window](https://darkfactory.dev/glossary/context-window)

## Related factory areas

- [Context, memory, knowledge & skills](https://darkfactory.dev/factory/context-memory-skills)
- [Orchestration, state, concurrency & recovery](https://darkfactory.dev/factory/orchestration-state)

## Evidence and further reading

- [Long-Running Agents](https://addyosmani.com/blog/long-running-agents/)
- [BootstrapAgent: Distilling Repository Setup](https://arxiv.org/abs/2605.15815)
- [MemGPT: Towards LLMs as Operating Systems](https://arxiv.org/abs/2310.08560)
- [Delivery, Not Storage: Cue-Anchored Working Memory as a Harness Property for Coding Agents](https://arxiv.org/abs/2607.20972)
