Percival Debugging Overview
Automated agent debugging that detects errors and suggests optimizations
Percival is an intelligent agent debugger that detects 20+ failure modes in agentic traces and suggests optimizations for your systems. Teams building agentic AI typically spend countless hours combing through traces and logs to find planning mistakes, incorrect tool calls, and wrong outputs. Percival makes this process fast and reliable—with a single click, it analyzes full agent workflows, surfaces failure modes, and suggests prompt improvements to fix them.
Unlike traditional evaluation approaches like LLM-as-a-judge or curated test datasets that catch mistakes at specific points, Percival analyzes the full agentic execution to identify systemic issues like flawed planning or misused tools, even when traces are long or complex.

Percival can be activated by clicking "Analyze with Percival" on any trace. The image above shows a cluster of errors and prompt optimizations to prevent repeated tool calls.
How Percival works
Percival is an adaptive learning agent that analyzes traces to generate actionable insights. Here's what it does:
- Ingests traces - Processes spans from your agent workflows
- Analyzes execution - Identifies errors, inefficiencies, and optimization opportunities
- Clusters errors - Groups similar failures together for systematic resolution
- Recommends fixes - Suggests concrete prompt improvements
- Scores traces - Rates execution on a 1-5 scale for security, reliability, and other dimensions
- Learns continuously - Stores insights in memory, episodically (what tools have previously been called in traces) and semanticly (human-provided feedback on agents), to improve analysis over time
This adaptive approach allows Percival to understand any system and provide increasingly accurate insights as it learns from your traces and feedback.
How to get started
-
Set up tracing for your agent workflows
Add the
@traceddecorator to your existing agent or follow an example workflow. -
Navigate to the Traces tab

-
Click "Analyze with Percival"

-
Review generated insights
Read the summary, explore error clusters, and review prompt optimization suggestions.

Framework integrations
Percival's trace parser relies on OpenTelemetry and OpenInference tracing conventions. The following frameworks are supported out of the box:
- Smolagents
- Pydantic AI
- OpenAI Agent SDK
- LangChain
- CrewAI
- Custom OpenAI and Anthropic clients (compatible with OpenAIInstrumentor and AnthropicInstrumentor)
Next steps
- Follow the complete workflow: Tracing and debugging agents with Percival
- Build custom evaluators: Build evals with Percival Chat
- Add domain-specific errors: Custom error taxonomies with Percival
- View all detectable errors: Error taxonomy
- Learn about core capabilities: Percival concepts
