Fetch and analyze LangSmith traces to debug LangChain and LangGraph agents.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "langsmith-fetch" skill from askskill: 1. Download https://raw.githubusercontent.com/ComposioHQ/awesome-claude-skills/master/langsmith-fetch/SKILL.md 2. Save it as ~/.claude/skills/langsmith-fetch/SKILL.md 3. Reload skills and tell me it's ready
Debug LangChain and LangGraph agents by fetching execution traces directly from LangSmith Studio in your terminal.
Automatically activate when user mentions:
pip install langsmith-fetch
export LANGSMITH_API_KEY="your_langsmith_api_key"
export LANGSMITH_PROJECT="your_project_name"
Verify setup:
echo $LANGSMITH_API_KEY
echo $LANGSMITH_PROJECT
When user asks: "What just happened?" or "Debug my agent"
Execute:
langsmith-fetch traces --last-n-minutes 5 --limit 5 --format pretty
Analyze and report:
Example response format:
Found 3 traces in the last 5 minutes:
Trace 1: ✅ Success
- Agent: memento
- Tools: recall_memories, create_entities
- Duration: 2.3s
- Tokens: 1,245
Trace 2: ❌ Error
- Agent: cypher
- Error: "Neo4j connection timeout"
- Duration: 15.1s
- Failed at: search_nodes tool
Trace 3: ✅ Success
- Agent: memento
- Tools: store_memory
- Duration: 1.8s
- Tokens: 892
💡 Issue found: Trace 2 failed due to Neo4j timeout. Recommend checking database connection.
When user provides: Trace ID or says "investigate that error"
Execute:
langsmith-fetch trace <trace-id> --format json
Analyze JSON and report:
Example response format:
Deep Dive Analysis - Trace abc123
Goal: User asked "Find all projects in Neo4j"
Execution Flow:
1. ✅ search_nodes(query: "projects")
→ Found 24 nodes
2. ❌ get_node_details(node_id: "proj_123")
→ Error: "Node not found"
→ This is the failure point
3. ⏹️ Execution stopped
Root Cause:
The search_nodes tool returned node IDs that no longer exist in the database,
possibly due to recent deletions.
Suggested Fix:
1. Add error handling in get_node_details tool
2. Filter deleted nodes in search results
3. Update cache invalidation strategy
Token Usage: 1,842 tokens ($0.0276)
Execution Time: 8.7 seconds
When user says: "Save this session" or "Export traces"
Execute:
# Create session folder with timestamp
SESSION_DIR="langsmith-debug/session-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$SESSION_DIR"
# Export traces
langsmith-fetch traces "$SESSION_DIR/traces" --last-n-minutes 30 --limit 50 --include-metadata
# Export threads (conversations)
langsmith-fetch threads "$SESSION_DIR/threads" --limit 20
Report:
✅ Session exported successfully!
Location: langsmith-debug/session-20251224-143022/
- Traces: 42 files
- Threads: 8 files
You can now:
1. Review individual trace files
2. Share folder with team
3. Analyze with external tools
4. Archive for future reference
Session size: 2.3 MB
When user asks: "Show me errors" or "What's failing?"
Execute:
# Fetch recent traces
langsmith-fetch traces --last-n-minutes 30 --limit 50 --format json > recent-traces.json
# Search for errors
grep -i "error\|failed\|exception" recent-traces.json
Analyze and report:
…
Automate ClassMarker quiz and exam tasks to improve management efficiency.
Automate Unione tasks through Rube MCP with schema lookup first.
Automate V0 workflows via Rube MCP using current tool schemas first.
Automate Mocean tasks through Rube MCP using the latest tool schemas.
Automate Adobe app workflows to speed up repetitive creative tasks.
Automate Shortcut project workflows with natural language for stories, epics, and tasks.
Manage LangSmith traces, prompts, datasets, experiments, and billing with natural language.
Fetch Langfuse traces into coding agents for natural-language debugging and analysis.
Analyze AI agent traces to diagnose failures and recommend actionable improvements.
Search LangChainJS repository for TypeScript, JavaScript, and Markdown examples.
Run local semantic search and call graph analysis across codebases.
Analyze local-first AI agent CLI usage patterns and invocation data.