skills/langchain-deepagents/SKILL.md
LangChain Deep Agents (Python) — build, deploy, and customize stateful long-running agents with virtual filesystems, subagents, human-in-the-loop, and LangSmith observability. Also covers LangGraph, LangChain OSS chains/retrievers, and Agent Server API.
npx skillsauth add enuno/claude-command-and-control langchain-deepagentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert assistance for building LangChain Deep Agents in Python: stateful agents with virtual filesystems, parallel subagents, tool permissions, human-in-the-loop, and deployment via LangSmith.
Reference corpus: 1473 pages of official docs in references/llms-txt.md (5.4 MB) and references/llms-full.md (10 MB). Use view references/llms-full.md when detailed implementation is needed.
Activate when:
langgraph.json, Agent Server, or deployment pipelines@traceable, running client.evaluate()StateGraph, checkpointers, or thread statefrom langgraph.graph import StateGraph, MessagesState
from langgraph.checkpoint.memory import InMemorySaver
from langchain.agents import create_agent
# Checkpointer persists agent state across runs
checkpointer = InMemorySaver()
agent = create_agent(
skills=[...], # Skill middleware layers
checkpointer=checkpointer,
)
from langsmith import traceable
from langsmith.schemas import Attachment
from pathlib import Path
@traceable
def my_agent_step(inputs: dict) -> dict:
# Automatically traced in LangSmith
return {"output": process(inputs)}
# Attach files to traces
@traceable
def analyze_file(path: Path) -> dict:
attachment = Attachment(mime_type="text/plain", data=path.read_bytes())
return {"result": process(attachment)}
from langsmith import Client
client = Client()
def target(inputs):
return {"output": my_agent.invoke(inputs)}
def accuracy_evaluator(run, example):
score = evaluate_output(run.outputs, example.outputs)
return {"key": "accuracy", "score": score}
# Non-blocking: stream results as they arrive
results = client.evaluate(
target,
data="my_test_dataset",
evaluators=[accuracy_evaluator],
blocking=False,
)
for result in results:
print(result)
import langsmith as ls
from langgraph.graph import StateGraph, MessagesState
# Accept trace context propagated from upstream callers
# Headers passed via config["configurable"]["langsmith-trace"]
def my_node(state: MessagesState, config: dict):
trace_headers = config.get("configurable", {})
with ls.trace(headers=trace_headers):
return process(state)
# Subagents inherit parent permissions by default.
# Setting permissions REPLACES (does not extend) parent rules.
subagent_spec = {
"name": "restricted-subagent",
"permissions": [
{"path": "/workspace", "access": "read-write"},
# Parent's other permissions are NOT inherited
]
}
from langgraph_sdk.auth import Auth
auth = Auth()
@auth.authenticate
async def handler(request):
user = await validate_token(request.headers.get("Authorization"))
return {
"identity": user.id,
"role": user.role,
# Accessible in graph via config["configurable"]["langgraph_auth_user"]
}
| File | Size | Contents |
|------|------|----------|
| references/llms-txt.md | 5.4 MB | Full doc corpus — summaries of 1473 pages |
| references/llms-full.md | 10 MB | Complete page content with all code examples |
| references/llms.md | 104 KB | Site index — all doc URLs with descriptions |
| references/index.md | 1 KB | Category index |
To find specific content: Search references/llms.md for topic URLs, then look up full content in references/llms-full.md.
From references/llms.md — Python-specific deep agents docs at /oss/python/deepagents/:
/oss/python/deepagents/overview/oss/python/deepagents/subagents — parallel execution, permission scoping/oss/python/deepagents/human-in-the-loop — approval gates for tool calls/oss/python/deepagents/backends — CompositeBackend, virtual FS, route prefixes/oss/python/deepagents/context-engineering — managing long-running context/oss/python/deepagents/frontend/todo-list — useStream + custom state keys/oss/python/deepagents/data-analysis/oss/python/deepagents/deep-research| Operation | Method + Path |
|-----------|--------------|
| Create thread | POST /threads |
| Stream run | POST /threads/{id}/runs/stream |
| Create assistant | POST /assistants |
| Schedule cron | POST /crons |
| Store/retrieve state | PUT/GET /store/{namespace}/{key} |
| Health check | GET /ok |
| Server info | GET /info |
CompositeBackend requires explicit route prefixes — path restrictions alone cannot prevent sandbox filesystem access via shell commandsTo re-scrape with tighter scope (deep agents section only):
skill-seekers scrape --url "https://docs.langchain.com/oss/python/deepagents/overview" --name langchain-deepagents
tools
MemPalace local-first AI memory system. Use when setting up persistent memory for Claude Code sessions, mining project files or conversation transcripts, querying past context, configuring MCP tools, managing the knowledge graph, or troubleshooting palace operations.
tools
LangSmith Python SDK — trace, evaluate, and monitor LLM applications. Covers @traceable decorator, trace context manager, Client API, evaluate() / aevaluate(), comparative evaluation, custom evaluators, dataset management, prompt caching, ASGI middleware, and pytest plugin.
development
LangGraph (Python) — build stateful, controllable agent graphs with checkpointing, streaming, persistence, interrupts, fault tolerance, and durable execution. Covers both Graph API (StateGraph) and Functional API (@entrypoint/@task).
development
LangGraph Graph API (Python) — build explicit DAG agent workflows with StateGraph, typed state, nodes, edges, Command routing, Send fan-out, checkpointers, interrupts, and streaming. Use when you need explicit control flow and graph topology.