# An Agent That Fixes Its Own Mistakes - Saloni Gandhi & Ziwei Guo, LinkedIn <!-- ref: @content/youtube/aie/an-agent-that-fixes-its-own-mistakes-saloni-gandhi-ziwei-guo tags: [recursive self-improvement, LLM-as-judge, agent evaluation, root cause analysis, prompt optimization, human annotation, regression testing] version: 2 updated_at: 2026-11-24T05:16:54.019Z --> **[Watch on YouTube](https://www.youtube.com/watch?v=yH7_SIIgI-Y)** # An Agent That Fixes Its Own Mistakes - Saloni Gandhi & Ziwei Guo, LinkedIn *Synthesized from Saloni Gandhi and Ziwei Guo's talk on AI Engineer, 2026-11-10.* Saloni Gandhi and Ziwei Guo present recursive self-improvement (RSI) work on a LinkedIn agent that models user intent. Ziwei opens and covers the loop, and Saloni covers the evaluation results. The transcript spells the second name "Zhiwei." ## Core Thesis Saloni Gandhi and Ziwei Guo argue that an agent can be improved by a repeated loop of evaluation, root-cause reflection, prompt change and validation, but that the loop is only as good as its judge. Their finding is that the quality of the evaluator matters as much as the optimizer, and that a reflection step can produce convincing explanations that point at the wrong component. ## Key Insights - **The target agent.** It is a LinkedIn user-understanding agent. It takes a user ID and the user's search history, profile and preferences, and outputs structured fields such as desired position, each with a confidence level, citations and a rationale. - **An optimization ladder.** The presenters order possible targets from easiest to hardest: prompts, then structural context, then workflow design, then toolkit code, then the optimizer's own code. They are working on prompts now. - **The seven-step cycle.** Run the agent and record traces; score the traces with an evaluator; reflect to find root causes; propose changes; test the changes with the same judge; adapt the prompt; and re-run evaluation. The accepted result becomes the new baseline, and the cycle runs on a schedule. - **The judge.** An LLM judge scores 15 dimensions on a 1-to-3 scale, where 1 is low, 2 is acceptable and 3 is very high. One example user scored 2.31 overall, with a note for each dimension. - **Reflection in four parts.** Failed rows are clustered by dimension. An L2 judge assigns a root cause and tag to each row, which may be the prompt, the agent, the environment, the code, or the judge or rubric. Near-duplicate root causes are merged, and the rest are ranked by frequency into a scorecard for people. - **Proposals.** A method the transcript calls JIPA suggests prompt edits from the root causes, on mini-batches. The best candidates are checked on a validation set and then promoted to production. - **Human audit of the judge.** Reviewers annotated 180 to 200 cases. Agreement with the judge was about 55% at score 1, 57% at score 2, and 80% at score 3. It was weakest on desired positions, about 47% on expertise and about 50% on type of work. - **Causes of disagreement.** The judge rated whether a fact was plausible, not whether the evidence was complete. Domain, function and skill were confused. There was no partial-credit rule, and harmless formatting differences were penalized. Of 37 scores judged too harsh, 31 were single-score outcomes. - **Fixes and results.** Formatting and headline normalization, seniority rules for part-time work, and separating low scores from partly correct ones raised human agreement from 57% to 64%, and cut average error from 0.96 to 0.74. - **Reflection errors.** The original taxonomy could not blame the judge, so the reflection agent sometimes blamed the rubric when the judge was wrong. It also reused the judge's reasoning without checking it, which made the L2 judge the next priority. - **Scaling.** The presenters propose shared infrastructure: reusable evaluation frameworks, automated feedback loops, scaled optimization, validation and regression testing, and self-service tooling for other teams. Their stated goal is a steeper improvement curve over time, not a higher single score. ## Actionable Takeaways 1. Calibrate the judge against human annotations before letting it drive changes, and report agreement by score band and by dimension. 2. Write explicit rules for partial credit, formatting and edge cases, so the judge does not penalize harmless differences. 3. Give the reflection step an option to blame the judge, and check its explanation against the agent's own conclusion. 4. Cluster failures, merge duplicate root causes and rank them by frequency before proposing any edit. 5. Accept a prompt change only after it passes a validation set and a regression check. ## Notable Quotes > "the quality of the estimator is just as important as the quality of the optimization system" — Saloni Gandhi > "the reflection system can create convincing explanations while misidentifying the real problem" — Saloni Gandhi > "Recursive self-improvement is built around a specific AI system" — Ziwei Guo --- *Related: `@protocol/eval` · `@content/youtube/no-priors/ai-for-atoms-how-periodic-labs-is-revolutionizing-materials-engineering-with-co-founder` · `@content/youtube/cole-medin/let-your-ai-agent-do-its-own-harness-engineering-heres-how` · `@content/youtube/langchain/introducing-langsmith-tuned-evaluators` · `@content/youtube/cole-medin/im-building-an-ai-dark-factory-that-ships-its-own-code-public-experiment`* --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*