1. Project Overview & Quickstart (langchain-ai/deepagents)
File: README.md
Deep Agents is an open source agent harness โ an opinionated agent that runs out of the box. Extend, override, or replace any piece.
Principles:
- Opinionated โ defaults tuned for long-horizon, multi-step work
- Extensible โ override or replace any piece without forking
- Model-agnostic โ works with any LLM that supports tool calling: frontier, open-weight, or local
- Production-ready โ built on LangGraph (streaming, persistence, checkpointing) with first-class tracing, evaluation, and deployment via LangSmith
Features include:
- Sub-agents โ delegate tasks to agents with isolated context windows
- Filesystem โ read, write, edit, or search over pluggable local, sandboxed, or remote backends
- Context management โ summarize long threads and offload tool outputs to disk
- Shell access โ run commands in your sandbox of choice
- Persistent memory โ pluggable state and store backends for cross-session recall
- Human-in-the-loop โ approve, edit, or reject tool calls before they run
- Skills โ reusable behaviors the agent can load on demand
- Tools โ bring your own functions or any MCP server
Deep Agents is available as a JavaScript/TypeScript library โ see deepagents.js.
[!NOTE]
Deep Agents Code โ a pre-built coding agent in your terminal, similar to Claude Code or Cursor, powered by any LLM. Install withcurl -LsSf https://langch.in/dcode | bash. See the documentation for the full feature set.
Quickstart
uv add deepagentsfrom deepagents import create_deep_agent
agent = create_deep_agent(
model="openai:gpt-5.5",
tools=[my_custom_tool],
system_prompt="You are a research assistant.",
)
result = agent.invoke({"messages": "Research LangGraph and write a summary"})The agent can plan, read/write files, and manage its own context. Add your own tools, swap models, customize prompts, configure sub-agents, and more. See the documentation for full details.
[!TIP]
For developing, debugging, and deploying AI agents and LLM applications, see LangSmith.
FAQ
How is this different from LangGraph or LangChain?
LangGraph is the graph runtime. LangChain's create_agent is a minimal agent harness on top of it. Deep Agents is a more opinionated harness on top of create_agent โ same building blocks, but with filesystem, sub-agents, context management, and skills bundled in. For how the three relate, see the LangChain ecosystem overview.
Does this work with open-weight or local models?
Yes. Any model that supports tool calling works โ frontier APIs (OpenAI, Anthropic, Google), open-weight models hosted on providers like Baseten or Fireworks, and self-hosted models via Ollama, vLLM, or llama.cpp. Use any LangChain chat model.
Can I use this in production?
Yes! Deep Agents is built on LangGraph, designed for production agent deployments. Pair it with LangSmith for tracing, evaluation, and monitoring. See Going to production for the full guide.
When should I use Deep Agents vs. LangChain or LangGraph directly?
All three are layers in the same stack โ see the LangChain ecosystem overview for how they relate. Use Deep Agents when you want the full harness โ planning, context management, delegation โ out of the box. Use LangChain's create_agent when you want a lighter harness without the bundled middleware. Drop to LangGraph when the agent loop itself isn't the right shape and you need a custom graph.
The layers compose: any LangGraph CompiledStateGraph can be passed in as a sub-agent to a Deep Agent, so custom orchestration plugs in alongside the harness's defaults.
Resources
- Examples โ working agents and patterns
- Documentation โ conceptual overviews and guides
- LangChain ecosystem overview โ how Deep Agents, LangChain, LangGraph, and LangSmith fit together
- API reference โ complete reference for all public classes, functions, and types
- Discussions โ community forum for technical questions, ideas, and feedback
- LangChain Academy โ Comprehensive, free courses on LangChain libraries and products, made by the LangChain team.
- Contributing Guide โ how to contribute and find good first issues
- Code of Conduct โ community guidelines and standards
Acknowledgements
Inspired by Claude Code: an attempt to identify what makes it general-purpose, and push that further.
Security
Deep Agents follows a "trust the LLM" model. The agent can do anything its tools allow. Enforce boundaries at the tool/sandbox level, not by expecting the model to self-police. See the security policy for more information.
File: examples/content-builder-agent/README.md
Content Builder Agent
A content writing agent for writing blog posts, LinkedIn posts, and tweets with cover images included.
This example demonstrates how to define an agent through three filesystem primitives:
- Memory (
AGENTS.md) โ persistent context like brand voice and style guidelines - Skills (
skills/*/SKILL.md) โ workflows for specific tasks, loaded on demand - Subagents (
subagents.yaml) โ specialized agents for delegated tasks like research
The content_writer.py script shows how to combine these into a working agent.
Quick Start
# Set API keys
export ANTHROPIC_API_KEY="..."
export GOOGLE_API_KEY="..." # For image generation
export TAVILY_API_KEY="..." # For web search (optional)
# Run (uv automatically installs dependencies on first run)
cd examples/content-builder-agent
uv run python content_writer.py "Write a blog post about prompt engineering"More examples:
uv run python content_writer.py "Create a LinkedIn post about AI agents"
uv run python content_writer.py "Write a Twitter thread about the future of coding"How It Works
The agent is configured by files on disk, not code:
content-builder-agent/
โโโ AGENTS.md # Brand voice & style guide
โโโ subagents.yaml # Subagent definitions
โโโ skills/
โ โโโ blog-post/
โ โ โโโ SKILL.md # Blog writing workflow
โ โโโ social-media/
โ โโโ SKILL.md # Social media workflow
โโโ content_writer.py # Wires it together (includes tools)| File | Purpose | When Loaded |
|---|---|---|
AGENTS.md |
Brand voice, tone, writing standards | Always (system prompt) |
subagents.yaml |
Research and other delegated tasks | Always (defines task tool) |
skills/*/SKILL.md |
Content-specific workflows | On demand |
What's in the skills? Each skill teaches the agent a specific workflow:
- Blog posts: Structure (hook โ context โ main content โ CTA), SEO best practices, research-first approach
- Social media: Platform-specific formats (LinkedIn character limits, Twitter thread structure), hashtag usage
- Image generation: Detailed prompt engineering guides with examples for different content types (technical posts, announcements, thought leadership)
Architecture
agent = create_deep_agent(
memory=["./AGENTS.md"], # โ Middleware loads into system prompt
skills=["./skills/"], # โ Middleware loads on demand
tools=[generate_cover, generate_social_image], # โ Image generation tools
subagents=load_subagents("./subagents.yaml"), # โ See note below
backend=FilesystemBackend(root_dir="./"),
)The memory and skills parameters are handled natively by deepagents middleware. Tools are defined in the script and passed directly.
Note on subagents: Unlike memory and skills, subagents must be defined in code. We use a small load_subagents() helper to externalize config to YAML. You can also define them inline:
subagents=[
{
"name": "researcher",
"description": "Research topics before writing...",
"model": "anthropic:claude-haiku-4-5-20251001",
"system_prompt": "You are a research assistant...",
"tools": [web_search],
}
],Flow:
- Agent receives task โ loads relevant skill (blog-post or social-media)
- Delegates research to
researchersubagent โ saves toresearch/ - Writes content following skill workflow โ saves to
blogs/orlinkedin/ - Generates cover image with Gemini โ saves alongside content
Output
blogs/
โโโ prompt-engineering/
โโโ post.md # Blog content
โโโ hero.png # Generated cover image
linkedin/
โโโ ai-agents/
โโโ post.md # Post content
โโโ image.png # Generated image
research/
โโโ prompt-engineering.md # Research notesCustomizing
Change the voice: Edit AGENTS.md to modify brand tone and style.
Add a content type: Create skills/<name>/SKILL.md with YAML frontmatter:
---
name: newsletter
---
# Newsletter Skill
...Add a subagent: Add to subagents.yaml:
editor:
model: anthropic:claude-haiku-4-5-20251001
system_prompt: |
You are an editor. Review the content and suggest improvements...
tools: []Add a tool: Define it in content_writer.py with the @tool decorator and add to tools=[].
Security Note
This agent has filesystem access and can read, write, and delete files on your machine. Review generated content before publishing and avoid running in directories with sensitive data.
Requirements
- Python 3.11+
ANTHROPIC_API_KEY- For the main agentGOOGLE_API_KEY- For image generation (uses Gemini's Imagen / "nano banana" viagemini-2.5-flash-image)TAVILY_API_KEY- For web search (optional, research still works without it)
Resources
- LangChain Academy โ Comprehensive, free courses on LangChain libraries and products, made by the LangChain team.
- Code of Conduct โ community guidelines and standards
File: examples/deep_research/README.md
๐ Deep Research
๐ Quickstart
Prerequisites: Install uv package manager:
curl -LsSf https://astral.sh/uv/install.sh | shEnsure you are in the deep_research directory:
cd examples/deep_researchInstall packages:
uv syncSet your API keys in your environment:
export ANTHROPIC_API_KEY=your_anthropic_api_key_here # Required for Claude model
export GOOGLE_API_KEY=your_google_api_key_here # Required for Gemini model ([get one here](https://ai.google.dev/gemini-api/docs))
export TAVILY_API_KEY=your_tavily_api_key_here # Required for web search ([get one here](https://www.tavily.com/)) with a generous free tier
export LANGSMITH_API_KEY=your_langsmith_api_key_here # [LangSmith API key](https://smith.langchain.com/settings) (free to sign up)Usage Options
You can run this example in two ways:
Option 1: Jupyter Notebook
Run the interactive notebook to step through the research agent:
uv run jupyter notebook research_agent.ipynbOption 2: LangGraph Server
Run a local LangGraph server with a web interface:
langgraph devLangGraph server will open a new browser window with the Studio interface, which you can submit your search query to:
You can also connect the LangGraph server to a UI specifically designed for deepagents:
git clone https://github.com/langchain-ai/deep-agents-ui.git
cd deep-agents-ui
yarn install
yarn devThen follow the instructions in the deep-agents-ui README to connect the UI to the running LangGraph server.
This provides a user-friendly chat interface and visualization of files in state.
๐ Resources
- Deep Research Course - Full course on deep research with LangGraph
- Code of Conduct โ community guidelines and standards
Custom Model
By default, deepagents uses "claude-sonnet-4-5-20250929". You can customize this by passing any LangChain model object. See the Deep Agents package README for more details.
from langchain.chat_models import init_chat_model
from deepagents import create_deep_agent
# Using Claude
model = init_chat_model(model="anthropic:claude-sonnet-4-5-20250929", temperature=0.0)
# Using Gemini
from langchain_google_genai import ChatGoogleGenerativeAI
model = ChatGoogleGenerativeAI(model="gemini-3-pro-preview")
agent = create_deep_agent(
model=model,
)Custom Instructions
The deep research agent uses custom instructions defined in research_agent/prompts.py that complement (rather than duplicate) the default middleware instructions. You can modify these in any way you want.
| Instruction Set | Purpose |
|---|---|
RESEARCH_WORKFLOW_INSTRUCTIONS |
Defines the 5-step research workflow: save request โ plan with TODOs โ delegate to sub-agents โ synthesize โ respond. Includes research-specific planning guidelines like batching similar tasks and scaling rules for different query types. |
SUBAGENT_DELEGATION_INSTRUCTIONS |
Provides concrete delegation strategies with examples: simple queries use 1 sub-agent, comparisons use 1 per element, multi-faceted research uses 1 per aspect. Sets limits on parallel execution (max 3 concurrent) and iteration rounds (max 3). |
RESEARCHER_INSTRUCTIONS |
Guides individual research sub-agents to conduct focused web searches. Includes hard limits (2-3 searches for simple queries, max 5 for complex), emphasizes using think_tool after each search for strategic reflection, and defines stopping criteria. |
Custom Tools
The deep research agent adds the following custom tools beyond the built-in deepagent tools. You can also use your own tools, including via MCP servers. See the Deep Agents package README for more details.
| Tool Name | Description |
|---|---|
tavily_search |
Web search tool that uses Tavily purely as a URL discovery engine. Performs searches using Tavily API to find relevant URLs, fetches full webpage content via HTTP with proper User-Agent headers (avoiding 403 errors), converts HTML to markdown, and returns the complete content without summarization to preserve all information for the agent's analysis. Works with both Claude and Gemini models. |
think_tool |
Strategic reflection mechanism that helps the agent pause and assess progress between searches, analyze findings, identify gaps, and plan next steps. |
File: examples/downloading_agents/README.md
Downloading Agents
Agents are just folders. This means you can share, download, and run them instantly.
Why This Works
- Agents are folders โ An agent is just an
AGENTS.mdfile (memory/instructions) plus askills/directory. No code required. - Single artifact โ Package skills and memory together in one zip. Everything the agent needs to run.
- Run in seconds โ Download, unzip, and run with deepagents-cli. No setup, no configuration.
Prerequisites
uv tool install deepagents-cli==0.0.13Quick Start
# Create a project folder
mkdir my-project && cd my-project && git init
# Download the agent
curl -L https://raw.githubusercontent.com/langchain-ai/deepagents/main/examples/downloading_agents/content-writer.zip -o agent.zip
# Unzip to .deepagents
unzip agent.zip -d .deepagents
# Run it
deepagentsWhat's Inside
.deepagents/
โโโ AGENTS.md # Agent memory & instructions
โโโ skills/
โโโ blog-post/SKILL.md # Blog writing workflow
โโโ social-media/SKILL.md # LinkedIn/Twitter workflowOne-Liner
git init && curl -L https://raw.githubusercontent.com/langchain-ai/deepagents/main/examples/downloading_agents/content-writer.zip -o agent.zip && unzip agent.zip -d .deepagents && rm agent.zip && deepagentsResources
- LangChain Academy โ Comprehensive, free courses on LangChain libraries and products, made by the LangChain team.
- Code of Conduct โ community guidelines and standards
File: examples/ralph_mode/README.md
Ralph Mode for Deep Agents
What is Ralph?
Ralph is an autonomous looping pattern created by Geoff Huntley that went viral in late 2025. The original implementation is literally one line:
while :; do cat PROMPT.md | agent ; doneEach loop starts with fresh contextโthe simplest pattern for context management. No conversation history to manage, no token limits to worry about. Just start fresh every iteration.
The filesystem and git allow the agent to track progress over time. This serves as its memory and worklog.
Quick Start
# Install uv (if you don't have it)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create a virtual environment
uv venv
source .venv/bin/activate
# Install the CLI
uv pip install deepagents-cli
# Download the script (or copy from examples/ralph_mode/ if you have the repo)
curl -O https://raw.githubusercontent.com/langchain-ai/deepagents/main/examples/ralph_mode/ralph_mode.py
# Run Ralph
python ralph_mode.py "Build a Python programming course for beginners. Use git."Usage
# Unlimited iterations (Ctrl+C to stop)
python ralph_mode.py "Build a Python course"
# With iteration limit
python ralph_mode.py "Build a REST API" --iterations 5
# With specific model
python ralph_mode.py "Create a CLI tool" --model claude-sonnet-4-6
# With a specific working directory
python ralph_mode.py "Build a web app" --work-dir ./my-project
# Run in a remote sandbox (AgentCore, Modal, Daytona, or Runloop)
python ralph_mode.py "Build an app" --sandbox modal
python ralph_mode.py "Build an app" --sandbox daytona --sandbox-setup ./setup.sh
# Reuse an existing sandbox instance
python ralph_mode.py "Build an app" --sandbox modal --sandbox-id my-sandbox
# Auto-approve specific shell commands (or "recommended" for safe defaults)
python ralph_mode.py "Build an app" --shell-allow-list recommended
python ralph_mode.py "Build an app" --shell-allow-list "ls,cat,grep,pwd"
# Pass model parameters
python ralph_mode.py "Build an app" --model-params '{"temperature": 0.5}'
# Disable streaming output
python ralph_mode.py "Build an app" --no-streamRemote sandboxes
Ralph supports running agent code in isolated remote environments via the--sandbox flag. The agent runs locally but executes all code operations in the
remote sandbox. See the
sandbox documentation
for provider setup (API keys, etc.) and the
sandboxes concept guide
for architecture details.
Supported providers: AgentCore, Modal, Daytona, Runloop.
How It Works
- You provide a task โ declarative, what you want (not how)
- Agent runs โ creates files, makes progress
- Loop repeats โ same prompt, but files persist
- You stop it โ Ctrl+C when satisfied
Credits
- Original Ralph concept by Geoff Huntley
- Brief History of Ralph by HumanLayer
Resources
- LangChain Academy โ Comprehensive, free courses on LangChain libraries and products, made by the LangChain team.
- Code of Conduct โ community guidelines and standards
File: examples/text-to-sql-agent/README.md
Text-to-SQL Deep Agent
A natural language to SQL query agent powered by LangChain's Deep Agents framework. This is an advanced version of a text-to-SQL agent with planning, filesystem, and subagent capabilities.
What is Deep Agents?
Deep Agents is a sophisticated agent framework built on LangGraph that provides:
- Planning capabilities - Break down complex tasks with
write_todostool - Filesystem backend - Save and retrieve context with file operations
- Subagent spawning - Delegate specialized tasks to focused agents
- Context management - Prevent context window overflow on complex tasks
Demo Database
Uses the Chinook database - a sample database representing a digital media store.
Quick Start
Prerequisites
- Python 3.11 or higher
- Anthropic API key (get one here)
- (Optional) LangSmith API key for tracing (sign up here)
Installation
- Clone the deepagents repository and navigate to this example:
git clone https://github.com/langchain-ai/deepagents.git
cd deepagents/examples/text-to-sql-agent- Download the Chinook database:
# Download the SQLite database file
curl -L -o chinook.db https://github.com/lerocha/chinook-database/raw/master/ChinookDatabase/DataSources/Chinook_Sqlite.sqlite- Create a virtual environment and install dependencies:
# Using uv (recommended)
uv venv --python 3.11
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv sync- Set up your environment variables:
cp .env.example .env
# Edit .env and add your API keysRequired in .env:
ANTHROPIC_API_KEY=your_anthropic_api_key_hereOptional:
LANGSMITH_TRACING=true
LANGSMITH_ENDPOINT=https://api.smith.langchain.com
LANGSMITH_API_KEY=your_langsmith_api_key_here
LANGSMITH_PROJECT=text2sql-deepagentUsage
Command Line Interface
Run the agent from the command line with a natural language question:
python agent.py "What are the top 5 best-selling artists?"python agent.py "Which employee generated the most revenue by country?"python agent.py "How many customers are from Canada?"Programmatic Usage
You can also use the agent in your Python code:
from agent import create_sql_deep_agent
# Create the agent
agent = create_sql_deep_agent()
# Ask a question
result = agent.invoke({
"messages": [{"role": "user", "content": "What are the top 5 best-selling artists?"}]
})
print(result["messages"][-1].content)How the Deep Agent Works
Architecture
User Question
โ
Deep Agent (with planning)
โโ write_todos (plan the approach)
โโ SQL Tools
โ โโ list_tables
โ โโ get_schema
โ โโ query_checker
โ โโ execute_query
โโ Filesystem Tools (optional)
โ โโ ls
โ โโ read_file
โ โโ write_file
โ โโ edit_file
โโ Subagent Spawning (optional)
โ
SQLite Database (Chinook)
โ
Formatted AnswerConfiguration
Deep Agents uses progressive disclosure with memory files and skills:
AGENTS.md (always loaded) - Contains:
- Agent identity and role
- Core principles and safety rules
- General guidelines
- Communication style
skills/ (loaded on-demand) - Specialized workflows:
- query-writing - How to write and execute SQL queries (simple and complex)
- schema-exploration - How to discover database structure and relationships
The agent sees skill descriptions in its context but only loads the full SKILL.md instructions when it determines which skill is needed for the current task. This progressive disclosure pattern keeps context efficient while providing deep expertise when needed.
Example Queries
Simple Query
"How many customers are from Canada?"The agent will directly query and return the count.
Complex Query with Planning
"Which employee generated the most revenue and from which countries?"The agent will:
- Use
write_todosto plan the approach - Identify required tables (Employee, Invoice, Customer)
- Plan the JOIN structure
- Execute the query
- Format results with analysis
Deep Agent Output Example
The Deep Agent shows its reasoning process:
Question: Which employee generated the most revenue by country?
[Planning Step]
Using write_todos:
- [ ] List tables in database
- [ ] Examine Employee and Invoice schemas
- [ ] Plan multi-table JOIN query
- [ ] Execute and aggregate by employee and country
- [ ] Format results
[Execution Steps]
1. Listing tables...
2. Getting schema for: Employee, Invoice, InvoiceLine, Customer
3. Generating SQL query...
4. Executing query...
5. Formatting results...
[Final Answer]
Employee Jane Peacock (ID: 3) generated the most revenue...
Top countries: USA ($1000), Canada ($500)...Project Structure
text-to-sql-agent/
โโโ agent.py # Core Deep Agent implementation with CLI
โโโ AGENTS.md # Agent identity and general instructions (always loaded)
โโโ skills/ # Specialized workflows (loaded on-demand)
โ โโโ query-writing/
โ โ โโโ SKILL.md # SQL query writing workflow
โ โโโ schema-exploration/
โ โโโ SKILL.md # Database structure discovery workflow
โโโ chinook.db # Sample SQLite database (downloaded, gitignored)
โโโ pyproject.toml # Project configuration and dependencies
โโโ uv.lock # Locked dependency versions
โโโ .env.example # Environment variable template
โโโ .gitignore # Git ignore rules
โโโ text-to-sql-langsmith-trace.png # LangSmith trace example image
โโโ README.md # This fileLangSmith Integration
Setup
- Sign up for a free account at LangSmith
- Create an API key from your account settings
- Add these variables to your
.envfile:
LANGSMITH_TRACING=true
LANGSMITH_ENDPOINT=https://api.smith.langchain.com
LANGSMITH_API_KEY=your_langsmith_api_key_here
LANGSMITH_PROJECT=text2sql-deepagentWhat You'll See
When configured, every query is automatically traced:
You can view:
- Complete execution trace with all tool calls
- Planning steps (write_todos)
- Filesystem operations
- Token usage and costs
- Generated SQL queries
- Error messages and retry attempts
View your traces at: https://smith.langchain.com/
Resources
- Deep Agents Documentation
- LangChain
- Claude Sonnet 4.5
- Chinook Database
- LangChain Academy โ Comprehensive, free courses on LangChain libraries and products, made by the LangChain team.
- Code of Conduct โ community guidelines and standards
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
File: examples/README.md
Examples
Featured
| ### Deep Agents Code
A pre-built coding Deep Agent in your terminal โ similar to Claude Code or Codex โ powered by any LLM. Includes an interactive TUI, web search, remote sandboxes, persistent memory, custom skills, and human-in-the-loop approval.
curl -LsSf https://langch.in/dcode bashAn open-source, async coding agent for your org's internal workflows. Runs each task in an isolated cloud sandbox, integrates with Slack, Linear, and GitHub, and ships PRs end-to-end.
@open-swe fix this user-reported bug plz!Repository ยท Blog post |
| --- | --- |
In the wild
Production agents powered by the LangChain stack:
| Project | Description |
|---|---|
| LangSmith Fleet | No-code platform for building AI agents from templates; connect your accounts and let the agent handle routine work |
| Chat LangChain | Documentation assistant that answers questions about LangChain, LangGraph, and LangSmith (source) |
All examples
Research
| Example | Description |
|---|---|
| Deep Research | Multi-step web research with Tavily, parallel sub-agents, and strategic reflection |
| MCP Docs Agent | Docs research agent using MCP tools over LangChain documentation |
Coding
| Example | Description |
|---|---|
| Coding Agent | Autonomous coding agent in a LangSmith sandbox |
| Nemotron Research Agent | NVIDIA Nemotron Super for research + GPU-accelerated execution via RAPIDS |
Content
| Example | Description |
|---|---|
| Content Builder | Blog posts, LinkedIn posts, and tweets with memory (AGENTS.md), skills, and subagents |
| Text-to-SQL | Natural language to SQL with planning and skill-based workflows on the Chinook demo database |
| LLM Wiki | Script-first LLM wiki synced via langsmith hub init/pull/push |
Deployable services
| Example | Description |
|---|---|
| Content Writer | Content writer with per-user memory and Supabase auth |
| GTM Strategist | GTM strategy agent coordinating sync and async subagents |
| Async Subagent Server | Self-hosted Agent Protocol server exposing a researcher as an async subagent |
Advanced patterns
| Example | Description |
|---|---|
| Ralph Loop | Autonomous looping with fresh context each iteration, using the filesystem for persistence |
| Agents as Folders | Download a zip, unzip, and run |
| Better Harness | Eval-driven outer-loop optimization of a Deep Agents harness |
Each example has its own README with setup instructions.
Contributing an example
See the Contributing Guide for general contribution guidelines.
When adding a new example:
- Use uv for dependency management with a
pyproject.tomlanduv.lock(commit the lock file) - Pin to deepagents version โ use a version range (e.g.,
>=0.3.5,<0.4.0) in dependencies - Include a
READMEwith clear setup and usage instructions - Add tests for reusable utilities or non-trivial helper logic
- Keep it focused โ each example should demonstrate one use-case or workflow
- Follow the structure of existing examples (see
deep_research/ortext-to-sql-agent/as references)
Resources
- LangChain Academy โ Comprehensive, free courses on LangChain libraries and products, made by the LangChain team.
- Code of Conduct โ community guidelines and standards
File: libs/partners/runloop/README.md
langchain-runloop
Looking for the JS/TS version? Check out LangChain.js.
Quick Install
uv add langchain-runloopimport os
from langchain_runloop import RunloopProvider
api_key = os.environ["RUNLOOP_API_KEY"]
provider = RunloopProvider(api_key=api_key)
sandbox = provider.get_or_create()
try:
result = sandbox.execute("echo hello")
print(result.output)
finally:
provider.delete(sandbox_id=sandbox.id)Boot from a named blueprint (create-if-missing, same idea as LangSmith snapshots):
sandbox = provider.get_or_create(snapshot="my-blueprint")Or pin via env: RUNLOOP_SANDBOX_BLUEPRINT_NAME, RUNLOOP_SANDBOX_BLUEPRINT_ID
(ID wins; skips auto-build).
๐ค What is this?
Runloop sandbox integration for Deep Agents.
๐ Releases & Versioning
See our Releases and Versioning policies.
๐ Contributing
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
For detailed information on how to contribute, see the Contributing Guide.
Resources
- LangChain Academy โ Comprehensive, free courses on LangChain libraries and products, made by the LangChain team.
- Code of Conduct โ community guidelines and standards
File: libs/partners/modal/README.md
langchain-modal
Looking for the JS/TS version? Check out LangChain.js.
Quick Install
uv add langchain-modalimport modal
from langchain_modal import ModalSandbox
sandbox = ModalSandbox(modal.Sandbox.create(app=modal.App.lookup("your-app")))
result = sandbox.execute("echo hello")
print(result.output)๐ค What is this?
Modal sandbox integration for Deep Agents.
๐ Releases & Versioning
See our Releases and Versioning policies.
๐ Contributing
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
For detailed information on how to contribute, see the Contributing Guide.
Resources
- LangChain Academy โ Comprehensive, free courses on LangChain libraries and products, made by the LangChain team.
- Code of Conduct โ community guidelines and standards
File: libs/partners/daytona/README.md
langchain-daytona
Looking for the JS/TS version? Check out LangChain.js.
Quick Install
uv add langchain-daytonafrom daytona import Daytona
from langchain_daytona import DaytonaSandbox
sandbox = Daytona().create()
backend = DaytonaSandbox(
sandbox=sandbox,
timeout=300,
sync_polling_interval=0.25,
)
result = backend.execute("echo hello")
print(result.output)๐ค What is this?
Daytona sandbox integration for Deep Agents.
๐ Releases & Versioning
See our Releases and Versioning policies.
๐ Contributing
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
For detailed information on how to contribute, see the Contributing Guide.
Resources
- LangChain Academy โ Comprehensive, free courses on LangChain libraries and products, made by the LangChain team.
- Code of Conduct โ community guidelines and standards
2. Official Technical Reference & Guides (langchain-ai/docs)
LangChain Docs
๐ฆ Welcome! This repository contains the documentation build pipeline for LangChain projects.
- ๐
docs.langchain.comis our docs home, centralizing LangChain, LangGraph, LangSmith, and LangChain Labs (Deep Agents, Open SWE, Open Agent Platform). This site is hosted on Mintlify. - ๐ ๏ธ
reference.langchain.comhosts generated API reference for LangChain, LangGraph, LangSmith, and integration packages. That site is not built from this repository (no reference build scripts or output live here). - ๐ฌ
chat.langchain.comis an AI-powered assistant that can answer questions about LangChain documentation.
Table of contents:
Contribute
To run a local preview of the documentation:
git clone https://github.com/langchain-ai/docs.gitcd docsmake installmake devFor more information on how to contribute to LangChain documentation, follow the steps outlined in the contributing guide. The contributing guide also explains our documentation types and their writing and quality standards.
For detailed information about setting up your development environment and contributing to documentation, see the documentation contributing guide.
To report issues with reference.langchain.com (missing pages, broken links, or generated API content), open a reference documentation issue on this repo so maintainers can route it.
Reference
Repository structure
# --- docs.langchain.com ----------------------------------------------
build/ # Built docs (DO NOT EDIT)
packages.yml # Package metadata (indexes, tables, downloads; not the API reference build)
pipeline/ # Build pipeline source code
scripts/ # Helper scripts
src/ # Source documentation files (< EDIT CONTENT HERE)
langsmith/ # LangSmith docs
oss/ # LangChain, LangGraph, Deep Agents, and integrations docs
docs.json # Mintlify site configuration and navigation
tests/ # Test files for the pipeline
Makefile # Build targets
pyproject.toml # Dependencies`docs.langchain.com`
The Mintlify docs pipeline is structured with .mdx source files in /src and build artifacts in /build. Mintlify deploys from the /build folder, which is generated by preprocessing logic.
[!IMPORTANT]
Never edit/builddirectly.
The /src/docs.json file is used to configure the Mintlify site navigation and settings. Refer to the Mintlify documentation for detailed syntax and component usage.
Documentation changes follow a PR workflow where all tests must pass before merging. See the contributing guidelines for more details.
`reference.langchain.com`
API reference is generated and deployed outside this repo. Browse Python and JavaScript/TypeScript reference there. If something is wrong with that site, use the reference docs issue template.
File formats
- Markdown files (
.md,.mdx) - Standard documentation content - Snippets (
src/snippets/) - Reusable MDX content that can be imported into multiple pages. Important: Snippets undergo special link preprocessing. When writing links in snippets, be careful about path segments. - Jupyter notebooks (
.ipynb) - Converted to markdown during build, though these are not recommended for new content! Your PR will likely be rejected if you attempt to add a Jupyter notebook unless asked to by a maintainer. - Assets - Images and other files are copied to the build directory
Available commands
Make commands:
make dev- Start development mode with file watching and live rebuildmake build- Build documentation to./builddirectorymake broken-links- Check for broken links in documentationmake broken-links-with-anchors- Check for broken links + check links with anchorsmake install- Install all dependenciesmake clean- Remove build artifactsmake test- Run the test suitemake lint- Check code style and formattingmake format- Auto-format codemake lint_md- Lint markdown filesmake lint_md_fix- Lint and fix markdown filesmake help- Show all available commands
docs CLI tool:
The docs command (installed as uv run docs) provides additional functionality:
docs migrate- Convert MkDocs markdown/notebook files to Mintlify format--dry-run- Preview changes without writing files--output- Specify output location (default: in-place)- Supports
.md,.markdown,.ipynbfiles
docs migrate-docusaurus- Convert Docusaurus markdown/notebook files to Mintlify format--dry-run- Preview changes without writing files--output- Specify output location (default: in-place)- Supports
.md,.markdown,.mdx,.ipynbfiles - Converts Docusaurus-specific syntax (admonitions, tabs, imports, etc.)
docs mv <old_path> <new_path>- Move files and update cross-references--dry-run- Preview changes without moving files
These can be used directly using the Makefile or via the docs CLI tool:
docs dev- Start development mode with file watching and hot reload- Automatically rebuilds changed files from
src/tobuild/ - Launches Mintlify dev server at http://localhost:3000
- Provides automatic browser refresh when files change
--skip-build- Skip initial build and use existing build directory
- Automatically rebuilds changed files from
docs build- Build documentation files--watch- Watch for file changes after building
Linting
After running make install, you can use make lint_prose to ensure your writing meets our style guide rules.
Codespell
make lint runs uv run codespell src to check source documentation for common spelling errors.
Codespell is configured in pyproject.toml under [tool.codespell]:
- Add custom accepted words to
src/.codespellignore. This file is referenced byignore-words = "src/.codespellignore". - Exclude generated files, vendor content, or other paths that should not be spell checked by adding glob patterns to the
skipsetting. - Keep skip patterns scoped. Prefer adding accepted words to
src/.codespellignorewhen the word is valid documentation content, and useskipwhen the file or directory should not be checked at all.
You can also follow these steps to enable vale with VS Code or Cursor:
- Install the Vale extension (Vale by Chris Chinchilla)
- Install Vale CLI:
brew install vale(macOS) or see Vale installation for other platforms - Navigate to the Vale extension settings:
- Set
Vale CLI: Configto the absolute path to.vale.ini(in the root of this repo) - Set
Vale CLI: Min Alert Leveltosuggestion(many rules are coded as suggestions)
- Set
If you cannot use the VS Code UI to configure Vale, add these settings to your settings.json:
"vale.valeCLI.config": "/path/to/docs/.vale.ini",
"vale.valeCLI.minAlertLevel": "suggestion"Note: The extension requires Vale on your PATH. If annotations don't appear (e.g., when Cursor is launched from the Dock), launch Cursor from a terminal so it inherits your PATH, or ensure Homebrew is in your shell profile.
Troubleshooting
General Mintlify errors
In some cases, we use new features that are only available in the latest Mintlify CLI. If you encounter errors, ensure you have the latest version installed:
mint update
# or
npm install mint`docs dev` not working / running
Re-do the steps to set up your dev environment, ensuring you have activated the virtual environment and installed all dependencies.
[!IMPORTANT]
Most of the time,mint updatesolves anydocs dev/make devissues!
Mintlify `.venv` parsing error
Problem: Running mint broken-links or other Mintlify commands from the project root causes parsing errors like:
Unable to parse .venv/lib/python3.13/site-packages/soupsieve-2.7.dist-info/licenses/LICENSE.md
- 3:48: Unexpected character '@' (U+0040) in nameRoot Cause: Mintlify tries to parse all files in the directory, including Python virtual environment files that contain invalid MDX syntax.
Solutions (in order of preference):
Use the safe Make commands (recommended):
bashmake broken-links-with-anchors # Builds docs first, then checks internal linksRun Mintlify commands from the build directory:
bashcd build # Change to build directory where final docs are mint broken-links # Now safe to run
Why this works: The solution ensures Mintlify commands run from the build/ directory where the final documentation is generated, which is the correct place to check for broken links. This avoids scanning the Python virtual environment in the project root.
Prevention: Always use the provided Make commands instead of running raw mint commands from the project root.
Warning: page doesn't exist
If adding a new group, ensure the root index.mdx is included in the pages array like:
{
"group": "New group",
"pages": ["new-group/index", "new-group/other-page"]
}If the trailing /index (no extension included) is omitted, the Mintlify parser will raise a warning even though the site will still build.