Error analysis records why a problem-solving attempt failed and identifies an alternative action. In an agent, it turns a failed tool call into guidance for the next decision instead of another repetition. section 7.3.3 section 7.4
Use error analysis in two connected roles:
- During execution, record the failure cause and a replacement strategy in context so the agent can choose another tool or approach. section 7.4
- After execution, store the failure explanation with the task, approach, answer, and correctness result as structured memory. section 6.4.2
- Across deployments, funnel recurring failures through taxonomy, rubrics, and metrics to improve the evaluation dataset. section 10.4.2
Recovering from a failed research tool
A Wikipedia tool raises “Wikipedia service is temporarily unavailable.” Reflection records: “Cause: service unavailable. Alternative: use web search.” The agent then calls search_web rather than retrying Wikipedia until max_steps. section 7.3.3
Listing 6.27 TaskMemory schema definition
class TaskMemory(BaseModel):
"""Structured memory for GAIA problem-solving records"""
task_summary: str = Field(description="What the problem asked")
approach: str = Field(description="Methods and tools used to solve it")
final_answer: str = Field(description="The agent's submitted answer")
is_correct: bool = Field(description="Whether the answer was correct")
error_analysis: str | None = Field(
default=None,
description="Why the attempt failed, if it did"
)
def to_embedding_text(self) -> str:
"""Generate text for vector search"""
return f"Task: {self.task_summary}"
Inspect the TaskMemory schema to see error_analysis implemented as an optional field alongside the task summary, approach, final answer, and correctness flag. section 6.4.2
