deepagents-thread-inspector

Inspect and summarize conversations stored in the local Deep Agents Code SQLite session database.

28.8k|4.0k|Updated Jul 27, 2025
One-click install
npx skills add https://github.com/langchain-ai/deepagents --skill deepagents-thread-inspector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deepagents-thread-inspector
Source: https://github.com/langchain-ai/deepagents/tree/main/libs/code/deepagents_code/built_in_skills/deepagents-thread-inspector
Command: npx skills add https://github.com/langchain-ai/deepagents --skill deepagents-thread-inspector

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires langgraph, langchain-core, and includes scripts (resource) components.

What problem does it solve?

When LangSmith tracing is unavailable, offline, or a session was never traced, there is no easy way to see what happened in a local Deep Agents Code (dcode) conversation. This Skill reads the local SQLite session store and reconstructs thread history so you can explain what an agent did.

Core Features & Use Cases

  • Thread Inspection: Reconstruct messages from LangGraph checkpoints or by replaying the writes table, with summary, latest-turn, and full-transcript views.
  • Thread Discovery: List recent local threads and resolve ambiguous thread-ID prefixes when the full UUID is unknown.
  • Safe Read-Only Access: Opens the database read-only, applies the same path-resolution rules as dcode, and surfaces warnings for corrupt checkpoints or malformed records.
  • Use Case: A user asks "what did the agent do in my last session?" You list recent threads, pick the latest one, and summarize the final turn's request, tool actions, and conclusion.

Quick Start

Ask the agent to inspect a local dcode thread by its ID or prefix, for example: "Summarize what happened in my most recent Deep Agents Code session."

Frequently Asked Questions about deepagents-thread-inspector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I inspect a local Deep Agents Code thread?

Run the inspect_sessions.py script with a thread ID or unique prefix and a mode such as latest-turn, summary, or transcript. It reads the local sessions.db read-only and prints the reconstructed conversation as JSON.

How do I find a thread ID if I only know part of it?

Pass any unique prefix of the thread ID and the script resolves it automatically. If you do not know the ID at all, use the --list N option to show the N most recent threads with timestamps and metadata.

When should I use this instead of LangSmith tracing?

Use it as a fallback when LangSmith tooling is unavailable, the session was never traced, or you are working offline. If LangSmith trace tooling is available for the thread, prefer it over local database inspection.

Where is the Deep Agents Code sessions database located?

The default path is $DEEPAGENTS_HOME/.state/sessions.db, or ~/.deepagents/.state/sessions.db when that variable is unset. The DEEPAGENTS_SESSIONS_DB environment variable overrides both, and --db PATH handles non-default stores.

Is it safe to inspect the sessions database while dcode is running?

Yes, the script opens the database in read-only mode and never mutates or deletes session rows. However, checkpoint deserialization is intended only for trusted local Deep Agents state, so do not point it at untrusted databases.

Why does inspection output include a warnings array?

Warnings appear when the latest checkpoint is corrupt or undecodable, a write is skipped during replay, or metadata is malformed. The script falls back to replaying the writes table and flags the issue so conclusions can be appropriately hedged.