When to reach for it
- Recurring complex solution paths need to be optimized.
- The agent must continuously adapt in a dynamic environment.
Turn winning trajectories into named, reusable procedures.
The agent distils successful action sequences into reusable, named skills — often executable code — and stores them in a growing skill library it retrieves and composes on future tasks, instead of re-planning from scratch. This is procedural memory.
In practiceAn automation agent derives a reusable 'export-to-CSV' skill from three successful runs of that task, then calls it directly on subsequent similar requests without re-planning from scratch.
A solved task becomes a named piece of code, but only after a check has confirmed that it worked. The next task starts with a search of the library.
1 · Build, after a success
2 · Reuse, before the next task
| Request | Library | What happens | Model calls |
|---|---|---|---|
| Export the March orders as CSV | Empty | Plans from scratch, fails once at pagination, succeeds. Stored as export_orders_csv(month). | 9 |
| Export the April orders as CSV | 1 skill | Finds the skill and calls it with month = April. | 2 |
| Email the April orders to finance | 1 skill | Writes email_report(), which calls export_orders_csv. Stored as a second skill. | 5 |
| Export the April refunds as CSV | 2 skills | Finds export_orders_csv, because the descriptions are similar. It reads the wrong table. | 2 |
def solve(task):
skills, feedback = library.search(embed(task), k=5), None
for attempt in range(4):
program = model(write_program(task, skills, feedback))
result, feedback = run(program)
if critic(task, result): # stored only after verification
library.add(embed(describe(program)), program)
return result
return None # give up and take another taskWhen to reach for it
When it backfires
A skill is extracted from one successful run. It encodes accidental details — exact phrasing, ordering, tool choice — and breaks on the next variant.
Countermeasure
Require N successful runs of similar shape before promoting a candidate to a skill. Generalize parameters by diffing the runs.
Once promoted, a skill is called without re-checking. A subtle bug — or a tool surface that later changed under it — now corrupts every downstream task that retrieves it.
Countermeasure
Attach a regression test to each skill; re-validate on promotion and whenever a referenced tool surface changes, and retire skills that fail rather than calling them blindly.
Keep going
Search patterns, frameworks, and pages.