Skip to content

[tracing] Add DeepEval tracing to the deep-research-agent#31

Draft
deepeval-tracer[bot] wants to merge 1 commit into
mainfrom
confident-ai/add-tracing-aea2d29d50992fa6
Draft

[tracing] Add DeepEval tracing to the deep-research-agent#31
deepeval-tracer[bot] wants to merge 1 commit into
mainfrom
confident-ai/add-tracing-aea2d29d50992fa6

Conversation

@deepeval-tracer

Copy link
Copy Markdown

What this does

Adds DeepEval tracing to the langchain/deep-research-agent app so its execution becomes visible span-by-span in Confident AI's Observatory.

This is a genuine agentic app — a LangGraph/deepagents deep research agent with a delegating orchestrator, research sub-agents, a tavily_search web-search tool, and an Ollama LLM — which makes it a strong showcase for tracing (agent → sub-agent → tool → LLM spans).

How it was instrumented

Native integration, not manual @observe. Because the app is built on LangGraph (via deepagents.create_deep_agent), the recommended DeepEval surface is the LangChain CallbackHandler. It is passed into the existing agent.stream(...) call through config={"callbacks": [...]} — every graph run, sub-agent, tool call, and LLM call is captured automatically, with no rewrite of the agent code.

Changes (all scoped to langchain/deep-research-agent/):

  • agent.py — import CallbackHandler from deepeval.integrations.langchain and pass it into agent.stream(...) with a trace name and grouping tags. No secrets are captured.
  • pyproject.toml — add the deepeval dependency (pinned >=4.1.2 to match the repo's existing deepeval/evals project). You may want to run uv lock to refresh uv.lock.
  • env.example — document CONFIDENT_API_KEY alongside the existing keys.

To start seeing traces

Set CONFIDENT_API_KEY in your environment (or run deepeval login). DeepEval reads it from the environment automatically — see the new entry in env.example. Without the key the app runs exactly as before; tracing simply stays local/no-op.

Notes

  • The same one-line config={"callbacks": [CallbackHandler()]} pattern applies to the other LangGraph/deepagents examples in this repo (e.g. langchain/internet-search) if you'd like to extend tracing to them.
  • These changes are best-effort and should be reviewed before merging. Sanity-checked with python -m py_compile on the edited module; the app itself was not executed (it requires Ollama + a Tavily key).

Generated by Tracing PR · 266.7 AIC · ⌖ 29.4 AIC · ⊞ 5.4K ·

  • expires on Jul 28, 2026, 6:22 AM UTC

Instrument the LangGraph/deepagents research agent with DeepEval's native
LangChain CallbackHandler so each graph run, sub-agent, tool call, and LLM
call becomes an inspectable span in Confident AI's Observatory.

- Pass CallbackHandler(...) into agent.stream via config callbacks (native
  LangGraph integration — no app rewrite).
- Add deepeval dependency (pinned to match the repo's existing usage).
- Document CONFIDENT_API_KEY in env.example.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants