From deepagents-skills
Fetches, organizes, and analyzes LangSmith traces for LLM debugging: query by project/metadata/status/time, download JSON, bucket outcomes, examine token/tool patterns, compare pass/fail.
npx claudepluginhub lubu-labs/langchain-agent-skills --plugin langgraph-skillsThis skill uses the workspace's default tool permissions.
Use this skill to move from raw LangSmith traces to actionable debugging/evaluation insights.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Use this skill to move from raw LangSmith traces to actionable debugging/evaluation insights.
# Install dependencies
uv pip install langsmith langsmith-fetch
# Auth
export LANGSMITH_API_KEY=<your_langsmith_api_key>
scripts/download_traces.py (or scripts/download_traces.ts).scripts/analyze_traces.py.references/filtering-querying.md for query/filter syntaxreferences/analysis-patterns.md for deeper diagnosticsreferences/benchmark-analysis.md for benchmark-specific workflowsKnown trace IDs
Use langsmith-fetch trace <id> directly, or --trace-ids in downloader scripts.
Need to discover traces first
Use LangSmith SDK list_runs/listRuns with filters, then download selected trace IDs.
Need aggregate insights
Run analyze_traces.py for summary stats, patterns, and passed-vs-failed comparisons.
Python:
uv run skills/langsmith-trace-analyzer/scripts/download_traces.py \
--project "my-project" \
--filter "job_id=abc123" \
--last-hours 24 \
--limit 100 \
--output ./traces \
--organize
TypeScript:
ts-node skills/langsmith-trace-analyzer/scripts/download_traces.ts \
--project "my-project" \
--filter "job_id=abc123" \
--last-hours 24 \
--limit 100 \
--output ./traces
Output layout:
traces/
├── manifest.json
└── by-outcome/
├── passed/
├── failed/
└── error/
├── GraphRecursionError/
├── TimeoutError/
└── DaytonaError/
Notes:
--organize/--no-organize.langsmith-fetch for full trace payload export.# Markdown report
uv run skills/langsmith-trace-analyzer/scripts/analyze_traces.py ./traces --output report.md
# JSON output
uv run skills/langsmith-trace-analyzer/scripts/analyze_traces.py ./traces --json
# Compare passed vs failed (expects by-outcome folders)
uv run skills/langsmith-trace-analyzer/scripts/analyze_traces.py ./traces --compare --output comparison.md
The analyzer reports:
Use official LangSmith run filter syntax via filter and/or start_time:
from datetime import datetime, timedelta, timezone
from langsmith import Client
client = Client()
start = datetime.now(timezone.utc) - timedelta(hours=24)
filter_query = 'and(eq(metadata_key, "job_id"), eq(metadata_value, "abc123"))'
runs = client.list_runs(
project_name="my-project",
is_root=True,
start_time=start,
filter=filter_query,
)
For TypeScript:
import { Client } from "langsmith";
const client = new Client();
for await (const run of client.listRuns({
projectName: "my-project",
isRoot: true,
filter: 'and(eq(metadata_key, "job_id"), eq(metadata_value, "abc123"))',
})) {
console.log(run.id, run.status);
}
status, error, total_tokens, start_time, end_time).metadata or extra.metadata) and/or messages.analyze_traces.py is resilient to multiple payload shapes, including raw array payloads.list_runs results.| Issue | Likely Cause | Action |
|---|---|---|
LANGSMITH_API_KEY missing | Auth not configured | export LANGSMITH_API_KEY=<your_langsmith_api_key> |
| No runs returned | Wrong project/filter/time range | Verify project name and filter syntax |
| Empty/partial message arrays | Run schema differs or incomplete data | Use downloaded trace JSON and inspect status/error fields |
| JSON parse error on downloaded files | Bad/incomplete export | Re-download trace; use --format raw paths in scripts |
| Re-downloading same traces repeatedly | Existing files in nested folders | Use current scripts (they check existing files across output tree) |
manifest.json, trace JSON dumps) unless sanitized.scripts/download_traces.py: Python downloader + organizerscripts/download_traces.ts: TypeScript downloader + organizerscripts/analyze_traces.py: Offline analysis and reportingreferences/filtering-querying.md: LangSmith query/filter examplesreferences/analysis-patterns.md: Diagnostic patterns and heuristicsreferences/benchmark-analysis.md: Benchmark-oriented analysis