---
title: "Trace & Evaluate your Agent with Arize Phoenix"
description: "A smolagents CodeAgent with DuckDuckGo search and webpage tools can be instrumented with OpenTelemetry and OpenInference so every agent call is traced in a local or hosted Arize Phoenix instance."
url: "https://swe.quest/articles/trace-evaluate-your-agent-with-arize-phoenix-ea5d226abd11d54e"
canonical: "https://huggingface.co/blog/smolagents-phoenix"
source: "Hugging Face"
published: "2025-02-28"
difficulty: "medium"
kind: "How-to"
reading_minutes: 6
tags: ["ai-agents","evals","observability","llms","python"]
---

# Trace & Evaluate your Agent with Arize Phoenix

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-02-28, 6 min read, How-to. Original: [https://huggingface.co/blog/smolagents-phoenix](https://huggingface.co/blog/smolagents-phoenix)

## Summary

A smolagents CodeAgent with DuckDuckGo search and webpage tools can be instrumented with OpenTelemetry and OpenInference so every agent call is traced in a local or hosted Arize Phoenix instance. Evaluation works by querying the search tool's spans with SpanQuery and scoring query/result relevance with GPT-4o as an LLM judge via llm\_classify and the RAG relevancy template. The scores are then logged back to Phoenix as span evaluations. Swapping in other prebuilt templates covers checks such as hallucination, toxicity, SQL generation and function calling.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- Python ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- LLM agents basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- OpenTelemetry tracing concepts ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))

## Keywords

Arize Phoenix, smolagents, OpenInference, OpenTelemetry, GPT-4o, LLM-as-a-judge, DuckDuckGo

## Related posts

- [The Most Common Questions About Agent Evals, Answered](https://swe.quest/articles/the-most-common-questions-about-agent-evals-answered-40ebbb294f8cf253.md): LangChain · 2026-10-15 · Medium · 15 min read · Evaluation, AI agents, Observability, LLMs
  Agent evals score agent runs to handle nondeterminism, multiple valid answers and variable execution paths: start by reading traces, pick one behavior, build a 10-20 example dataset from real traces, run a baseline experiment, and fold new failures back in.
- [Search agent traces by behavior with AI Search in LangSmith](https://swe.quest/articles/search-agent-traces-by-behavior-with-ai-search-in-langsmith-b56f880ffba2ede5.md): LangChain · 2026-10-13 · Medium · 7 min read · Observability, AI agents, LLMs, Search
  LangSmith's AI Search lets users find agent traces by behavior described in plain language (e.g. "did PII leak?", "did the user get frustrated?") by running a fast decision model over each candidate trace rather than relying on lossy embedding-based vector search.
- [Tracing OpenAI agents with ClickStack](https://swe.quest/articles/tracing-openai-agents-with-clickstack-27a1630cee998ca8.md): ClickHouse · 2025-10-27 · Medium · 13 min read · Observability, AI agents, Python, Analytics & OLAP
  OpenAI's agents SDK has built-in tracing that can be redirected from OpenAI's hosted product to a custom TracingExporter.
- [Trace and evaluate Cursor agents with Langfuse, powered by ClickHouse](https://swe.quest/articles/trace-and-evaluate-cursor-agents-with-langfuse-powered-by-clickhouse-b04d90713d1833e1.md): ClickHouse · 2026-10-22 · Medium · 5 min read · AI for coding, Observability, Evaluation, AI agents
  The Langfuse Observability plugin for Cursor captures each agent prompt as a \`Cursor Turn\` trace containing LLM observations, tool executions, subagents and token usage, stored in a wide ClickHouse observations table that avoids trace/observation joins for cost and latency aggregation.
- [Five things you can do with Sentry’s Agent Tracing](https://swe.quest/articles/five-things-you-can-do-with-sentry-s-agent-tracing-5ac2ff6886459921.md): Sentry · 2026-10-28 · Medium · 19 min read · AI agents, Observability, Evaluation, LLMs
  Sentry's Agent Tracing captures model calls, tool executions and multi-agent handoffs in a single trace, and Sentry Cookbook recipes build workflows on top of that data.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
