抓取并分析 LangSmith 执行轨迹,快速定位 LangChain 与 LangGraph 代理问题
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "langsmith-fetch" 技能: 1. 下载 https://raw.githubusercontent.com/ComposioHQ/awesome-claude-skills/master/langsmith-fetch/SKILL.md 2. 保存为 ~/.claude/skills/langsmith-fetch/SKILL.md 3. 装好后重载技能,告诉我可以用了
请抓取最近的 LangSmith 执行轨迹,分析这个 LangChain 代理为何报错,重点检查报错步骤、工具调用参数和上下文传递问题,并给出可能修复建议。
返回最近报错链路的分析结果,指出失败节点、可能原因与修复方向。
请读取最近几次 LangSmith 轨迹,检查代理的工具调用是否存在参数错误、重复调用或无效调用,并总结异常模式。
输出工具调用问题清单,并总结常见异常与优化建议。
请抓取近期 LangGraph 代理的执行轨迹,分析记忆读写是否正常、是否存在上下文膨胀,并评估整体执行耗时与性能瓶颈。
返回记忆操作与性能分析报告,标出瓶颈步骤和改进建议。
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:
…
帮助用户发现并筛选 Claude 技能、资源与工具,优化 AI 工作流定制
通过 Rube MCP 自动执行 Algolia 检索与索引管理等任务。
通过 Rube MCP 自动化 Agiled 中的客户、项目与业务流程操作。
通过 Rube MCP 自动执行 Giphy 搜索与动图管理等工作流。
通过 Rube MCP 自动处理 GoToWebinar 的创建、报名与参会管理流程
通过 Rube MCP 自动执行 Agenty 任务,并先检索最新工具参数与结构。
用自然语言管理 LangSmith 的追踪、提示词、数据集、实验与计费。
将 Langfuse 可观测性追踪拉入编码代理上下文,便于用自然语言排查与分析问题。
提供本地语义搜索与调用图分析,帮助快速理解和定位代码关系
通过分析 JSONL 调试日志,快速定位聊天代理异常、耗时与调用原因
通过 Rube MCP 自动执行 Langbase 相关任务并按最新工具 schema 操作。
帮助开发者用轻量可审计的代码代理完成编程、检索、规划与代码调试评测。