Procedural memory: reusable skills and how-to knowledge

Procedural memory stores reusable instructions as named skills that an agent matches, loads, and follows. Use it when tasks have a known good method and you want consistent, reviewable behaviour.

Procedural memory in 60 seconds

  • What: stored, reusable instructions that tell an agent how to do a kind of task, such as a checklist, a prompt template, or a small script.
  • Why: without it, you either rewrite the same instructions in every prompt or the agent improvises and varies from run to run.
  • How: keep a skill index of names and descriptions, match the task to a skill, load only that skill, and follow it.
  • Best for: repeatable work with a known good method, such as report formats, triage rules, and release checklists.
  • Watch for: skills that drift out of date, unreviewed self-edits, and an index so large that matching becomes unreliable.

Where this type fits

Procedural memory is the third long-term type. Semantic memory holds facts, episodic memory holds events, and procedural memory holds methods. The CoALA framework (Sumers et al., 2023) lists it alongside the others, and notes that it lives partly in the model weights and partly in code and prompts that you can edit. This page is about the editable part. See the Types of memory hub for the full picture.

The problem it solves

Many tasks have a right way to be done. A refund needs a check of the order date, the payment method, and the policy window, in that order. A weekly report has a fixed layout. A deployment has a checklist. If the agent has to rediscover the method each time, quality varies, and the model may skip a step that matters.

The simple answer is to put all instructions in one large system prompt. That works at first, then breaks down. Every call pays for every instruction, whether or not it applies. The prompt becomes hard to edit, because a change for one task can affect another. Long prompts also dilute attention, so important rules get followed less reliably.

Procedural memory splits the instructions into named skills and loads only what the task needs. The prompt stays short. Each skill can be written, tested, reviewed, and versioned on its own. Teams can add new skills without touching the rest. And because skills are data, an agent can propose improvements to them from feedback, with a person reviewing the change before it goes live.

How it works

  • Index: each skill has a short name and a one-line description of when to use it. The index is small enough to sit in the prompt, or to be searched.
  • Match: the model, or a retrieval step, compares the task with the descriptions and picks one skill, or none. Picking none is a valid answer.
  • Load: the full skill is fetched. It may hold steps, a template, example outputs, and the tools it may use.
  • Follow: the agent works through the steps. Fixed parts can be run as code, and judgement parts are left to the model.
  • Feedback: the result is scored by tests, a reviewer, or user feedback.
  • Improve: a proposed change to the skill is drafted, reviewed by a person or a test suite, and saved as a new version. The index points to the latest approved version.
Skills are matched from a small index, loaded in full, and improved through reviewed updates.

The top row is the run path. Only the index is always present, so the cost of having many skills is small. The bottom row is the improvement path. It is slower and happens between runs. The arrow back to the index matters: a new version only helps once the index points at it.

The Voyager paper (Wang et al., 2023) is a clear example. An agent in the game Minecraft builds a growing library of skills stored as executable code and reuses them on new tasks. Skills there are code, which means they can be tested by running them. Not every procedure can be code, but the idea carries over: store what worked in a form that can be checked and reused.

A worked example

Acme Finance has an agent that drafts month-end variance summaries. The skill index holds four entries: "variance-summary: use when asked to explain budget against actual for a team", "invoice-triage", "expense-policy-check", and "board-pack-outline".

A manager writes: "Explain why the marketing budget is 12 percent over for October." The agent compares this with the index and picks variance-summary. It loads the skill, version 3. The steps are: pull budget and actual by line; compute the difference and percentage; list the three largest lines; check each for a one-off cause; write four sentences in plain language; end with one question for the owner.

The agent follows the steps. It finds that the largest line is a conference sponsorship booked early, worth 8 of the 12 points. The summary says so and asks the owner whether the next quarter's sponsorship has been moved. The manager replies that the summary should also show the previous month. That feedback is saved. A proposed version 4 adds a step to include the prior month. A finance lead reviews it, runs it on two past months, and approves it. From then on, the index points to version 4.

A skill stored as data (illustrative) (json)
{
  "name": "variance-summary",
  "version": 3,
  "description": "Explain budget against actual for one team and period",
  "tools": ["read_ledger"],
  "steps": [
    "Pull budget and actual by line",
    "Compute difference and percentage",
    "List the three largest lines",
    "Check each for a one-off cause",
    "Write four plain sentences",
    "End with one question for the owner"
  ],
  "status": "approved"
}

Building it

The sketch keeps skills as versioned records. It matches a task to a skill with a score floor, loads only approved versions, and limits how much a run can do. Self-improvement only creates a draft. Nothing goes live without review. The helpers are placeholders.

Matching, running, and proposing skill updates (illustrative) (python)
# Placeholders: llm.generate(), embed(), skills (a versioned store), run_tool().
MIN_MATCH = 0.75     # below this score, use no skill rather than a poor one
MAX_STEPS = 12       # a skill must not run without a bound
MAX_SKILL_CHARS = 6000  # long skills crowd out the task and dilute attention

def match_skill(task):
    q = embed(task)
    # The index holds only names and descriptions, so it stays small.
    candidates = skills.search_index(vector=q, top_k=3, status="approved")
    if not candidates or candidates[0]["score"] < MIN_MATCH:
        return None                      # "no skill" is a valid result
    return candidates[0]["name"]

def run_with_skill(task):
    name = match_skill(task)
    if name is None:
        return llm.generate("Complete the task: " + task)
    skill = skills.get_latest_approved(name)   # never load drafts
    body = "\n".join(
        str(i + 1) + ". " + s for i, s in enumerate(skill["steps"]))[:MAX_SKILL_CHARS]
    prompt = ("Follow these steps in order. Say if a step cannot be done.\n"
              + body + "\n\nTask: " + task)
    steps_done = 0
    result = None
    while steps_done < MAX_STEPS:        # bound the loop
        result = llm.generate(prompt, tools=skill["tools"])
        if result.get("tool_call"):
            prompt += "\n" + run_tool(result["tool_call"])
            steps_done += 1
            continue
        break
    return result

def propose_update(name, feedback):
    # Self-improvement writes a DRAFT only. A person or a test suite approves it.
    current = skills.get_latest_approved(name)
    draft = llm.generate(
        "Improve these steps using this feedback. Change as little as possible.\n"
        + "\n".join(current["steps"]) + "\nFeedback: " + feedback)
    skills.save_draft(name, base_version=current["version"], steps=draft)

Design decisions

  • Where skills live: as files or records in version control or a database, not buried in prompts. Default: one skill per record with a name, a description, steps, allowed tools, an owner, and a version.
  • Matching: a small index in the prompt works for a few dozen skills, and retrieval works beyond that. Default: start with the index in the prompt and move to retrieval when matching errors appear.
  • Granularity: one skill for one job. Default: split a skill if it has more than about ten steps or serves two different audiences.
  • Versioning and approval: every change creates a new version, and only approved versions are loaded. Default: keep old versions so you can roll back in minutes.
  • Permissions: a skill lists the tools it may use, and the runtime enforces that list. Default: least privilege, with confirmation for anything that sends, pays, or deletes.
  • Self-editing: let the agent propose changes, not apply them. Default: drafts go through review and a test run on past cases.
  • Failure handling: if no skill matches or the store is down, fall back to a plain prompt. Default: log the miss, because misses show which skills to write next.

Measuring it

  • Match accuracy: on a labelled set of tasks, the share where the right skill (or no skill) was picked. Compute it before you tune anything else.
  • Step adherence: the share of runs that followed the steps in order, judged by a reviewer or by checking the trace.
  • Task success with and without the skill: run the same tasks both ways. This shows whether the skill earns its keep.
  • Variance between runs: run the same task five times and compare outputs. Skills should reduce this spread.
  • Update acceptance rate: the share of proposed changes that reviewers approve. A very low rate means the improvement loop is not producing value.
Checking that steps were followed in order (illustrative) (python)
def adherence(trace, steps):
    # trace is the ordered list of step labels the agent reported completing.
    it = iter(trace)
    return sum(1 for s in steps if s in it) / len(steps)  # in-order matches

When to use it, and when not to

SituationUse this type?Why
A task has a known good method that must be followedYesSkills make the method explicit, testable, and consistent.
Many task types, each needing different instructionsYesLoading only the matching skill keeps prompts short.
Teams need to review and change agent behaviour safelyYesSkills are versioned data with owners and approval.
The task is open-ended explorationNoA fixed method gets in the way of discovery.
Only one or two simple instructions existNoA short system prompt is simpler than a skill library.
You want the agent to rewrite its own skills freelyOnly with reviewUnreviewed edits can degrade or weaken safe behaviour.

Trade-offs

DimensionEffectWhat to do about it
QualityMore consistent output on covered tasksTest skills on past cases and keep them short and specific.
LatencyA match step and a load step add a little timeKeep the index small and cache loaded skills.
CostFewer prompt tokens per call, plus authoring effortWrite skills only for frequent tasks first.
ComplexityA library to curate, version, and retireName an owner for each skill and review them on a schedule.
Failure modesWrong skill chosen, stale steps, unsafe self-editsAllow "no skill", expire unused skills, and require approval for changes.

Episodic memory records what happened. Procedural memory records what to do. A common path is to notice that the same episodes keep succeeding in the same way, then write that method down as a skill. Semantic memory is different again. It stores facts that a skill may use, such as the refund window.

Procedural memory also differs from tool calling. A tool is a capability, such as reading a ledger. A skill is guidance on when and how to use capabilities. See Tool calling and MCP for the first and this page for the second.

What this means for your role

Common mistakes

Further reading

Procedural memory turns good methods into reusable, reviewable assets. Keep skills small, versioned, and owned, and let feedback propose changes that people approve.

Search topics

↑↓ to move · Enter to open · Esc to close