Procedural memory · AI agents

On this page 7

Procedural memory in AI agents is the memory of how to perform tasks: the skills, routines, rules and tool-use workflows that an agent applies without reasoning them out from scratch each time. Where episodic memory records what happened and semantic memory records facts, procedural memory records reusable know-how, such as the steps for deploying a service or the correct order of API calls for refunding an order.

The term comes from cognitive psychology, where it describes skills such as riding a bicycle. In agent design it was formalized by cognitive architectures and, for language-model agents, by the CoALA framework, which separates working, episodic, semantic and procedural memory. In practice, procedural memory decides whether an agent improves with experience or repeats the same mistakes in every session.

Where AI agents store procedural memory

AI agents store procedural memory in three broad places: inside model weights, inside the agent’s code and prompts, and inside an external skill store that the agent can read and update. Each location differs in how easily the knowledge can be inspected, edited and shared.

LocationForm of the knowledgeHow it changesInspectability
Model weightsImplicit behavior learned in trainingFine-tuning or reinforcement learningVery low
System prompt and harness codeWritten instructions and fixed control flowEdited by developersHigh
Skill libraryNamed, reusable procedures or code functionsAdded and revised at run timeHigh
Workflow memoryAbstracted step sequences from past trajectoriesInduced automatically from successesMedium
Storage locations for procedural memory

The most active area is the explicit skill library. Here a skill is a self-contained unit, often a short instruction file with optional scripts, or an executable function, together with a description used for retrieval. The agent loads only the skills relevant to the current task, which keeps the context window small.

How procedural memory is written and retrieved

Procedural memory is written when an agent or a developer distills a successful trajectory into a reusable procedure, and it is retrieved when a new task matches that procedure’s description. The cycle has four stages.

  1. Acquisition: a task succeeds, often after several attempts or human correction.
  2. Abstraction: concrete values such as file names are replaced by parameters, and incidental steps are removed.
  3. Validation: the procedure is tested on new cases or reviewed by a human before it is trusted.
  4. Retrieval and execution: a matching task triggers loading of the procedure into context or calling its code.

Research systems illustrate these stages. Voyager, a Minecraft agent, wrote verified JavaScript functions into a growing skill library and composed them into more complex behaviors. Agent Workflow Memory induces common sub-routines from web-navigation trajectories. Reflexion stores verbal lessons from failures, which sits on the boundary between episodic and procedural memory, because a lesson becomes procedural only when it is generalized into a rule.

Procedural memory compared with other agent memory types

Procedural memory differs from other memory types in what it answers: it answers “how do I do this”, while the others answer “what happened”, “what is true” or “what am I working on now”. Mixing them leads to cluttered context and unreliable behavior.

Memory typeQuestion it answersTypical contentTypical lifetime
Working memoryWhat am I doing right nowCurrent goal, scratchpad, recent tool outputOne task
Episodic memoryWhat happened beforeLogs of past sessions and outcomesWeeks to months
Semantic memoryWhat is trueFacts about users, systems and domainsUntil facts change
Procedural memoryHow do I do thisSkills, workflows, rules, codeUntil the method changes
Agent memory types and their roles

The boundaries are practical rather than absolute. A stored note such as “the staging database requires a VPN” is semantic, while “connect to the VPN before running migrations” is procedural. Good memory design keeps such items in the store that matches how they will be used.

Designing a procedural memory store

A procedural memory store works well when each procedure is small, clearly scoped and described for retrieval. Long, monolithic instructions consume context and are retrieved for the wrong tasks. The decision table summarizes common design choices.

SituationRecommended formReason
Deterministic, repeated stepsExecutable code or scriptRemoves model variability
Steps needing judgmentNatural-language skill fileLets the model adapt to details
Rules that apply to every taskSystem prompt or harness policyAlways present, no retrieval needed
Many skills, limited contextDescription index with lazy loadingLoads full text only when relevant
Skills learned automaticallyHuman review before activationPrevents encoding of bad habits
Design choices for procedural memory

Versioning is essential. When a procedure changes, the store should keep the previous version and record why it changed, because a silent update can break workflows that depended on the old behavior. Teams that share skills across agents usually treat them like code, with review, tests and ownership.

Risks and common mistakes

The central risk of procedural memory is that it makes errors persistent. A flawed procedure learned once is replayed in every future task, often with more confidence than a fresh plan would have. Self-written skills therefore need the same scrutiny as code merged into production.

  • Overfitting: a procedure encodes details of one case, such as a hard-coded path, and fails elsewhere.
  • Stale procedures: an external API changes, but the skill still describes the old interface.
  • Memory poisoning: injected content from a web page or document is saved as a trusted skill.
  • Retrieval mismatch: vague descriptions cause the wrong skill to load or the right one to be missed.
  • Permission creep: a skill silently grants itself broader tool access than the task requires.

Mitigations follow from these failure modes: provenance tracking for every stored procedure, periodic re-validation against current systems, and a rule that no procedure acquired from untrusted content becomes active without human approval.

The idea in brief

Think of a new employee. At first, every task takes long, and each step needs thought. After a few weeks, the employee knows the routine. Filing a report or resetting a password happens almost automatically.

Procedural memory gives an AI agent the same kind of routine. It is a collection of saved methods. When a familiar task comes up, the agent uses the saved method instead of working everything out again. The agent becomes faster and more consistent. The saved methods must still be checked, because a bad habit repeats every time.

A practical scenario

An IT operations team runs a coding agent that handles routine database maintenance requests. In its first month, the agent plans each request from scratch, and about one task in five fails because it forgets to pause replication before resizing a volume.

The team adds a procedural memory store. After each successful run, the agent proposes a parameterized skill, such as “resize a replicated volume”, with the exact step order and the required checks. An engineer reviews each proposal, rejects overfitted ones and approves the rest. The agent retrieves skills by description and loads only the matching one into context.

After two months, the store holds 14 reviewed skills, the failure rate on covered tasks drops to near zero, and planning time falls noticeably. When the cloud provider changes its resize command, the team updates one skill file instead of correcting the agent in every session, which shows the value of explicit, versioned procedures.