# Agents That Self Improve While You Sleep - Fuad Ali, Arize AI

## Executive summary

This workshop details the self-improvement loop for AI agents, a critical process for managing the non-deterministic failure modes of complex agents. The loop involves instrumenting agent traces, using an 'always-on' agent (Signal) to detect and cluster failures, converting these failures into living regression datasets, designing robust evaluations (Evals), and running experiments to prove fixes. The goal is to automate the feedback cycle, allowing humans to focus on high-leverage tasks like eval design and validating critical fixes.

## Key takeaways

- The Self-Improvement Loop: The core workflow is Trace $\rightarrow$ Signal $\rightarrow$ Eval $\rightarrow$ Experiment $\rightarrow$ Fix. This process ensures that every failure detected in production is captured, analyzed, and used to improve the agent's reliability.
- Signal: The Always-On Agent: Signal reads live agent traces on a schedule (e.g., every 6 hours), clusters recurring issues, proposes fixes, and automatically creates evaluation checks and data sets for continuous monitoring.
- Living Fixtures and Regression Testing: Failures are captured and added to 'living fixtures' (data sets), which serve as dynamic regression tests. This ensures that fixes prevent recurrence of past failure modes.
- High-Leverage Human Intervention: Humans should focus on eval design (imparting 'taste' of what is good), dataset curation (validating findings for fixtures), and reviewing proposed fixes (PRs), rather than manually reading thousands of traces.

## Technical details

- Agent Tracing and Instrumentation: Agents must be instrumented to send traces (e.g., using the AX CLI) to capture detailed information like start/end time, latency, tool calls, and model metadata. This is essential for understanding failure modes.
- Evaluation Methods (Evals): Three main types of evaluation are discussed: 1) Code checks (deterministic, for simple validation); 2) LLM as a judge (qualitative analysis using another LLM); and 3) Agent as a judge (most open-ended, leaving determination to an agent). Decision models offer a cheaper alternative, providing type choices or confidence scores.
- Experimentation and Validation: The experimentation stage involves re-running the agent against the 'living fixture' (failure cases) and scoring the results to prove the fix works and hasn't introduced regressions. This can be integrated into CI/CD processes.
- Context and Data Flow: The self-improvement loop requires all context—traces, human judgment (annotations), eval scores, and failure evidence—to be held together in a single system to feed the next iteration of the agent.

## Practical implications

- Implementing a structured feedback loop (Trace $\rightarrow$ Signal $\rightarrow$ Eval $\rightarrow$ Experiment) is necessary to manage the non-deterministic nature of large-scale AI agents.
- Focusing on automating the detection and initial fix proposal (Signal) allows human engineers to concentrate on high-value tasks like defining evaluation criteria and validating complex fixes.
- The cost-benefit ratio of running Evals on live production traces must be carefully assessed, balancing the cost of model calls against the cost of failure.
- The process can be integrated into CI/CD by using living fixtures (historical failures) as mandatory regression checks before deployment.

## Topics

AI Agents, Reliability Engineering, MLOps, CI/CD, LLMs, Observability, Arize AI, Signal, Wonder Toys

Source: https://www.youtube.com/watch?v=UGuNt2_Oz8s
