agentleFS
badhopebadhope/AI-SKILL/skills/deepeval-tracing/SKILL.md

deepeval SDK Tracing

Skill11 starsChanged 6 months agoMITView on GitHub

Confirmation that traces are arriving in Confident AI''s

  • Reads credentials

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If you want to define metrics and run pytest eval suites, use the deepeval-eval-suite skill.

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

When to use

You're instrumenting a Python AI app (LLM app, agent, RAG pipeline, chatbot) and you want its execution to show up span by span in Confident AI's Observatory so you can later attach metrics and iterate. You're OK installing the deepeval Python package and using its SDK conventions (@observe, framework integrations).

This is the Python + deepeval SDK path. If you want a language-agnostic setup or you don't want to install deepeval itself, use the deepeval-otel skill (raw OpenTelemetry) instead. If you want to define metrics and run pytest eval suites, use the deepeval-eval-suite skill.

The job is exactly three things: pick a supported integration when one exists, fall back to manual @observe otherwise, and give every span a meaningful type (llm / retriever / tool / agent). The skill stops at producing well-formed traces — attaching metrics and running evals is the eval-suite skill's job.

Don't use this skill for non-AI software. The span types describe AI components, and the Observatory renders AI behaviour. Tracing a Postgres query or a Flask handler is meaningless.

Inputs

FieldRequiredNotes
frameworkyesDrives integration choice. custom = manual @observe.
model_provideryesPatched automatically by the matching integration.
vector_dbnoEmpty = no retriever spans needed.
confident_api_keyyesOr deepeval login for interactive setup.

framework examples: langgraph uses deepeval.integrations.langgraph patching, crewai uses deepeval.integrations.crewai, etc. If the project mixes two frameworks (e.g. LangChain inside a CrewAI flow), list both — integrations stack cleanly.

Output

Plain-text confirmation. The system of record is Confident AI's Observatory; this skill just wires the SDK. Typical return:

Trace landed: https://app.confident-ai.com/observability/traces/d41f3a
Detected spans: llm=8, agent=3, retriever=2, tool=1
Instrumented: src/agents/customer_support.py:42 (@observe)
              src/agents/customer_support.py:87 (@observe type=llm)

Prompt

You are wiring DeepEval tracing into a Python AI application. Follow
the steps in order. Do not skip ahead.

1. Confirm the target is an AI app.
   It must have at least one of: LLM calls, an agent loop, retrieval
   / vector search, or tool calls. If none are present, STOP — this
   skill does not apply. Tell the user that DeepEval's span types
   describe AI components and Confident AI's Observatory is built
   to evaluate AI behaviour.

2. Detect what's in the codebase.
   Grep for imports / framework signatures. Identify:
     - AI framework (langgraph, langchain, openai-agents,
       llamaindex, pydantic-ai, crewai, autogen, haystack, semantickernel)
     - LLM provider (openai, anthropic, google, bedrock, azure, cohere,
       mistral, ollama, vllm)
     - Vector store (pinecone, qdrant, weaviate, chroma, milvus, pgvector)
   If you can't detect any AI framework, mark `framework = custom` —
   that triggers manual `@observe` below.

3. Read the exact integration doc for the detected framework +
   provider. The docs/SDK are the source of truth for which functions
   to patch and which auto-captures are enabled. Do not guess based
   on framework name alone.

4. If a native integration fits, use it. Add the patch call to the
   app's startup (or test fixture for pytest). Skip the manual
   `@observe` step for code paths the integration auto-traces.
   If no native integration fits (`framework = custom` or you have
   app-owned wrapper boundaries that the integration can't see),
   proceed to manual `@observe`.

5. Manual `@observe` rules:
   - Decorate the top-level agent / chain / pipeline function.
   - Decorate every LLM call with `@observe(type="llm")`.
   - Decorate every retrieval call with `@observe(type="retriever")`.
   - Decorate every tool call with `@observe(type="tool")`.
   - Let span names default to the function name. Override only when
     the function name is too generic (e.g. `def call`).
   - Capture inputs and outputs in span metadata when they help
     diagnose failures. NEVER include raw user PII, secrets, or
     credentials.

6. Trace-level tags and metadata (optional but recommended for
   production):
   - `session_id` (link traces into a session / conversation)
   - `user_id` (the end user, if known and allowed)
   - `environment` (dev / staging / prod)
   - `git_sha` (the deployed commit)

7. Confirm the API key is reachable. Either:
     - `deepeval login` was run once and the key is in
       `~/.deepeval/`, OR
     - `CONFIDENT_API_KEY` is exported in the environment.
   CI must export the env var. Bare `deepeval login` doesn't work
   in CI.

8. Run the app, trigger one trace, and verify it shows up in
   Confident AI's Observatory. If it doesn't:
     - check the deepeval logs for auth errors
     - verify `@observe` decorators are actually imported and
       called
     - check whether the framework's integration has been
       initialised (most need an explicit `patch_*()` call)

When NOT to use

  • The app is not in Python (or you don't want to install deepeval). Use the deepeval-otel skill — it's the language-agnostic OTLP path and works without the deepeval package.
  • You want to define metrics and run pytest eval suites. This skill stops at producing well-formed traces. Use deepeval-eval-suite.
  • The target is non-AI software (web server, CRUD API, queue consumer, cron). DeepEval span types describe AI components. Tracing a Flask request handler produces empty / meaningless spans.
  • You want the cheapest possible tracing and don't care about Confident AI. Use OpenTelemetry's SDK directly with a console or OTLP exporter and skip this whole skill.
  • You have PII / secrets to capture in span attributes. DeepEval forwards everything to Confident AI unredacted. Redact before decorating.

Example

Input:

framework: langgraph
model_provider: openai
vector_db: qdrant
confident_api_key: us-cf_***

Output:

Trace landed: https://app.confident-ai.com/observability/traces/d41f3a
Detected spans: llm=8, agent=3, retriever=2, tool=1
Instrumented:
  src/agents/customer_support.py:42  @observe
  src/agents/customer_support.py:87  @observe(type="llm")
  src/agents/customer_support.py:120 @observe(type="retriever")
  src/agents/customer_support.py:151 @observe(type="tool")
Next: run the eval-suite skill to attach metrics.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.