Rylvo
Blog

Self-Improving AI Agents: How They Work and Where a Person Stays in the Loop

How self-improving AI agents spot repeated failures and draft rules, why a person should approve each rule, and how a bad rule gets rolled back.

In this articleOverview

A self-improving AI agent is one that reads its own past replies, groups the failures that repeat, and turns each into a rule or a settings fix for later replies. It does not retrain the model. The safe version has a person approve each rule, checks it on old conversations first, and rolls it back when its replies keep failing. It is one part of a launch-and-run quality routine; the full checklist is in how to test an AI chatbot before launch.

Key takeaways

  • "Self-improving" in production almost always means changing instructions, checks and settings around a fixed model, not retraining the model.
  • The loop has six parts: record replies, spot repeats, review a batch, draft a rule, check it on past conversations, then track it and roll it back if it fails.
  • A rule usually applies to every reply at once, in Test and in Production alike, so the default should be that a person approves each one.
  • Check a rule before it goes live by replaying the conversations it was written for, with and without it. Pass only if nothing got worse.
  • Automate in stages. Start by watching; turn on automatic reviews, drafting and turn-on only as the drafts earn trust.

What does "self-improving" mean for an AI agent?

The phrase covers several techniques, and they fail in different ways.

ApproachWhat changesTypical turnaroundHow you undo itFits when
Fine-tuningThe model's weightsA training run, then re-testingTrain again, or switch back to the old modelYou need a new style or skill across all replies and have enough labelled examples to train on
Prompt optimizationThe whole system promptOne edit and a replayRoll back to an earlier prompt versionThe core instructions are wrong or unclear
Memory (per user or episodic)What the agent recalls about a person or a past casePer conversationDelete the memoryReturning customers expect the agent to remember them
Learned rulesOne instruction or one check, added next to the promptOne rule and a replayTurn off that one ruleThe same narrow failure keeps coming back

Most of what people call a self-improving AI chatbot is the last row. Learned rules are the easiest of these to govern: every change is a small, named object you can read, check and switch off.

The Reflexion paper (Shinn et al., 2023) showed agents improving by writing short reflections on their failures and reading them on the next attempt, with no weight updates. In the paper's coding benchmark, a GPT-4 agent using reflections reached 91% pass@1 on HumanEval, against 80% for GPT-4 without them (revised October 2023). Production systems add guardrails: the reflection becomes a rule, and the rule must prove itself before customers see it.

How do self-improving AI agents work, step by step?

Most self-improving agents follow some version of these six steps.

1. Record each reply

Keep a record of each reply: the customer's message, what the agent said, the steps and tool calls it took, how long they took, and whether anything errored. Every later step reads this record, and rules are judged against it. Observability comes first.

2. Spot failures that repeat

A single bad reply is a case to fix. A failure that comes back is a pattern worth a rule. Many repeats can be found with no AI at all: a tool that timed out again, the same reply sent twice, a reply that ran out of steps.

3. Review a batch of replies

An AI reviewer reads a batch of recent replies, plus any a customer rated down, and writes findings: what went wrong, the likely cause, a suggestion, and how sure it is. Splitting the review into narrow reviewers (loops, slow steps, answer quality, bad tool inputs) keeps each brief short and each finding easy to trace back to its replies.

4. Draft a rule

A finding becomes a rule. A rule is narrow: "When a customer asks about a refund after 30 days, explain the store credit option and do not promise a refund." There are four useful kinds:

  • Instruction: added to what the agent is told for each reply.
  • Message check: turns a customer message away before the agent runs.
  • Reply check: replaces a reply that mentions something forbidden.
  • Tool check: stops a blocked tool call, or one missing a required field.

5. Check the rule on past conversations

This step matters most, because it is the one that tells you whether a rule helps. It has its own section below.

6. Track the rule, and roll it back if it fails

Once a rule is on, count the replies it was applied to and how they went. If too many of them fail, turn the rule off automatically and keep its history so a person can see why.

Why should a person approve each rule?

A learned rule usually does not ship in a release. It belongs to the agent and applies to every reply the moment it is turned on, so one rule drafted from a misread conversation can change thousands of answers.

There are three concrete risks:

  1. The reviewer misreads the failure. It sees a refund complaint and writes a rule that refuses all refunds.
  2. Rules collide. A new instruction contradicts an older one, and which one the model follows can vary from reply to reply.
  3. The agent learns from bad input. If the loop reads every conversation, a person can steer it with crafted messages. The OWASP Top 10 for LLM Applications lists data and model poisoning as LLM04:2025 (as of November 2026). It is written about pre-training, fine-tuning and embedding data, but the lesson carries over: anything an agent learns from is an attack surface, so a person should read each rule before it applies to every reply.

Article 14 of the EU AI Act sets human-oversight requirements for high-risk AI systems: the people overseeing a system must be able to understand its limits, override its output and stop it. As of November 2026, the AI Omnibus has moved the high-risk obligations for stand-alone (Annex III) systems from 2 August 2026 to 2 December 2027. Most customer service chatbots are not high-risk under the Act, so treat it as a design checklist, not a legal duty. It is the right checklist for a self-improving agent too.

So the defaults should be conservative. Drafts wait for approval, and red-team attacks are never learned from.

How do you check a rule before it goes live?

A rule check answers one question: on the conversations that caused this rule, does the agent answer better with it?

  1. Pick the conversations. Take the ones the rule was written for, up to a handful. More is better, but each replay costs a model call.
  2. Replay each one twice. Once as the agent answers today, without the rule, and once with it.
  3. Replay with tools off for instruction, message-check and reply-check rules. A replay must not book an appointment or send an email again. A tool check only acts when tools run, so it replays on the Test bot with tools on. Tools that change things outside Rylvo run only after a person allows it.
  4. Judge each pair. A review model labels the pair as fixed, no change, worse, or not reproduced (the problem did not show up in the replay), with a one-sentence reason a business owner can read.
  5. Decide with a strict bar. Pass only if no reply got worse and the rule fixed at least half of the replays that showed the problem. Then read the pairs side by side yourself.

A failed check usually means a rule is the wrong fix: the knowledge base is missing a page, a tool is too slow, or the prompt is wrong. Our guide to why chatbots hallucinate covers the knowledge side.

A worked example

Say 3 of an agent's last 10 replies failed, all about refunds after 30 days, because the agent promised a refund the store does not give.

  1. The answer-quality reviewer reads the 3 conversations and reports the cause.
  2. It drafts the refund rule from the loop above, as an instruction.
  3. The check replays the 3 conversations without the rule and with it. The judge finds 2 fixed, 1 no change and 0 worse.
  4. Two of three is at least half of the replays that showed the problem, and none got worse, so the check passes. A person reads the pairs and approves the rule.
  5. After 5 uses, 1 reply failed. That is 20%, not more than 20%, so the rule stays on. A second failure within those 5 uses would turn it off.

For the wider testing picture, regression suites and launch checks, see how to test an AI chatbot before launch.

How do you roll back a rule that fails?

Rollback needs two numbers: a minimum number of uses before it can fire, and a failure rate that triggers it. Without the minimum, one unlucky reply turns off a good rule. Without the rate, a bad rule stays on.

A reasonable starting point is 5 uses and a 20% failure rate, so one failure in 5 uses (20%) does not turn a rule off, and two do. Keep a cap on active rules too (Rylvo's default is 50 active rules). A long rule list also adds to the prompt every reply carries, so retire rules that no longer fire. When a new rule would go past the cap, turn off the least effective rule that is on.

Keep every version of every rule, so its history shows what changed and who approved it.

How much of a self-improving agent should you automate?

Do not turn everything on in week one.

StageWhat runs by itselfWhat a person doesMove on when
1. WatchRecording and repeat detectionReads repeated failures weeklyYou trust the repeat list
2. ReviewReviews start on their own when failures pile upReads findings, drafts rules by handFindings are usually right
3. DraftRules are drafted from each reviewChecks and approves each draftMost drafts pass their check
4. Fix settingsNarrow settings fixes in Test, undone if a replay still failsReleases fixes to ProductionFixes rarely get undone
5. Turn onRules above a confidence bar are checked on past replies and turn on by themselves if the check passesReads the change log, handles rollbacksOptional. Many teams never do this

Stage 5 is the only one where a change reaches customers with no person in between. For an agent that answers a few hundred questions a week, approving each rule takes minutes and is worth it.

How Rylvo does it: Agent Evolution

Agent Evolution is Rylvo's version of this loop. It is part of Pro ($100 a month) and Enterprise, and of the Pro trial (7 days of Pro, 7 more when your first customer talks to it). Prices checked on 2026-11-17; current plans are on the pricing page. Reviews and rule checks use the AI replies included with your plan, or your own AI provider key if you add one.

It is off for each bot until you turn it on. After that, each part of the loop has its own switch:

SwitchDefault once onWhat it does
Record repliesOnKeeps the record every rule and rollback runs on
Spot repeated failuresOnAfter each reply, checks whether a known failure came back, with no AI
Review on its ownOffStarts a review when 3 of the last 10 replies failed (both numbers are settings) or 3 repeated failures are open, at most once every 5 minutes
Draft rules on its ownOffWrites a rule for each finding; it waits for approval
Fix in Test by itselfOffChanges a setting it can read for certain, in Test only, then replays the failing messages. If the failure still happens, it undoes the change. If the replay is inconclusive or cannot run, the change stays in Test and you are told to check it
Confident rules turn on by themselvesOffA draft at or above the confidence you set (70% by default) is checked on the replies it was written for, and turns on only if that check passes. The rest wait for approval
Roll back rules that keep failingOnAfter 5 uses, turns a rule off if more than 20% of its replies failed

The details that matter in practice:

  • Four reviewers. Pattern, Speed, Answer-quality and Input. Each has a brief you can edit, and each finding links back to the replies that support it.
  • Rule checks. Up to 5 conversations (3 for a tool check, which runs real tool calls) are replayed without the rule and with it, and judged. The check passes when none got worse and at least half of those that showed the problem were fixed. Turning on a rule that has not passed asks you first.
  • Fix in Test by itself changes only settings: a bot's per-reply limits (steps, time, cost, tool calls), its conversation-context settings (summarizing older messages, a history token budget), and a connector's time limit and retries. It never writes a rule. It makes one fix per bot at a time and at most 5 a day. A fix whose replay still fails is undone; if the replay is inconclusive or cannot run, the change stays in Test and you are told to look. A fix reaches Production only in a release you activate. See Test vs Production for how releases work.
  • Rules skip releases. A rule belongs to the bot, so once on it applies to Test and Production replies alike. That is why approval is the default.
  • You choose the traffic. Per bot, Test replies, Production replies, or both feed the loop.
  • Memory and skills are separate switches. Per-user personalization, episodic memory and promoting repeated fixes into skills are all off by default.

How it fits with the rest of the quality tools

Edge Cases (also Pro, and in the trial) opens a case when one reply goes wrong, for a person to fix in Test; it never applies a fix by itself. Agent Evolution looks across replies for what repeats. When a rule is wrong and a customer is waiting, Mission Control (also Pro and above) is where a person takes over the conversation. Tests hold the questions you never want to break, and Prompts is where you rewrite the core instructions when rules pile up.

When a self-improving agent is the wrong tool

  • Low volume. If your agent answers 50 questions a week, read them. A weekly review in Traces finds the same problems for no AI cost.
  • The knowledge is missing. If the agent fails because your returns page is not in its knowledge base, no rule fixes that. Add the page.
  • The prompt is wrong at the root. Ten rules patching one misunderstanding mean the prompt needs a rewrite.
  • You need a new skill across all replies. A new tone or an unfamiliar domain is a model-choice or fine-tuning question.

Frequently asked questions

What is a self-improving AI agent?

A self-improving AI agent reads its own past replies, groups the failures that repeat and turns each into a rule or a settings fix for later replies. The model is not retrained.

Can an AI chatbot really learn from its mistakes?

Yes, but not by retraining the model. A self-improving agent records its replies, notices failures that repeat, and turns each one into a written rule or a settings change that is applied to later replies. The model itself stays the same; what changes is what the agent is told and checked against.

Is a self-improving agent the same as fine-tuning?

No. Fine-tuning changes the model's weights with a training run, which is slow to repeat and hard to undo for one behavior. A self-improving agent changes instructions and checks around the model. Each change is small, has its own track record and can be turned off on its own.

Should a self-improving agent turn its own rules on?

For a customer-facing agent, start with a person approving every rule. A rule usually applies to every reply at once, so a wrong one reaches every customer. Automatic turn-on is reasonable only after rules have been checked on past conversations and the team trusts the drafts.

How do you know a new rule did not make things worse?

Replay the conversations the rule was written for, once without the rule and once with it, and judge each pair as fixed, no change, worse, or not reproduced. Turn the rule on only if no reply got worse and at least half of the replays that showed the problem were fixed. After that, track how the replies it was applied to went and roll it back if too many fail.

Which Rylvo plans include Agent Evolution?

Agent Evolution is part of Pro and Enterprise, and of the Pro trial (7 days of Pro, 7 more when your first customer talks to it). Reviews and rule checks use the AI replies included with your plan, or your own AI provider key if you add one. It is off for each bot until you turn it on.

Build your first agent on the free plan.