LESSON 06 · PERSISTENCE

State and Memory

Agents need continuity, but persistence creates correctness, privacy, and staleness risks. Decide what should survive each step, run, case, and session.

TIME35–45 min
LEVELEngineering
LABMemory routing
ARTIFACTState & Memory Plan

Memory is a data architecture decision.

Do not let “memory” collapse working state, past experiences, durable knowledge, and authoritative business records into one vector store. Each category has different ownership, freshness, retention, and correctness requirements.

D→V RULE

The system of record should remain outside the model's memory. Memory may help retrieve or summarize business state, but authoritative facts should be re-read from authoritative sources.

TYPE 01

Working state

Current goal, evidence, unresolved questions, loop counter, approvals, and pending actions.

TYPE 02

Episodic memory

Past cases that may help future reasoning, subject to retention and relevance rules.

TYPE 03

Semantic memory

Durable approved procedures, taxonomies, product definitions, and operating guidance.

TYPE 04

External record

Authoritative shipment, approval, transaction, and audit state read from source systems.

InformationStorage classRetention / freshness
Current task state
Prior resolved case
Company policy
Approval record
Sensitive transient prompt data
INTERACTIVE LAB · MEMORY ROUTING

Where should this information live?

Choose persistence based on operational purpose, authority, sensitivity, and staleness risk.

Current unresolved hypothesis“Terminal congestion may be the dominant delay source.”
Human approval to spend $1,850This authorizes a real operational commitment.
Approved escalation policyVersioned company rule used across cases.
Resolved prior case patternA similar delay used a particular recovery route, but current facts may differ.
Unneeded sensitive free-text detailPersonal information irrelevant to the freight decision.
LESSON ARTIFACT

Write the State & Memory Plan.

Make persistence explicit enough that engineers can implement retention, refresh, deletion, and authoritative-source rules.

D→V · DESIGN RECORD

State & Memory Plan

NEXT · LESSON 07

Context Engineering

Assemble the smallest, freshest, most decision-relevant context for each step of the loop.

Continue →