Glossary
Self-correction
An AI agent's ability to notice that a step went wrong, from an error, a failed check or its own review, and try again with a better approach.
Self-correction is an AI agent’s ability to notice that one of its steps has gone wrong and fix it before moving on. The signal can come from outside, such as a tool error, a failing test or a schema check, or from the agent reviewing its own output. Either way the agent feeds the problem back into the agent loop, revises its approach and tries again, instead of building the rest of the task on a mistake.
Where the correction signal comes from
Self-correction is only as good as the feedback that triggers it. The sources below run roughly from most to least reliable.
Signal | Example | Reliability |
|---|---|---|
Execution result | A tool call returns an error, or code fails its tests | High: the failure is concrete and specific |
Validation | Output fails a JSON schema, a type check or a business rule | High for format, limited for meaning |
Retrieval check | The answer is compared with source documents | Good when retrieval finds the right passage |
Separate judge | A second model or prompt grades the output | Moderate, depends on the judge |
Self-review | The same model critiques its own answer | Lowest without any outside evidence |
External signals work best because they give the model something new to reason about. Research on language models has found that asking a model to review its own reasoning, with no extra information, often leaves the answer unchanged or makes a correct answer worse. Checks against tools, data and tests do not have that problem, which is why practical agents lean on them.
Common self-correction techniques
The simplest technique is retrying after a tool error with the error message in context, so the model can fix a wrong argument or a malformed request; ordinary retry logic and exponential backoff handle transient failures that need no change at all. For outputs consumed by code, structured output with a JSON schema lets the agent detect a bad response and regenerate it.
For factual answers, the agent can check its draft against retrieved sources and revise anything unsupported, which targets hallucination and improves grounding. Corrective RAG applies this to retrieval itself, judging whether retrieved documents are good enough before using them, and Self-RAG trains the model to critique its own retrieval and generation. A separate grader, often an LLM as a judge, can score faithfulness before an answer is returned.
Longer-running agents add reflection: after a task, the agent writes down what went wrong and what to do differently, and that note is fed into later runs. Stored lessons of this kind are a form of procedural memory.
Limits of self-correction
Self-correction catches the errors an agent can detect, which leaves the ones it cannot. An agent that misreads the task will check its work against the wrong standard. Repeated retries cost tokens and time, and without an iteration limit an agent can loop on the same failure. And some actions cannot be corrected after the fact, such as an email already sent or a file already deleted. That is why self-correction sits alongside guardrails, human-in-the-loop review for risky steps, and agent rollback for changes that need reversing. Agent evaluation measures how often correction succeeds, and agent observability shows where it did not.
Self-correction with Exabase
Exabase supplies pieces that make correction possible, while the correction logic stays in your agent. Deep Search returns the specific passage with a page number or timestamp, which gives an agent concrete evidence to check a draft against. Memory keeps corrections from being forgotten: when a user rejects a suggestion or a fact changes, Memory records the new information and resolves the contradiction with the old one, so the next session starts from the corrected version.
When an agent’s mistake has already changed data, filesystem snapshotting on a Base lets you view the Base as it was before the run and recover deleted resources, as described in the snapshotting guide and on the agent undo page. Snapshots record resource metadata such as names, locations and deletion state, not file content, and actions outside the Base, such as sent emails, are not reversed.
FAQs
What is self-correction in AI agents?
Self-correction is an agent’s ability to detect that a step failed or produced a wrong result and to revise its approach and try again, using feedback from tools, checks or its own review.
Can LLMs correct their own mistakes?
Partly. They correct reliably when given concrete feedback such as an error message, a failed test or a source that contradicts them. Reviewing their own reasoning with no new information is much less reliable.
What is the difference between self-correction and reflection?
Self-correction fixes a mistake within the current task. Reflection looks back after a task and records lessons that change how future tasks are approached.
How do you stop an agent from retrying forever?
Cap the number of retries per step and set a budget for the whole run. If the agent still fails, it should stop and report the problem rather than keep trying.
Does self-correction replace human review?
No. It reduces the number of errors that reach a person, but irreversible or high-impact actions still benefit from approval and from a way to roll changes back.
Related pages: Agent loop, Agent planning, Reflection, Corrective RAG, LLM as a judge, Agent rollback, Coding assistants use case, Designing agents for recoverability, Best agent sandboxes, Agent undo solution, Agent swarm.