Self-improving AI agents

Let the unseen be seen. And fixed, automatically.

Peira watches your AI agent’s production runs and finds what keeps failing. Then it opens a pull request that fixes it. Each fix becomes a permanent check, so your agent improves every week.

Every fix is proven in simulation first. Nothing ships until a person approves it.

30-minute walkthrough. No preparation or production data required.

An illustration of one round of Peira's loop, in four steps: find a failure in live traces, prove a fix in re-runs, approve the pull request, and watch the agent improve.
support-agentFindIllustration

Live tracesfrom Langfuse

  • lookup_orderok
  • get_accountok
  • answer_questionok
  • issue_refund × 2defect
Defect
Refund issued twice for one duplicate chargeFound on step 4 of 14 runs this week

Proving fix B286 re-runs · world from 1,284 runs

The failing case
20 of 20
Order number missing
20 of 20
Refund tool times out
19 of 20
Protected runs
0 worse

Goal ✓Correct ✓Safe ✓Cost −8%Time −3%

Refund only the duplicate charge#128

Refund the amount the customer asks for.

Refund only a charge that appears twice. Confirm the amount first.

  • Proved in 286 re-runs
  • No protected run got worse
Approved by you

Four weeks of fixesFailed runs per week

Duplicate refunds per week
14 → 0
Protected set
12 → 31

Each round starts from everything the last one learned.

Sample data
Works with
  • Langfuse
  • LangSmith
  • OpenTelemetry
  • MCP
  • LangGraph
  • OpenAI Agents SDK
  • Claude Agent SDK
  • Google ADK
  • CrewAI
  • AutoGen
  • and more

One overview of every agent:
what broke, and what to do next.

Peira agent overview for a sample customer service agent: 100 traces, the share of tools the rebuilt world reproduces, one issue to fix, latency and tokens, runs over time, the next step from Onboard to Insights to Fix, top findings and the latest traces.
  1. Health at a glance

    Traces, failures, latency and cost for every agent, from the runs it already made.

  2. Always the next step

    Onboard, Insights, Fix. Peira shows where each agent stands and what to do now.

  3. An insight in plain words: the trace saved the wrong text as the answer, with how to fix it, how often it happened, and the exact step marked as the issue.

    Issues in plain words

    What went wrong, how often, how to fix it, and the exact step it happened on.

Screens from the Peira app, with a sample customer service agent.

Seeing what went wrong is only half of it.

Traces show you the failure. Finding the fix, and testing it, is left to you. Developers say so in public, every week.

How do you go from “I see the failure in the trace” to “I found the fix”
kamran-rapidfireAILangChain forum · 30 Mar 2026Source: the post by kamran-rapidfireAI (opens in a new tab)
I change a prompt or swap a model in my LangGraph app, and I have no easy way to tell what actually changed in the output
metawakeLangChain forum · 12 Mar 2026Source: the post by metawake (opens in a new tab)
However, this approach is quite custom, and it requires modifying production code solely for the purpose of mocking, which I would prefer to avoid.
dev-fjkgoogle/adk-python · 18 Jan 2026Source: the post by dev-fjk (opens in a new tab)

Public posts, quoted word for word. They describe the problem and do not mention Peira.

Onboard. Insights. Fix.
Then it keeps watching.

  1. 01

    Onboard

    Bring your agent in from its traces.

    • Connect Langfuse, LangSmith or OpenTelemetry, or add the SDK in two lines.
    • No agent code to change and no mocks to write.
    • Every new run streams in from then on.
  2. 02

    Insights

    See what is wrong, in plain words.

    • Loops, wrong arguments, ignored checks and failing tools.
    • Slow, costly and off-policy runs, grouped and ranked by impact.
    • Each issue shown on the exact step where it happened.
  3. 03

    Fix

    Fixed in code, proved, one pull request.

    • A coding agent changes the prompt, a tool or the code.
    • Peira re-runs the change in simulation until the proof is clear.
    • You review one pull request with the evidence attached.

Then the loop starts again, with everything the last round learned.

Every fix stays fixed,
so your agent improves every week.

Peira does not stop at one pull request. It keeps watching every new run, and each round builds on the last.

  1. 1

    Watch

    Every new production run streams in.

  2. 2

    Find

    New failures, and old ones that come back, ranked by impact.

  3. 3

    Fix and prove

    A fix is re-run against the failure and every protected run.

  4. 4

    Approve

    You merge it. The failure joins the protected set for good.

Back to 1, with more checks and a more accurate world.

support-agent · historyIllustration
  1. Week 1

    6 issues found. The largest: a refund issued twice for one duplicate charge.

  2. Week 2

    Fix #128 approved. Duplicate refunds stop. Protected set: 12 → 19.

  3. Week 3

    A regression was stopped. A later fix brought the double refund back in re-runs. The protected set rejected it.

  4. Week 4

    2 issues open. Failed runs: 38 → 9 a week. Protected set: 31.

Failed runs per week

Sample data

From a failed run
to a fix you can trust.

The fix, written for you.

Peira picks the issue that costs the most, or you pick one. A coding agent works on your repository, Peira proves the change in simulation, and you get one pull request.

  • Changes to prompts, tool descriptions or code.
  • Before and after, for every run it touched.
  • Once approved, the failure becomes a permanent check.

Refund only the duplicate charge#128

Proof in the simulated world, before and after the fix
RunTool errorsRefundsStop
run_8f2a2 → 02 → 1answer
run_91c41 → 02 → 1answer
run_a07d0 → 01 → 1answer

Sample data

Start from what your agent actually did.

Long, branching runs stop reading like a chat log. Peira draws the agent itself: what it is told, the model, every tool it can call, and the side calls.

  • Sub-agents, the files they pass on, and every pause for approval.
  • Every step opens to what the model saw or the tool returned.
  • Understand one run in minutes.
Know your agentProduct
Know your agent: a map of a sample agent, from the user and the system prompt to the model, its sixteen tools, a side call, and the answer to the user.

Proven in its own world.

Each fix is tested in a world rebuilt from your agent’s runs: its tools, records and rules, drawn as a map you can check. Peira also shows how far to trust it.

  • No mocks to write and nothing to change in your code.
  • Each tool shows how often it matches the real answer.
  • Where the world does not know, it says so.
Environment · MapProduct
The rebuilt world of a sample agent: each tool linked to the records it reads or updates, such as carts, discounts, products, dates and orders.

Before an outage, ask what if.

Make step 3 fail on purpose and watch what your agent does next. Each weak spot it finds becomes the next thing to fix.

  • A tool that answers differently, slowly, or not at all.
  • A record that is missing or never existed.
  • The human step too: pause, approve or reject, without a human.
  • Toolissue_refundtimes out
  • Recordorder 4417missing
  • Approvalsupervisorrejects

RecoveredThe agent apologizes, keeps the refund on hold and asks a person.

Illustration

Before a switch, ask again.

Re-run the same moment with another model or prompt, in the same world, and read both runs side by side.

  • Every changed tool call and argument is marked.
  • Switch models on evidence.
  • Every result scored the same way, every time.
Recorded

request_approvalamount: $120

Re-run · new model

issue_refundamount: $120

ChangedThe new model refunds where the recording asked for approval.

Illustration

Why you can trust
an automatic fix.

One good re-run proves nothing. Agents answer differently each time. So every change is re-run many times, across the case that failed, the variations it never saw, and every run that must not get worse.

  • Many re-runs, not one

    A fix counts only if it holds, run after run.

  • Variations you did not write

    Odd requests, missing details, slow and broken tools, generated from your own traffic.

  • A protected set that grows

    Every past problem stays as a check. One gets worse, the change is out.

  • Scored the way you decide

    Goal reached, correct, safe, cost and time, weighted per agent.

How a fix is judgedIllustration

Proposed fixA change to a prompt, a tool or the code

Re-run engineMany re-runs of each case, in the rebuilt world

  • The failed caseIt must now pass
  • VariationsFrom your own traffic
  • Protected setNo run may get worse

Holds on all threeA pull request for your review. Anything worse, and the change is out.

Self-improving,
with a person in control.

A person approves every change

Peira proposes, people decide. It opens pull requests and never merges, publishes or releases on its own.

  • Nothing real is touched

    Every tool call is answered by the simulated world, never by your live systems.

  • Secrets and personal data stay out

    Keys and tokens are removed at the source, and personal data is removed on the way in.

  • Budgets you set

    Daily and per-problem limits keep the cost of every re-run predictable.

  • Single sign-on and roles

    Sign in with Google, admins and members, and a token per agent for its traces.

  • An audit log of every change

    Who did what, on which agent, and how it ended. Retention follows your policy.

The re-run engine,
on real traffic.

Every fix is proven by re-running recorded work. Here is that engine on two of our own agents, replayed on a new model before a switch. Support triage: no confirmed change in 19 runs. Cluster troubleshooting: changed actions in 9 of 14 runs, found before any customer saw them.

Claude Opus 5 → GPT-6 Luna · LangSmith

Support ticket triage agent

Runs with a confirmed change
0 of 19 (33 steps compared)
List price per 1,000 steps
$105.73 → $1.07
Same action as recorded
100% original · 77.8% new
Replay spend
$34.02 of a $50 cap

About 1% of the price, no confirmed change. Most differences were an extra folder listing before the same reads. None involved a tool that writes.

A small sample: 19 runs are too few for a statistical call.

Claude Haiku 4.5 → GPT-5.4 · Langfuse

Cluster troubleshooting agent

Runs with a confirmed change
9 of 14 (41 steps compared)
List price per 1,000 steps
$74.47 → $131.70
Same action as recorded
79.7% original · 37.4% new
Replay spend
$27.42 of a $140 cap

Changed actions in 9 of 14 runs, at a higher price. Part of the gap is how the new model splits and groups its tool calls. Each run needs a review before a switch.

A small sample, from one week of traffic.

Real replaysRun 17-20 October 2026 from recorded traffic, each against a preset spending cap. No live tools ran. Prices are list prices.

Straight answers.

Something else about your stack? Ask us.

  • Langfuse
  • OpenTelemetry
What does Peira need to get started?

The traces your agent already produces. Connect Langfuse, LangSmith or OpenTelemetry, or add the SDK for your framework. No agent code changes and no mocks.

How is this different from observability or evals?

Observability shows you the failure. Evals score the runs you choose to test. Peira does the next steps: it finds what keeps failing in production, writes the fix, proves it, and keeps it fixed.

How does my agent improve over time?

Peira keeps watching every new run. Each approved fix becomes a permanent check, and each round starts from the last one: what was fixed, what was rejected, and why. Problems that repeat get fixed. Problems that are fixed stay fixed.

Does Peira ever call our real tools?

No. Every tool call in a re-run is answered by the world rebuilt from your traces. Where the world does not know an answer, it says so instead of inventing one.

How does Peira decide a fix works?

Each change is re-run many times against the case that failed, its variations and a protected set of past problems. It is scored on goal reached, correctness, safety, cost and time. If any protected run gets worse, the change is rejected.

What stops a fix from breaking something later?

Every fixed problem joins the protected set. Every later change Peira proposes is re-run against it. A change that makes a protected run worse is rejected before you see it.

Does Peira change our code by itself?

It opens a pull request, with the proof attached. Your team reviews and merges it. Nothing ships without a person.

Which agents and frameworks work?

Any agent that leaves traces in Langfuse, LangSmith or OpenTelemetry. The SDK covers LangGraph, the OpenAI Agents SDK, the Claude Agent SDK, Google ADK, CrewAI, AutoGen, LlamaIndex, Pydantic AI, smolagents, Strands and Deep Agents, and tools served over MCP.