Major

AI Agent Memory: Durable State Beyond the Context Window

An agent's context window is not durable memory. See how databases, retrieval, and deterministic apps let work persist across runs, with governance built into execution.

Rahul RamakrishnanUpdated
Wall covered in colorful sticky notes, a picture of notes that outlast a single conversation

What is AI agent memory?

AI agent memory is the information an agent can retain or retrieve across steps and runs to guide later decisions. A context window holds working context for one task. Databases, files, event logs, and retrieval indexes hold everything that has to survive after the run ends. For enterprise work, the sturdiest design keeps authoritative records in governed software and lets the agent reason over the state it reads.

Major is the enterprise platform where agents build the software they run on, and that is the memory design it uses. When an agent works out a repeatable part of a task, it builds an app with a managed database, storage, and logs. The state lives there, not in a prompt. The agent reasons once, then runs the app. This piece covers memory architecture. It does not cover how to evaluate whether an agent's judgment is good, which is a separate and harder problem.

Why memory matters in production

A demo agent runs once. A production agent gets interrupted. A deploy restarts the worker, an approval takes three days, a user returns Thursday to a task they started Monday. If the only record of what the agent decided is a conversation that ended, the next run rebuilds context from scratch, and it may rebuild it differently.

Three costs follow. The agent repeats setup work and spends tokens on answers that have not changed. It repeats questions to the user. And it leaves nothing to audit, because the reasoning lived in a prompt that no longer exists.

Security teams feel the third cost first. The NIST AI Risk Management Framework is organized around four functions, Govern, Map, Measure, and Manage, and each assumes you can say what a system knew and did. An agent whose memory is an unlogged context window gives you nothing to map or measure.

The four things people call memory

"Memory" covers at least four different things with different lifetimes, failure modes, and owners. Mixing them up causes most memory bugs. We use "memory" for the whole stack and "state" for the part that is authoritative.

  • Working context. The context window plus task-local state. LangChain's documentation describes short-term memory as the conversation retained within a thread, saved by a checkpointer so the same thread ID can resume, and notes that long histories can raise cost, slow responses, and distract the model. Trimming and summarizing are both lossy, because a summary is the model's opinion of what mattered.
  • Retrieval. An index over documents, notes, or extracted statements, queried by similarity. It finds relevant material in a large loose pile and returns candidates ranked by closeness. Each result should carry provenance: where it came from and when.
  • Episodic history. The record of what happened. An append-only event log is the cleanest form, since nothing is rewritten and you can reconstruct what the agent saw and did at a given moment.
  • Durable application state. The account's current risk level, the invoice's reconciliation status, the ticket's owner. It lives in a database with a schema, permissions, and defined operations that change it.

Short-term, long-term, episodic, semantic, and procedural are the labels IBM and LangChain use, and taxonomies vary by author. The four above cut across them by asking one question: who is the authority? When retrieval says one thing and the application record says another, the record wins.

A constructed resume example

This is an illustration, not a customer case. On Monday an agent reviews an account whose usage dropped. It reads the account record from a health app: owner, risk level, last-updated timestamp. It retrieves two earlier support threads and notes their dates. It judges that usage fell after a pricing change, drafts outreach, and waits for the owner's approval.

What persists? The draft and its status in the app database. An event appended to the log: agent reviewed account, retrieved these threads, proposed this action. The risk level stays unchanged until a person or a defined rule changes it.

On Thursday the owner approves. A new run starts with no conversation at all. The agent reads the record, sees the approved status and the logged reasoning, sends the outreach through the app's send operation, and appends the result. It re-derives nothing.

Rules for updates, deletion, and staleness

Memory without lifecycle rules becomes a liability. Four rules cover most of it.

  • Updates go through defined operations. The agent calls an operation that validates the change, applies permissions, and logs who made it. It does not free-write to a record.
  • Stale data carries a timestamp. A three-month-old risk level is a hint to refresh, not a fact to act on.
  • Retention is set per layer. Context vanishes with the task. Event history follows your audit retention policy. Records live as long as the business object.
  • Deletion reaches every layer. A vector index nobody remembers to purge is how sensitive data survives a deletion request.

Retrieved data can be wrong or out of date. Before any consequential action, the agent should verify against the authoritative record, and a person should review decisions where the stakes justify it.

Common misconceptions about agent memory

A vector database is not a system of record. It is excellent for semantic lookup. It has no notion of current truth, no transaction semantics, and usually no per-record permissions matching your business roles. Teams that store authoritative facts there find the gap when two similar records disagree.

A bigger context window does not produce reliable state. It lets the model see more at once. It persists nothing after the run and cannot tell you which of two conflicting statements is current.

Persistence does not equal correctness. A wrong fact saved durably is a durable wrong fact. Authority, update rules, and verification matter more than the storage engine.

Most memory products optimize the retrieval half of the problem. The harder half is deciding what the system is allowed to believe.

How to build agent memory on Major

Here is the account-health example as a Major build.

  1. App that holds state. An account-health app with a managed database: an accounts table (owner, risk level, last confirmed), a proposed_actions table (draft, status, approver), and an append-only events table. People manage it through the app's views. The agent executes through the same app.
  2. Connectors. Salesforce for account records, Zendesk for support threads, Slack for owner approvals. Each connector's credentials are scoped to the operations the app needs.
  3. Deterministic steps in code. Pulling the record, checking freshness, writing events, and sending approved outreach run as app logic, the same way every time. The agent built that code once and does not re-reason it on each run.
  4. Agent judgment. The agent decides why usage dropped, what the outreach should say, and whether the case needs an owner. That is where the model spends tokens.
  5. Workflow trigger. A schedule or a usage-drop event starts the run. An approval in Slack resumes it days later, with no conversation to reload.
  6. Governance. Role-based access on every table, scoped credentials at the point the agent acts, and an audit log that attributes each write to the agent or the person who made it.

Start building on Major and the agent's state lands in a governed database from the first run.

What this does not solve

Major does not remove the model, make stale data fresh, set your retention policy, or replace human review of consequential calls. A workflow short enough to live in one prompt does not need any of this. The case for an app-backed design gets stronger as the workflow gets longer, crosses more systems of record, and has to be explained to an auditor months later.

Our position: memory is an architectural property of the work. A prompt convention that says "remember to check the notes" fails the first time someone edits the prompt. A table with permissions and an event log does not.

Start building on Major

Give your agents memory that survives the conversation: an app with its own database, event log, and permissions, built by the agent and governed by your team.

Related articles

Frequently asked questions

Do AI agents have memory?
Agents can use short-lived context inside a task and external persistence across tasks, such as databases, files, and retrieval indexes. A stand-alone model does not automatically retain a user's history between sessions. Whatever continuity an agent shows comes from the system around it, which decides what is stored and read back.
How do AI agents manage memory?
They capture events and outputs, store them in a context window, retrieval index, event log, or application database, then read back what the current task needs. Good designs add update rules, retention, and access policy. Retrieval supplies candidates, while the authoritative application record settles conflicts and gets verified before consequential action.
What are the four types of memory that every AI agent needs?
Taxonomies vary, and no single set is mandatory. A useful working split is working context for the current task, retrieved reference knowledge, episodic history of past events, and durable application state that holds authoritative records. Each has a different lifetime and a different owner.
Is a vector database enough for AI agent memory?
No. A vector database is strong at semantic lookup across loosely structured material. It returns ranked candidates, not current truth, and typically lacks transactions and role-based permissions matched to business records. Pair it with structured application state and an event log for authority and audit.