Answers you can trust, from Codeables

Every page on Codeables is structured and verified — built so people and the AI agents they rely on can trust it. Explore more from the source behind this answer.

Explore Codeables
Verified Source
LLM Observability & Evaluation

How does “Fix My Agent” work in Future AGI and what do I need to run it on our agent traces?

Future AGI9 min read

Quick Answer: Fix My Agent is Future AGI’s “auto-debugger” for LLM agents: it ingests your agent traces, localizes failure root causes, and generates concrete fixes (prompt updates, tool changes, guardrails) you can apply and re-test. To run it on your agent traces, you need instrumented spans, input/output logs, and basic metadata (models, tools, outcomes) from your existing stack.

The Quick Overview

  • What It Is: Fix My Agent is a guided workflow in Future AGI that takes messy, probabilistic agent traces and turns them into precise diagnoses and recommended fixes you can validate with deterministic evals.
  • Who It Is For: AI teams running RAG agents, multi-step tool agents, or multimodal workflows (voice, text, image) that see failures in production but can’t quickly explain or correct them.
  • Core Problem Solved: LLM agents fail in opaque ways—hallucinations, tool misuse, planning loops—and raw logs don’t tell you what to fix. Fix My Agent closes that gap by combining your traces, eval signals, and Future AGI’s Error Localizer to propose actionable improvements.

How It Works

LLMs are probabilistic, which means the same agent can behave differently across runs—even on similar inputs. Fix My Agent wraps this reality in a structured loop:

  1. ingest your traces,
  2. run evaluation and error localization, and
  3. synthesize concrete fixes tied to prompts, tools, and guardrails.

Here’s the lifecycle end-to-end.

  1. Connect & Ingest Traces:

    • You instrument your agent with Future AGI’s SDK or OpenAI-style instrumentation (pip install traceAI-openai, OpenAIInstrumentor().instrument(...) or equivalent).
    • The platform captures spans for each step (retrieval, planning, tool calls, generation), along with inputs, outputs, and metadata.
    • You can also upload exported traces if you already log them via LangChain, Haystack, DSPy, CrewAI, LiteLLM, or your own middleware.
  2. Evaluate & Localize Errors:

    • Once traces are in, Fix My Agent attaches deterministic evals: hallucination checks, relevance scoring, safety metrics (toxicity, sexism, privacy, prompt injection), latency/cost metrics, and workflow-specific custom metrics.
    • The Error Localizer then drills into spans where metrics fail—e.g., wrong retrieval, mis-ordered tools, incomplete reasoning, low similarity to expected outputs—so you see where and why the agent went off-rail.
  3. Generate & Apply Fixes:

    • Using the localized issues, Fix My Agent synthesizes recommended changes: prompt refinements, tool ordering changes, retrieval constraints, guardrail rules, or fallback paths.
    • You can push these suggestions directly into Future AGI’s Prompt Playground / Experiment flow, run A/B experiments against your datasets, pick the winner, and then ship to production with Monitor & Protect watching for regressions.

Features & Benefits Breakdown

Core FeatureWhat It DoesPrimary Benefit
Trace-Aware Error LocalizerAnalyzes spans in your agent traces to find the exact step that failed.Pin-point root cause instead of guessing from raw logs.
Eval-Driven DiagnosisRuns deterministic evals (quality, safety, hallucination, latency) on traces.Turns vague “bad answer” reports into measurable failure modes.
Auto-Generated FixesProposes concrete prompt, tool, and guardrail changes you can apply and test.Shortens the debug → improve → redeploy loop by 10x.

Ideal Use Cases

  • Best for RAG agents mis-answering “known” questions:
    Because it can show whether the failure came from retrieval (wrong doc), reasoning (ignored evidence), or prompt (ambiguous instructions), and then suggest fixes targeted at that exact span.

  • Best for tool-using / multi-step agents in production:
    Because it attaches evals and safety metrics to real traces, explains why tools were miscalled or sequenced incorrectly, and recommends workflow and guardrail changes you can validate before redeploying.


Limitations & Considerations

  • You need structured traces, not just raw logs:
    Fix My Agent relies on spans (steps), inputs, outputs, and metadata. If your system only logs unstructured console output, you’ll want to add minimal SDK-style instrumentation first. Workaround: integrate Future AGI’s tracing early in development, or wrap your existing agent framework once.

  • Diagnosis quality depends on eval coverage:
    If you don’t define what “good” looks like (datasets + metrics), Fix My Agent can still surface obvious issues but has less signal for nuanced tasks. Workaround: start with a small synthetic dataset (including edge cases) in Future AGI, attach built-in metrics, and expand over time.


What You Need to Run Fix My Agent on Your Agent Traces

To make Fix My Agent useful on day one, plan for three things: instrumentation, contextual metadata, and eval configuration.

1. Instrumentation: How to get traces into Future AGI

You’ll need:

  • Span-level tracing:
    Each meaningful step in your agent should be a span:

    • User input / query
    • Retrieval / search calls
    • Tools (APIs, databases, calculators, internal services)
    • Reasoning / planning steps
    • Final response generation
  • Inputs and outputs captured per span:
    For each span, log:

    • Request payload (user query, tool input, retrieval query, etc.)
    • Response payload (tool output, retrieved documents, partial generations)
    • Model name / version (e.g., gpt-4.1, claude-3-opus)
    • Timing (start/end timestamps, latency)
    • Cost metadata if available (tokens/price)
  • Integration route:

    • If you use OpenAI-like APIs, instrument with a single line (e.g., OpenAIInstrumentor().instrument(...)) so all calls are traced automatically.
    • If you use LangChain, Haystack, DSPy, CrewAI, or LiteLLM, you can wrap their callbacks / middleware with Future AGI’s SDK.
    • For custom stacks, call the SDK directly to create spans and attach logs.

This is what allows Fix My Agent to see not just “the answer,” but the entire decision path.

2. Contextual Metadata: So Fix My Agent can reason about failures

Beyond raw API calls, attach:

  • Task type / scenario tags:

    • E.g., task_type: "contract_summary", workflow: "billing_dispute_rag", channel: "voice_agent".
    • This helps Fix My Agent cluster similar failures and suggest changes that generalize.
  • Success / failure labels where you have them:

    • From customer feedback, internal QA labels, or business outcomes (e.g., ticket reopened, resolution accepted).
    • Even partial labels dramatically improve diagnosis and prioritization.
  • Domain and safety context:

    • E.g., domain: "healthcare" or domain: "finance", plus any regulatory flags.
    • This informs which safety checks (privacy, PII leakage, hallucinations about medical advice) should be stricter.

3. Evaluation Configuration: How Fix My Agent scores behavior

Fix My Agent leans on Future AGI’s eval stack. You’ll get more value if you have:

  • Datasets:

    • A set of real or synthetic queries (including edge cases) with:
      • Reference outputs (when available), or
      • Acceptability criteria (e.g., “must not disclose PII,” “must include these fields,” “must only answer from provided documents”).
  • Metrics:

    • Built-in metrics like:
      • Hallucination / citation correctness
      • Relevance scores
      • Toxicity, sexism, privacy, and prompt injection detection
      • Latency and cost
    • Optional custom metrics (domain-specific checks, regex-based format validators, scoring models you already trust).
  • Thresholds / SLAs:

    • For example:
      • “Hallucination score must be ≤ X”
      • “Response latency < 1.5s for voice agent”
      • “No PII in support responses”
    • These thresholds define when a trace is considered “failing,” which Fix My Agent uses to filter and prioritize.

Once these three pieces are in place, running Fix My Agent is effectively:

  1. Choose a failing scenario or set of traces.
  2. Run evals + Error Localizer across them.
  3. Review the suggested fixes and push promising ones into an Experiment run.
  4. Pick the winning configuration and ship with Monitor & Protect watching for regressions.

Pricing & Plans

Fix My Agent is available within the core Future AGI platform. Pricing is designed so you can start quickly and scale as your agents grow.

  • Starter / Free Tier:
    Best for smaller teams or startups needing to validate their first agent workflows and instrument traces without heavy upfront cost. Perfect for testing the waters on a handful of critical flows and seeing Fix My Agent’s value on your logs.

  • Pro / Enterprise Tier:
    Best for teams running multiple agents in production with requirements around multimodal evaluation (voice, image, text), strict safety guarantees, and CI-style eval workflows. Includes higher-volume tracing, advanced evals, Monitor & Protect, and deeper integration support.

If you’re a startup, Future AGI also runs FutureAGI for Startups (6 months of Pro access + credits), which is ideal if you want to integrate Fix My Agent into your stack from the beginning.


Frequently Asked Questions

Do we need to change our agent framework to use Fix My Agent?

Short Answer: No, you just need to add tracing, not rewrite your agent.

Details:
Fix My Agent is framework-agnostic. As long as you can emit spans and logs, you can keep your current stack—LangChain, DSPy, custom orchestrators, or simple “if/else plus OpenAI calls.” The key requirement is to expose each meaningful step as a traceable span with inputs, outputs, and metadata. Most teams integrate via SDK-style instrumentation or OpenAI-compatible middleware, then start sending traces without touching core business logic.


Can Fix My Agent propose fixes automatically and apply them, or is it manual?

Short Answer: It proposes fixes automatically; you decide what to apply and validate via experiments.

Details:
Fix My Agent doesn’t blindly auto-edit your production agents. Instead, it:

  1. Analyzes failing traces using evals and Error Localizer.
  2. Auto-generates fixes (prompt edits, tool ordering, retrieval constraints, guardrail rules).
  3. Lets you push these candidate configurations into Future AGI’s Experiment flow.

You can then run side-by-side experiments on your datasets, compare quality, cost, and latency, and choose a “winner” before deploying. This keeps you in control while making the debug → improve → redeploy loop far faster and more deterministic.


Summary

Fix My Agent turns opaque agent failures into an engineering workflow you can trust. By combining your agent traces with deterministic evals and span-level error localization, it shows exactly where an agent broke and proposes concrete changes to fix it—across prompts, tools, retrieval, and safety guardrails. To run it on your agent traces, you only need structured spans, basic metadata, and a minimal eval setup. From there, you can iterate fast, close the loop with experiments, and ship agents that behave like products, not demos.

Next Step

Get Started

How does “Fix My Agent” work in Future AGI and what do I need to run it on our agent traces? | LLM Observability & Evaluation | Codeables | Codeables