langsmith-fetch
What it does
This tool helps you understand what happened when an AI agent (like those built with LangChain) behaved unexpectedly. It fetches execution logs from LangSmith to show you the steps the agent took, which tools it used, and if any errors occurred.
When to use it
- βWhen an AI agent makes a mistake.
- βTo see an agent's action history.
- βWhen investigating why an agent didn't work as expected.
Skill link
https://github.com/ComposioHQ/awesome-claude-skills/blob/master/langsmith-fetch/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI want to debug my agent and see what happened in the last 5 minutes.β
5 new skills a week. 1 minute to read.
How it works
The tool connects to LangSmith, a service that logs AI agent actions. It downloads these logs and presents them in an organized way so you can see the execution flow, errors, and tool usage.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
LangSmith Fetch - Agent Debugging Skill
Debug LangChain and LangGraph agents by fetching execution traces directly from LangSmith Studio in your terminal.
When to Use This Skill
Automatically activate when user mentions:
- π "Debug my agent" or "What went wrong?"
- π "Show me recent traces" or "What happened?"
- β "Check for errors" or "Why did it fail?"
- πΎ "Analyze memory operations" or "Check LTM"
- π "Review agent performance" or "Check token usage"
- π§ "What tools were called?" or "Show execution flow"
Prerequisites
1. Install langsmith-fetch
pip install langsmith-fetch
2. Set Environment Variables
export LANGSMITH_API_KEY="your_langsmith_api_key"
export LANGSMITH_PROJECT="your_project_name"
Verify setup:
echo $LANGSMITH_API_KEY
echo $LANGSMITH_PROJECT
Core Workflows
Workflow 1: Quick Debug Recent Activity
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:
- β Number of traces found
- β οΈ Any errors or failures
- π οΈ Tools that were called
- β±οΈ Execution times
- π° Token usage
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.
Workflow 2: Deep Dive Specific Trace
When user provides: Trace ID or says "investigate that error"
Execute:
langsmith-fetch trace <trace-id> --format json
Analyze JSON and report:
- π― What the agent was trying to do
- π οΈ Which tools were called (in order)
- β Tool results (success/failure)
- β Error messages (if any)
- π‘ Root cause analysis
- π§ Suggested fix
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
Workflow 3: Export Debug Session
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
Workflow 4: Error Detection
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:
- π Total errors found
- β Error types and frequency
- π When errors occurred
- π― Which agents/tools failed
- π‘ Common patterns
Example response format:
Error Analysis - Last 30 Minutes
Total Traces: 50
Failed Traces: 7 (14% failure rate)
Error Breakdown:
1. Neo4j Connection Timeout (4 occurrences)
- Agent: cypher
- Tool: search_nodes
- First occurred: 14:32
- Last occurred: 14:45
- Pattern: Happens during peak load
2. Memory Store Failed (2 occurrences)
- Agent: memento
- Tool: store_memory
- Error: "Pinecone rate limit exceeded"
- Occurred: 14:38, 14:41
3. Tool Not Found (1 occurrence)
β¦
FAQ
What is LangSmith?
LangSmith is a platform that helps developers build and debug AI applications by logging and analyzing agent executions.
Do I need to install anything?
Yes, you need to install the 'langsmith-fetch' tool and set up your LangSmith API keys.
How do I see errors?
The tool can automatically list traces with errors, or you can ask it to specifically search for recent failures.
Details
Original description by the author
Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio. Use when debugging agent behavior, investigating errors, analyzing tool calls, checking memory operations, or examining agent performance. Automatically fetches recent traces and analyzes execution patterns. Requires langsmith-fetch CLI installed.
Popularity
- GitHub stars
- 77k
- Ranking position
- #2597
- License
- β
- Updated
- 9/18/2026
Comments
- β¦
More skills from this repository
artifacts-builder
77kHelps your agent build complex user interfaces. It uses modern technologies to create rich, interactive web pages.
brand-guidelines
77kHelps your agent apply official brand colors and fonts to materials. It's useful for maintaining visual identity in any piece that needs to look like the company's.
canvas-design
77kLets your agent create original visual art in .png and .pdf. Use it when the user asks to create a poster, art, or other static design.
changelog-generator
77kHelps your agent create user-facing release notes from code commits. It transforms technical information into easy-to-understand text.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.