{"id":152,"library":"deepagents","title":"Deep Agents (deepagents)","description":"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.","status":"active","version":"0.4.12","language":"python","source_language":"en","source_url":"https://github.com/langchain-ai/deepagents","tags":["deepagents","langchain","langgraph","agents","python","planning","filesystem"],"install":[{"cmd":"pip install deepagents","lang":"bash","label":"Python (SDK)"},{"cmd":"pip install deepagents langchain-openai","lang":"bash","label":"Python (SDK + OpenAI)"}],"dependencies":[{"reason":"Required. deepagents is built on LangChain/LangGraph.","package":"langchain-core","optional":false},{"reason":"Required. create_deep_agent returns a compiled LangGraph StateGraph.","package":"langgraph","optional":false},{"reason":"Required for default model (Claude Sonnet). Install if not using custom model.","package":"langchain-anthropic","optional":true}],"imports":[{"note":"create_deep_agent returns a compiled LangGraph graph. invoke() takes a dict with 'messages' key, not a plain string. Response is also a dict — access result['messages'][-1].content for final answer.","wrong":"from deepagents import create_deep_agent\n\nagent = create_deep_agent()\nresult = agent.invoke('Research LangGraph')  # wrong — not a plain string","symbol":"create_deep_agent","correct":"from deepagents import create_deep_agent\nfrom langchain.chat_models import init_chat_model\n\n# Custom model\nmodel = init_chat_model('openai:gpt-4o')\nagent = create_deep_agent(\n    model=model,\n    tools=[],\n    system_prompt='You are a research assistant.'\n)\n\n# invoke with messages dict — not plain string\nresult = agent.invoke({\n    'messages': [{'role': 'user', 'content': 'Research LangGraph'}]\n})\nprint(result['messages'][-1].content)"}],"quickstart":{"code":"# pip install deepagents langchain-openai\nfrom deepagents import create_deep_agent\nfrom langchain.chat_models import init_chat_model\n\nmodel = init_chat_model('openai:gpt-4o')\n\nagent = create_deep_agent(\n    model=model,\n    system_prompt='You are a helpful research assistant.'\n)\n\nresult = agent.invoke({\n    'messages': [{\n        'role': 'user',\n        'content': 'Write a short summary of what LangGraph is'\n    }]\n})\n\nprint(result['messages'][-1].content)","lang":"python","description":"Minimal deepagents agent with OpenAI model."},"warnings":[{"fix":"Pass model= explicitly: create_deep_agent(model=init_chat_model('openai:gpt-4o')) to use OpenAI.","message":"Default model is Claude Sonnet (anthropic), not GPT-4o. Requires ANTHROPIC_API_KEY if no custom model passed. Fails with AuthenticationError if key not set.","severity":"gotcha","affected_versions":"all"},{"fix":"agent.invoke({'messages': [{'role': 'user', 'content': 'your prompt'}]})","message":"create_deep_agent returns a compiled LangGraph StateGraph — not a plain callable. Must invoke with {'messages': [...]} dict, not a plain string.","severity":"gotcha","affected_versions":"all"},{"fix":"result['messages'][-1].content for text output. result.get('files', {}) for any files created.","message":"Result is a dict, not a string. Final answer is at result['messages'][-1].content. Agent may also create files accessible at result['files'].","severity":"gotcha","affected_versions":"all"},{"fix":"Use agent.stream() for streaming. Pass checkpointer= for persistence. Set LANGSMITH_TRACING=true for tracing.","message":"Because it returns a LangGraph graph, it supports streaming, checkpointers, human-in-the-loop, and LangSmith tracing natively — but requires LangGraph-style usage patterns.","severity":"gotcha","affected_versions":"all"},{"fix":"Always use create_deep_agent() from deepagents — not langchain's create_react_agent or create_tool_calling_agent.","message":"LLMs trained before mid-2025 have no knowledge of deepagents. Will hallucinate LangChain agent patterns or generic ReAct agents instead.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade your Python environment to 3.11 or newer to install `deepagents`.","message":"The `deepagents` library requires Python 3.11 or higher. Installation will fail with a 'No matching distribution found' error on older Python versions.","severity":"breaking","affected_versions":"all"},{"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')`).","message":"When 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.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-12T09:00:54.469Z","next_check":"2026-06-24T00:00:00.000Z","problems":[{"fix":"Ensure the model passed to `create_deep_agent` is a `BaseChatModel` or a string. If using fallbacks, you may need to wrap `RunnableWithFallbacks` in a custom `BaseChatModel` implementation or pass a string identifier for the primary model and handle fallbacks externally, or extend the `resolve_model` logic to explicitly handle `RunnableWithFallbacks`.","cause":"The `create_deep_agent` function, in version 0.4.12, expects the `model` parameter to be either a string identifier or an instance of `BaseChatModel`, but `RunnableWithFallbacks` (used for model fallbacks in LangChain) does not directly inherit from `BaseChatModel`, causing a string-specific check to fail.","error":"AttributeError: 'RunnableWithFallbacks' object has no attribute 'startswith'"},{"fix":"Update your `deepagents-cli` installation to the latest version. If the error persists with example code, check the official `deepagents` GitHub repository for the most current examples and their corresponding execution methods, as the `deepagents_cli.execution` module might no longer exist or be exposed directly.","cause":"This error typically occurs when running older example scripts that rely on an internal or deprecated module path within the `deepagents-cli` package, which has likely been refactored or removed in newer versions.","error":"ModuleNotFoundError: No module named 'deepagents_cli.execution'"},{"fix":"Review your tool and subagent registration code to ensure that each communication channel has a unique name. Implement checks to prevent re-registering channels or utilize namespacing for tools and subagents to avoid conflicts, especially when sharing tools between subagents.","cause":"This error indicates that a communication channel, specifically named 'file', is being registered more than once with differing types, often due to duplicate tool or subagent initializations or registrations without proper namespacing.","error":"channel name 'file' already exists"},{"fix":"Ensure that the `allowed-tools` entry in your `SKILL.md` files is a single string with tool names separated by spaces, rather than a YAML list. For example, use `allowed-tools: tool1 tool2` instead of `allowed-tools: [tool1, tool2]`.","cause":"This error occurs within the `_parse_skill_metadata` function when the `allowed-tools` field in a `SKILL.md` file is provided as a list instead of an expected space-separated string.","error":"AttributeError: 'list' object has no attribute 'split'"},{"fix":"Consult the official `deepagents` documentation or API reference for the correct import path and name of the subagent compilation utility. If `CompiledSubAgents` has been removed or replaced, adapt your code to use the recommended alternative for compiling subagents, which might involve a different class or function from a more specific submodule.","cause":"This error suggests that the `CompiledSubAgents` class, or a similar component, is either no longer exported directly from the top-level `deepagents` package, has been renamed, or its import path has changed in a later version of the library.","error":"ImportError: cannot import name 'CompiledSubAgents' from 'deepagents'"}],"ecosystem":"pypi","meta_description":null,"install_score":75,"install_tag":"reviewed","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"reviewed","tag_description":"minor failures on some runtimes or slightly older test data","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.39,"mem_mb":47.1,"disk_size":"117.3M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.39,"mem_mb":47.1,"disk_size":"139.5M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.55,"mem_mb":47.1,"disk_size":"125M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.59,"mem_mb":47.1,"disk_size":"147M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.89,"mem_mb":46.1,"disk_size":"107.3M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.89,"mem_mb":46.1,"disk_size":"129.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.91,"mem_mb":46.1,"disk_size":"115M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.89,"mem_mb":46.1,"disk_size":"137M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.47,"mem_mb":47.7,"disk_size":"107.0M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.48,"mem_mb":47.7,"disk_size":"128.9M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.56,"mem_mb":47.7,"disk_size":"114M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.67,"mem_mb":47.7,"disk_size":"137M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}