langsmith-fetch
하는 일
이 도구는 AI 에이전트(LangChain으로 만든 것 등)가 예상과 다르게 작동했을 때 무슨 일이 있었는지 이해하도록 돕습니다. LangSmith에서 실행 로그를 가져와 에이전트가 거친 단계, 사용한 도구, 발생한 오류를 보여 줍니다.
사용하는 경우
- ✓AI 에이전트가 실수했을 때.
- ✓에이전트가 한 작업 기록을 보고 싶을 때.
- ✓에이전트가 기대와 다르게 작동한 이유를 조사하는 경우.
스킬 링크
https://github.com/ComposioHQ/awesome-claude-skills/blob/master/langsmith-fetch/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“에이전트를 디버그하고 지난 5분 동안 무슨 일이 있었는지 보고 싶습니다.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
도구는 AI 에이전트의 작업을 기록하는 서비스인 LangSmith에 연결합니다. 로그를 내려받아 실행 흐름, 오류, 도구 사용을 볼 수 있도록 정리해서 보여 줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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)
…
자주 묻는 질문
LangSmith가 무엇인가요?
개발자가 에이전트 실행을 기록하고 분석해서 AI 애플리케이션을 만들고 디버그하도록 돕는 플랫폼입니다.
무엇인가 설치해야 하나요?
네, ‘langsmith-fetch’ 도구를 설치하고 LangSmith API 키를 설정해야 합니다.
오류는 어떻게 확인하나요?
도구가 오류가 있는 추적 기록을 자동으로 나열하거나, 최근 실패를 특별히 검색하도록 요청할 수 있습니다.
상세 정보
작성자의 원본 설명
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.
인기도
- GitHub 스타
- 77k
- 순위
- #2597
- 라이선스
- —
- 업데이트
- 2026. 9. 18.
댓글
- …
이 저장소의 다른 스킬
artifacts-builder
77k복잡한 사용자 인터페이스를 만들도록 에이전트를 돕습니다. 현대 기술을 사용해 풍부하고 상호작용이 있는 웹 페이지를 만듭니다.
brand-guidelines
77k공식 브랜드 색상과 글꼴을 자료에 적용하도록 에이전트를 돕습니다. 회사의 모습을 따라야 하는 자료의 시각 정체성을 유지하는 데 유용합니다.
canvas-design
77k.png와 .pdf 형식의 독창적인 시각 예술 작품을 만들도록 에이전트를 돕습니다. 포스터, 예술 작품, 기타 정적 디자인을 요청할 때 사용하세요.
changelog-generator
77k코드 커밋으로부터 사용자에게 보이는 출시 노트를 만들도록 에이전트를 돕습니다. 기술 정보를 이해하기 쉬운 글로 바꿉니다.