Field notes
AI agent memory, what to persist
Most agent memory systems are a vector store and a hope. Memory is a schema problem first.
"Add memory" is one of the most common requests I get, and it is almost never a single feature. What people mean varies wildly: keep the thread, remember my preferences, stop asking me the same question, know what happened last week.
Those are four different systems with four different lifetimes. Building them as one vector store is why agent memory so often feels both forgetful and stubbornly wrong at the same time.
Four tiers, four lifetimes
- Scratchpad. The current reasoning trail. Lives for one run, then dies. Never persisted beyond logs.
- Task state. The objective, progress, blockers, decisions, and identifiers for the job in flight. Lives until the task closes. Belongs in a real table with a real status field.
- Durable facts. Preferences, entitlements, relationships, stable attributes. Lives indefinitely, updated in place, always attributable to a source.
- History. What happened, when, and by whose instruction. Append-only, long retention, read for audit rather than for reasoning.
Task state is the tier people skip
And it is the one that fixes the most complaints. Agents that lose the thread on long tasks are almost always carrying their state implicitly, in the conversation, where it competes with everything else for attention and gets compressed away.
Make it explicit. A small structured object, updated as the run proceeds and injected near the top of context on every turn:
- Objective, in one sentence.
- Steps completed, with outcomes.
- Constraints discovered along the way.
- Approaches already tried and failed.
- Open questions and current blocker.
- Identifiers touched, so nothing gets acted on twice.
That last two lines eliminate the most irritating agent behavior there is, which is retrying something that already failed and re-processing a record it already handled. The context mechanics of injecting this cleanly are in context engineering is the whole job now.
Durable facts belong in tables, not embeddings
This is where the vector store gets misused. Semantic search is excellent at "have we discussed something like this before" and unreliable at "what is this customer's billing plan". The second question needs an exact answer with a known provenance.
- Typed fields for anything that drives a decision. Plan, tier, locale, timezone, contact preference, entitlements.
- A source and timestamp per fact. Stated by the user, inferred by the agent, or synced from a system of record. Treat these differently.
- Update in place, never append. Two contradictory remembered facts is a bug that manifests as an agent with a personality disorder.
- User-visible and editable. If a person cannot see what the system believes about them and correct it, you will be debugging by archaeology.
Write memory deliberately, with a tool
Automatic inference into long-term storage sounds delightful and creates confident nonsense. One offhand comment becomes a permanent belief that shapes every future interaction.
Make remembering an explicit tool call with a narrow schema. The agent must state the field, the value, and the source. Validate it. Log it. Then a wrong memory is one row you can find and fix, instead of a vibe buried in an embedding.
It was right once, four months earlier. Nothing in the design allowed that belief to be updated.
Retrieval over history, done carefully
Semantic recall over past interactions is genuinely useful, with three guards:
- Recency weighting. A relevant conversation from yesterday outranks a slightly more similar one from a year ago.
- Summaries, not transcripts. Index a structured summary of each interaction. Raw transcripts retrieve noisily and cost more.
- Hard scoping. Filter by user and tenant in the query, enforced by the database. Cross-tenant memory leakage is the worst bug in this category and it is entirely preventable.
Eviction is a feature
Every tier needs a written rule for what leaves and when. Without one, context grows, cost grows, quality drops, and your privacy posture quietly deteriorates.
- Scratchpad: discarded at end of run, sampled into logs only.
- Task state: archived on task close, retained as history.
- Durable facts: reviewed on staleness, expired where they can go stale.
- History: full payloads on short retention, structured summaries and aggregates on long retention, per observability practice.
Also give users a delete path that actually deletes, across all four tiers including the vector index. If your answer to a deletion request involves the word "eventually", you have a compliance problem rather than a memory system.
What I build by default
A tasks table with a JSON state column. A facts table with typed columns, source, and updated timestamp. An append-only events table for history. A vector index over interaction summaries, scoped by tenant and user. One explicit remember tool with a schema.
That is a day of schema work, it costs nothing to run, and it removes an entire class of agent weirdness. Memory is a data modeling problem wearing an AI costume.
If your agent forgets, contradicts itself, or repeats work, that is a memory architecture symptom and it is exactly what the AI production readiness audit traces to a cause. Builds under custom AI agent development ship with these four tiers in place.
Frequently asked
What is AI agent memory?
It is everything an agent carries between turns and between runs. In practice it splits into four tiers: a scratchpad for the current reasoning, task state for the current job, durable facts about users and entities, and an audit history for review.
Is a vector store enough for agent memory?
No. A vector store is good at fuzzy recall of past text and bad at authoritative facts. Preferences, entitlements, and identifiers belong in a normal database table where they can be read exactly and updated safely.
How do you stop memory from growing forever?
Give every tier an explicit lifetime and eviction rule. Scratchpad dies with the run, task state closes with the task, durable facts get updated in place rather than appended, and audit history moves to cold storage on a schedule.
Should agents remember things about users automatically?
Only with an explicit write step, a schema, and user visibility. Silent inference into long-term memory is how agents accumulate confident wrong beliefs that are very hard to debug later.
Want this shipped in your stack?
The $1,000 AI audit gets you a ranked action plan in 48 hours.
90-minute live review of your workflows, agents, retrieval, permissions, evals, costs, and observability. Fee credits toward the build.

Written by
Alex Cinovoj, TechTide AI
Founder and CTO of TechTide AI, a Columbus, Ohio AI-automation agency, and co-host of the Automation Vibes podcast. 13 years of mixed IT across support, systems, cloud, architecture, and engineering, with the last 2 years on AI implementation. Lovable Champion and community leader, and has completed Anthropic Academy courses in Agent Engineering, Claude Code, MCP, and Context Engineering.
More on Production reality
A RAG pipeline that survives real documents
Your retrieval is not bad. Your PDF parser gave the embedder a wall of ligatures and page furniture.
Prompt caching, and the rest of the bill
Most agent bills are 70 percent repeated context. Caching is the cheapest engineering win available.
Prompt injection is not a prompt problem
You cannot instruct your way out of injection. You architect your way out of it.