---
title: "What agentic memory is and how to build it"
description: "Agentic memory explained: the four memory types, why agents need storage outside the context window, and how a temporal knowledge graph works."
canonical: https://past.dev/blog/agentic-memory
date: 2026-08-28
category: Research
authors: The past.dev team
---
# What agentic memory is and how to build it

Agentic memory stores information between agent runs. It can store facts, events, preferences and task state. The agent retrieves relevant information during later runs. This allows an agent to use information from previous sessions without sending the full history to the model each time.

This article covers four memory types, the limits of context windows and the main components of a production memory system.

## Why agents need external memory

A context window has three limits.

- **Capacity.** Long histories do not fit in one context window. The system must select relevant information before each model call.
- **Cost.** Sending the same history on every call charges for the same tokens repeatedly. On our benchmark workload, recalling from memory costs 20x less per question than sending 1M tokens of history.
- **Time.** Text in a context window has no validity model. If a budget changed from 32k to 40k, both values may appear together. The model must determine which value is current.

External memory stores the full history and selects relevant information for each call. It can also track dates, sources and changes.

## Four types of agentic memory

- **Working memory** stores the current task state, including the plan, intermediate results and recent tool output. It usually lasts for one session.
- **Episodic memory** records events such as meetings, emails and deployments. Each record should include a timestamp and source.
- **Semantic memory** stores facts such as a current budget, project owner or renewal date. These facts may change when new events are recorded.
- **Procedural memory** stores instructions, playbooks and learned preferences. It usually changes less often and can be versioned.

Production systems must connect episodic records to current semantic facts. This requires identity resolution and a record of when each fact was valid.

## Tracking changes over time

Vector search ranks text by similarity. Current-state queries also require validity dates.

A temporal knowledge graph represents people, companies and projects as entities. Facts connect to those entities. Each fact records its source, when it became valid and when it stopped being valid. When a value changes, the system closes the previous validity period and records the new value. Both values remain available for historical queries.

This structure also supports abstention. The system can return an insufficient-evidence status when no stored fact supports an answer.

## Components of an agent memory system

A production system usually contains five stages.

1. **Ingestion.** Accept raw text and its original timestamp. Support backdated records and idempotent retries.
2. **Extraction.** Identify facts, events and relationships in the text. Retain the source for every extracted item.
3. **Entity resolution.** Match references to the same person or organization across email, transcripts and chat.
4. **Temporal storage.** Store facts with validity dates, sources, conflicts and supersession records.
5. **Recall.** Return relevant evidence, citations and a status that describes what the evidence supports.

Each stage should be tested separately. Extraction tests measure whether facts were identified. Entity-resolution tests measure whether references were matched correctly. Recall tests measure whether the required evidence was returned in the correct order.

## Evaluating agentic memory

Memory evaluations should include updates, identity resolution, historical questions and unsupported questions. They should test multiple history sizes. Report retrieval accuracy, answer accuracy, latency and cost.

Retrieval sufficiency measures whether the returned evidence contains the information required to answer. Answer accuracy also depends on the model that reads the evidence. Our [benchmark methodology](/benchmarks) documents the datasets, baselines and judges we use.

## Using past.dev

past.dev provides these memory functions through four API endpoints. `POST /api/v1/ingest` accepts raw text with its original timestamp. `POST /api/v1/recall` returns ranked, dated evidence and a `status` value such as `Supported`, `Conflicted` or `NoKnownSupport`.

past.dev performs extraction, entity resolution and temporal storage. Your application sends the returned evidence to its model. See the [quickstart](/docs/memory-api/quickstart) for the API calls. [What is agent memory?](/what-is-agent-memory) describes the broader category. [Context engineering](/context-engineering) explains how to select evidence for a model call.
