Agents Building Agents - Alfonso Graziano, Nearform

By AI Engineer

Share:

Key Concepts

  • AI Agents: Systems consisting of an LLM (the "brain") connected to tools and context within an agentic loop.
  • Golden Dataset: A curated set of inputs and expected outputs used as a test suite to measure agent performance.
  • Scorers: Automated mechanisms that evaluate LLM outputs against the Golden Dataset to provide accuracy metrics.
  • AutoAgent: A self-improving loop where an AI agent (e.g., Claude Code) iteratively updates the code, system prompts, and tools of a target agent to improve performance.
  • Harness Engineering: The practice of building a robust environment around coding agents, including specs, quality gates, observability, and context management, to ensure reliable autonomous development.
  • Trace Analysis: The process of collecting user interaction data (inputs, tool usage, feedback) to identify and cluster failure modes for iterative improvement.

1. Addressing Performance Issues in Evals

The speaker identifies two primary failure modes: poor performance on evaluation datasets and poor performance on live production data.

  • The Golden Dataset Framework: To combat non-determinism, teams must build a "Golden Dataset" with subject matter experts (SMEs). This acts as a test suite where the system checks if the agent calls the correct tools or retrieves the right context.
  • Iterative Improvement (AutoAgent): The speaker demonstrates that an AI agent can autonomously improve another agent. By running an optimization loop, the system:
    1. Runs the current agent against the Golden Dataset.
    2. Generates a baseline report.
    3. Creates hypotheses to fix specific failure modes (e.g., missing tools, poor system prompts).
    4. Implements changes, runs evals, and rolls back if regressions occur.
  • Results: In a naive agent, this process improved accuracy from 18% to 83% in 10 iterations. In a production-grade agent, it yielded a 10% improvement over human-optimized benchmarks.

2. Improving Performance on Live Data

When agents face "messy" real-world data, the focus shifts to user feedback and trace analysis.

  • The Feedback Loop:
    1. Collection: Capture all traces (inputs, tool calls, token usage) and user feedback (thumbs up/down, comments).
    2. Annotation: If user feedback is missing, SMEs manually annotate traces to define expected behavior.
    3. Clustering: An agent analyzes the collected traces to group failures into distinct clusters (e.g., formatting issues, tool logic errors).
    4. Root Cause Analysis: The coding agent examines the code and trace details to propose specific fixes.
    5. Triage: Humans validate the proposed fixes, prioritizing them for implementation or discarding false positives.
  • Integration: Validated failure modes are added to the Golden Dataset, ensuring that once a bug is fixed, it is permanently covered by the regression test suite.

3. Harness Engineering: The Foundation for Reliability

The speaker emphasizes that autonomous improvement is only possible within a controlled environment. Key components include:

  • Spec-Driven Development: Every failure mode is treated as a "spec" (specification) for expected behavior.
  • Quality Gates: Implementation of linting, unit tests, and LLM-based code reviews to ensure the coding agent doesn't introduce new bugs.
  • Observability: Maintaining full visibility into agent traces is critical; without it, developers are "blind" to why an agent failed in production.

4. Notable Quotes

  • "AI is very powerful and very good at building any type of software. And given that AI agents is just one type of software, as you may guess, we are using AI to build AI."
  • "Harness Engineering is the idea of building the environment around our coding agent so that they can work reliably."
  • "Updating the golden data sets or the scorers just to let the evals pass is not a good idea, so we want to enforce... [that the agent does not do that]."

5. Synthesis and Conclusion

Building reliable AI agents requires moving away from manual, ad-hoc fixes toward a repeatable, automated engineering process. By leveraging AutoAgent for iterative code improvement and Harness Engineering to provide a stable environment, teams can systematically reduce hallucinations and improve accuracy. The most effective workflow involves a continuous cycle: collecting live traces, clustering failure modes, validating them with SMEs, and incorporating those failures into a permanent Golden Dataset to prevent future regressions.

Chat with this Video

AI-Powered

Load the transcript when you're ready to chat so the initial page stays lighter.

Ready to summarize another video?

Summarize YouTube Video