Skip to Content
🎉 Welcome to handit.ai Documentation!
TracingQuickstart

AI Agent Tracing Quickstart

Give your autonomous engineer eyes to see your AI. Set up comprehensive tracing in under 5 minutes to enable autonomous issue detection and fix generation.

Transform your AI from a black box into a fully observable system that your autonomous engineer can continuously monitor and improve.

Prerequisites: You need Node.js installed and a Handit.ai Account . If you want the complete setup including evaluation and autonomous fixes, use our Main Quickstart instead.

Setting Up Tracing

Getting tracing up and running is straightforward with the Handit CLI. The CLI will analyze your codebase, generate the necessary integration code, and set up comprehensive monitoring for your AI.

Step 1: Install the Handit CLI

terminal
npm install -g @handit.ai/cli

Step 2: Set Up Your Project

Navigate to your AI project directory and run:

terminal
handit-cli setup

The CLI will guide you through:

  • Account connection - Link your project to your Handit.ai account
  • Codebase analysis - Automatically detect your AI agent patterns and LLM calls
  • Integration code generation - Create tracing wrappers for your AI functions
  • Configuration setup - Generate environment variables and config files

Setup Complete! Your AI now has comprehensive tracing active. Every interaction will be captured and visible in your dashboard within minutes.

What Tracing Captures

Once active, your tracing system captures everything your autonomous engineer needs to understand your AI’s behavior:

Complete Execution Flow: Every step from user request to final response gets recorded, showing exactly how your AI processes requests and makes decisions.

LLM Interactions: All language model calls are captured with exact prompts sent, complete responses received, token usage, timing data, and any errors that occurred.

Tool Executions: When your AI calls external functions or APIs, tracing captures the parameters passed, results returned, execution timing, and any error conditions.

Performance Metrics: Detailed timing data shows where your AI spends time, helping identify bottlenecks and optimization opportunities.

Error Context: When things go wrong, tracing provides complete context about what led to failures, making debugging precise rather than guesswork.

Viewing Your Trace Data

Your tracing data appears in the Handit dashboard immediately:

Real-Time Monitoring

Go to your Handit Dashboard  to see live traces as your AI processes requests. You’ll see performance metrics, success rates, and can drill into individual interactions for detailed analysis.

Trace Analysis

Click on individual traces to see the complete execution flow. You can analyze timing, inputs, outputs, and any errors to understand exactly how your AI behaves in different scenarios.

Pattern Recognition

Watch as patterns emerge in your trace data. Your autonomous engineer uses these patterns to identify quality issues, performance problems, and optimization opportunities automatically.

Understanding Your Trace Data

Your dashboard shows different types of traces that provide comprehensive visibility:

Agent Traces show complete workflows from start to finish. You can see how your AI processes user requests, which tools and language models it calls, success and failure patterns, and where performance bottlenecks occur. These traces give you the big picture of how your AI operates.

LLM Node Traces capture individual language model interactions with remarkable detail. You’ll see the exact prompts sent to models, complete responses received, token usage and costs, and response quality patterns. This granular view helps your autonomous engineer understand how your AI uses language models.

Tool Traces record external function and API calls, showing what parameters were passed, what results were returned, execution timing, and any error conditions. When tools cause problems or perform poorly, these traces provide the evidence needed for improvement.

The key insight: Your autonomous engineer analyzes all this trace data together to understand patterns, identify root causes of issues, and generate improvements that address specific problems rather than applying generic fixes.

How Your Autonomous Engineer Uses Traces

Your trace data becomes the foundation for autonomous improvement:

Pattern Recognition: By analyzing thousands of traces, your autonomous engineer identifies patterns in successful and failed interactions that would be impossible to spot manually.

Root Cause Analysis: When issues occur, detailed trace data helps your autonomous engineer understand exactly what went wrong—whether it’s a prompt issue, tool failure, or logic error.

Fix Validation: Historical trace data allows your autonomous engineer to test potential improvements against real past interactions, ensuring fixes actually solve problems before creating pull requests.

Continuous Learning: As fixes get deployed, new trace data shows their effectiveness, helping your autonomous engineer learn what types of improvements work best for your specific AI system.

Next Steps

Your AI is now fully observable! Here’s what you can do next:

Set Up Evaluation: Add Quality Evaluation to score your AI’s performance and enable your autonomous engineer to detect quality issues.

Enable Autonomous Fixes: Connect GitHub Integration so your autonomous engineer can create pull requests with proven improvements.

Explore Advanced Features: Learn about Advanced Tracing Features for comprehensive monitoring and debugging capabilities.

Your AI is now fully observable! Your autonomous engineer can see everything your AI does. Add evaluation and optimization to complete your autonomous engineer setup.

Troubleshooting

CLI Setup Issues: If you encounter problems during setup, ensure Node.js is installed and you have proper access to your project directory. Try running handit-cli setup again to regenerate configuration.

No Trace Data: If you’re not seeing traces in the dashboard, verify that your generated integration code is being executed and that your API key was set correctly during setup.

Missing Traces: If some interactions aren’t being traced, check that the CLI-generated tracing code covers all your AI’s entry points and main functions.

For additional help, check our detailed tracing guides or visit our Support page for assistance.

Last updated on