# Deepagents Langchain

> DeepAgents — production-ready LangGraph agent framework by LangChain. Batteries-included: planning (write_todos), filesystem ops, shell execution, sub-agents with isolated context, auto context summarization. pip install deepagents → create_deep_agen

- **Type:** Skill
- **Install:** `agentstack add skill-mahmoud20138-tradecraft-deepagents-langchain`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [mahmoud20138](https://agentstack.voostack.com/s/mahmoud20138)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [mahmoud20138](https://github.com/mahmoud20138)
- **Source:** https://github.com/mahmoud20138/Tradecraft/tree/main/plugins/tradecraft/skills/deepagents-langchain

## Install

```sh
agentstack add skill-mahmoud20138-tradecraft-deepagents-langchain
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# deepagents-langchain

USE FOR:
  - "production-ready agent with LangGraph"
  - "batteries-included coding/research agent"
  - "sub-agents with isolated context windows"
  - "LangChain agent framework"
  - "agent with planning + filesystem + shell"
  - "MCP tools in LangGraph agent"
tags: [LangGraph, LangChain, agent, production, sub-agents, MCP, planning, filesystem, shell, open-source]
kind: framework
category: ai-agent-builder

---

## What Is DeepAgents?

Production-ready, batteries-included LangGraph agent by LangChain.
No manual setup — `create_deep_agent()` returns a fully functional agent.

- Repo: https://github.com/langchain-ai/deepagents
- Install: `pip install deepagents`
- Framework: **LangGraph** (compiled graph, streaming, persistence, checkpointing)
- LangGraph Studio compatible

---

## Quick Start

```python
pip install deepagents
```

```python
from deepagents import create_deep_agent

agent = create_deep_agent()
result = agent.invoke({
    "messages": [{"role": "user", "content": "Research the latest AI agent frameworks and summarize"}]
})
print(result["messages"][-1].content)
```

---

## Built-in Capabilities

| Capability | Tools Included |
|-----------|---------------|
| **Planning** | `write_todos` — task decomposition + progress tracking |
| **Filesystem** | read, write, edit, search files |
| **Shell** | execute commands (with sandboxing) |
| **Sub-agents** | delegate tasks with isolated context windows |
| **Context** | auto-summarization, large output → file handling |

---

## Architecture (LangGraph)

```python
# Returns a compiled LangGraph graph
agent = create_deep_agent()

# Supports all LangGraph features:
# - Streaming
for chunk in agent.stream({"messages": [("user", "task")]}):
    print(chunk)

# - Persistence / checkpointing
from langgraph.checkpoint.memory import MemorySaver
agent = create_deep_agent(checkpointer=MemorySaver())

# - LangGraph Studio compatibility (visual debug)
```

---

## Customization

```python
from deepagents import create_deep_agent
from langchain_anthropic import ChatAnthropic

# Custom model
agent = create_deep_agent(
    model=ChatAnthropic(model="claude-opus-4-6")
)

# Add custom tools
from langchain_core.tools import tool

@tool
def my_tool(query: str) -> str:
    """Custom tool description"""
    return do_something(query)

agent = create_deep_agent(tools=[my_tool])

# Custom system prompt
agent = create_deep_agent(
    system_prompt="You are an expert financial analyst..."
)
```

---

## MCP Integration

```python
from langchain_mcp_adapters import MCPToolkit

# Connect any MCP server
toolkit = MCPToolkit(server_command=["npx", "gitnexus", "mcp"])
mcp_tools = toolkit.get_tools()

agent = create_deep_agent(tools=mcp_tools)
```

---

## Sub-Agents Pattern

```python
# Main agent delegates to sub-agents with isolated contexts
# Sub-agents don't share main agent's conversation history
# Useful for: parallel research, isolated code execution

agent = create_deep_agent(
    enable_subagents=True,
    subagent_model=ChatAnthropic(model="claude-haiku-4-5-20251001")  # cheaper for subtasks
)
```

---

## Use Cases

- **Research pipeline**: fetch + summarize + synthesize across sources
- **Code automation**: read codebase → plan changes → edit files → run tests
- **Data processing**: ingest files → transform → write outputs
- **Multi-step workflows**: plan → delegate subtasks → aggregate results

---

## vs. Other Agent Frameworks

| Feature | DeepAgents | OpenAlice | AutoHedge |
|---------|-----------|-----------|-----------|
| Framework | LangGraph | Custom TS | Swarms |
| Built-in tools | ✓ (full) | ✓ (trading) | ✓ (trading) |
| Sub-agents | ✓ | ✗ | ✗ |
| MCP support | ✓ | ✓ (planned) | ✗ |
| Domain | General | Trading | Trading |
| Studio UI | ✓ LangGraph | ✓ Web | ✗ |

---

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [mahmoud20138](https://github.com/mahmoud20138)
- **Source:** [mahmoud20138/Tradecraft](https://github.com/mahmoud20138/Tradecraft)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-mahmoud20138-tradecraft-deepagents-langchain
- Seller: https://agentstack.voostack.com/s/mahmoud20138
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
