Pattern
How AI agents learn new skills and improve their own procedures
Self-improving agents get better by writing down what worked as reusable skills: short procedures, checklists or scripts they load next time a similar task comes up. The model does not change; the library of procedures around it does, ideally with a person reviewing each change.
Explained from public sources. Mai has not built this yet.
On this page
In plain English
When a new member of staff works out the right way to raise a purchase order, a good manager asks them to write it down so the next person does not have to rediscover it. Self-improving agents do the same. After a task, the agent notes what worked, what went wrong and what it would do differently, and saves that as a procedure it can follow next time. The AI model underneath stays the same; what grows is the playbook it reads from.
How it works
A skill is a small package of know-how. In the form Anthropic describes for its agents, a skill is a folder holding a file with a name, a one-line description of when to use it, and instructions, plus optional scripts and reference documents. The agent keeps only the names and descriptions in view. When a task matches, it opens the full instructions, and it reads deeper files only if it needs them. That layered loading means an agent can carry many skills without filling its context.
Skills can contain code as well as prose. A step that must be exact every time, such as pulling fields from a form or reconciling two lists, is better as a script the agent runs than as instructions it interprets.
The self-improving part is a loop around those skills:
- Attempt. The agent does a task using whatever skills it has.
- Check. Something judges the result: a test, a validation rule, an error from a system, or a person’s correction.
- Reflect. The agent writes a short, specific lesson. Reflexion, a research approach, showed that storing these written reflections and feeding them into later attempts improves results without touching the model’s weights.
- Propose. The lesson becomes a change to a skill, or a new skill. Voyager, an agent that learned to play Minecraft, kept a growing library of working code for behaviours it had mastered and reused it to build more complex ones.
- Review and publish. The change is tested and, in a business setting, approved before other runs use it.
Attempt task. Then Check result, Reflect. Then Proposed change. Then Replay past cases. Then You approve. Then Skill library.
Anthropic’s own write-up is candid that agents creating, editing and evaluating skills entirely by themselves is a goal rather than something to rely on today. The dependable version now is agent-drafted, human-approved.
Where it goes wrong
- Learning the wrong lesson. One unusual case becomes a rule for every case. A lesson drawn from a single failure needs testing against the ordinary cases it might break.
- Skill sprawl. Dozens of overlapping procedures with similar descriptions confuse the agent about which to load. Skills need owners, merging and retirement.
- Bad feedback. If the “check” step is weak, the loop reinforces mistakes. The loop is only as good as the signal that says a result was right.
- Untrusted skills. A skill is instructions plus code, so a malicious or careless one can leak data or take actions nobody intended. Anthropic advises installing skills only from trusted sources and auditing any others, including their scripts and any network access.
- Silent drift. If skills change without versioning, nobody can say why the agent behaves differently this month. Every change needs a history and a way back.
How Mai AI uses it
In a Mai AI system, I treat skills as part of the client’s operating manual, written in plain language that staff can read. Each one has a description of when it applies, the steps, the systems it touches and who owns it. Where a step must be exact, I put it in a script rather than in prose.
I design the improvement loop so that agents propose and people decide. When a run fails, is corrected by a person or takes a slow route, the agent drafts a lesson and a suggested change to the relevant skill. That change is versioned, replayed against real past cases (see testing agents) and goes live only after approval through the same human approval gates used for any action that matters. Lessons that are facts rather than procedures go to agent memory instead.
The result I aim for is a system whose know-how belongs to the business and survives a change of model. If you would like your team’s procedures to become something agents can follow and improve, that is part of a custom AI operations system.
Questions and answers
Can AI agents improve themselves?
Yes, in a limited and useful way. Without retraining the model, an agent can record what worked and what failed as written procedures or code, and load those next time. The improvement lives in files you can read, test and roll back.
What is an agent skill?
A skill is a packaged procedure an agent can load when it is relevant: a short description saying when to use it, step-by-step instructions, and sometimes scripts or reference files. Only the description is kept in view until the skill is needed.
Do self-improving AI agents retrain the model?
Usually not. Approaches such as Reflexion and Voyager keep the model fixed and improve behaviour by storing written reflections or working code that the agent reuses on later attempts.
Is it safe to let an AI agent edit its own instructions?
Only with controls. Proposed changes should be versioned, tested against real past cases and approved by a person before they go live, because a bad lesson spreads to every future task.
Harnesses known for this
- Harness profileOpenClaw
OpenClaw is an open-source, self-hosted AI assistant that runs on your own machine and answers you in the chat apps you already use, such as WhatsApp, Slack, Teams and Telegram. It is best for one person or a small trusted team who want an always-on assistant with scheduled jobs, skills and tools under their own control.
- Harness profileHermes Agent
Hermes Agent is an open-source AI agent from Nous Research that runs on a server or your own machine, talks to you through the terminal or chat apps, and writes reusable skills from the work it does. It suits people who want a long-lived agent that remembers, runs scheduled jobs and improves with use, on any model provider.
Related entries
- PatternAgent memory
AI agents remember in layers: short-term context is what the model can see in the current conversation, and long-term memory is stored outside the model and fetched back in when relevant. Vector stores find memories by meaning, graph stores by how people, records and events connect.
- PatternTesting agents
You test AI agents with evals, a set of realistic tasks with clear pass or fail checks that you run every time the agent, its instructions or its model changes. The best tasks come from real failures, and each one runs several times because agents do not behave the same way twice.
- PatternHuman approval gates
Human approval gates sort every action an AI agent can take into three levels: draft only, needs a person to approve, or allowed to run automatically. The agent prepares, a person signs off anything that matters, and the system refuses any action that does not match what was approved.
- ExperimentAura
Aura is an open-source AI companion with a state of mind that carries from one moment to the next: emotions that obey physics, memory that remembers how things felt, and five language models thinking in layers.