Registry / llm-agents / deepagents

deepagents

JSON →
library0.7.9pypypi✓ verified 27d ago

Agent harness by LangChain built on LangGraph. Implements planning (write_todos tool), filesystem backends, and subagent delegation — the architecture behind Claude Code, Manus, and Deep Research. Returns a compiled LangGraph StateGraph. Released mid-2025. Current version: 0.4.12 (Mar 2026). Default model is Claude Sonnet (not GPT-4o). Requires LangChain core libraries.

pip install deepagents
INSTALL
IMPORT
SIG · DEEPAGENTS
D
deepagents
llm-agentspythonv0.7.9
Install
14.1s avg
Import
9128ms
Disk
167MB
Pass rate
6/ 10
Env Coverage6 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✕ build_error
py 3.11
✓ —
✓ 15.75s
py 3.12
✓ —
✓ 13.3s
py 3.13
✓ —
✓ 13.3s
py 3.9
✕ build_error
✕ build_error
167MB installed
● package 167MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

create_deep_agent
from deepagents import create_deep_agent
from deepagents import create_deep_agent
init_chat_model
from langchain.chat_models import init_chat_model
from langchain.chat_models import init_chat_model

Minimal deepagents agent with OpenAI model.

# pip install deepagents langchain-openai from deepagents import create_deep_agent from langchain.chat_models import init_chat_model model = init_chat_model('openai:gpt-4o') agent = create_deep_agent( model=model, system_prompt='You are a helpful research assistant.' ) result = agent.invoke({ 'messages': [{ 'role': 'user', 'content': 'Write a short summary of what LangGraph is' }] }) print(result['messages'][-1].content)
Debug
Known issues
gotchaDefault model is Claude Sonnet (anthropic), not GPT-4o. Requires ANTHROPIC_API_KEY if no custom model passed. Fails with AuthenticationError if key not set.
fix
Pass model= explicitly: create_deep_agent(model=init_chat_model('openai:gpt-4o')) to use OpenAI.
affects: all
gotchacreate_deep_agent returns a compiled LangGraph StateGraph — not a plain callable. Must invoke with {'messages': [...]} dict, not a plain string.
fix
agent.invoke({'messages': [{'role': 'user', 'content': 'your prompt'}]})
affects: all
gotchaResult is a dict, not a string. Final answer is at result['messages'][-1].content. Agent may also create files accessible at result['files'].
fix
result['messages'][-1].content for text output. result.get('files', {}) for any files created.
affects: all
gotchaBecause it returns a LangGraph graph, it supports streaming, checkpointers, human-in-the-loop, and LangSmith tracing natively — but requires LangGraph-style usage patterns.
fix
Use agent.stream() for streaming. Pass checkpointer= for persistence. Set LANGSMITH_TRACING=true for tracing.
affects: all
gotchaLLMs trained before mid-2025 have no knowledge of deepagents. Will hallucinate LangChain agent patterns or generic ReAct agents instead.
fix
Always use create_deep_agent() from deepagents — not langchain's create_react_agent or create_tool_calling_agent.
affects: all
breakingThe `deepagents` library requires Python 3.11 or higher. Installation will fail with a 'No matching distribution found' error on older Python versions.
fix
Upgrade your Python environment to 3.11 or newer to install `deepagents`.
affects: all
breakingWhen using OpenAI models (e.g., 'openai:gpt-4o'), the OPENAI_API_KEY environment variable or `api_key` parameter must be set. Fails with openai.OpenAIError if not provided.
fix
Set the OPENAI_API_KEY environment variable or pass `api_key` to `init_chat_model` (e.g., `init_chat_model('openai:gpt-4o', api_key='your_key')`).
affects: all
Upgrade
Version history
0.7.9latest on PyPI · released Aug 25, 2026
Audit
Dependencies
langchain-corerequiredRequired. deepagents is built on LangChain/LangGraph.
langgraphrequiredRequired. create_deep_agent returns a compiled LangGraph StateGraph.
langchain-anthropicoptionalRequired for default model (Claude Sonnet). Install if not using custom model.
Agent activity
46 hits · last 30 days
node
36
Amazon
1
Bingbot
1
OpenAI (training)
1
Resources
deepagents — pip install deepagents · libregistry