deepagents-setup-configuration
9
总安装量
9
周安装量
#32658
全站排名
安装命令
npx skills add https://github.com/lubu-labs/langchain-agent-skills --skill deepagents-setup-configuration
Agent 安装分布
opencode
9
gemini-cli
9
github-copilot
9
codex
9
amp
8
kimi-cli
8
Skill 文档
Deep Agents Setup and Configuration
Deep Agents are an agent harness on top of LangChain + LangGraph with built-in planning, filesystem context management, and subagent delegation.
Use This Skill When
- You need a Deep Agent quickly (Python or JavaScript).
- You need subagents, filesystem-backed context, planning (
write_todos), or long-term memory patterns. - You need migration guidance from older
create_react_agentflows. - You need to scaffold a starter project with repository scripts.
- You need to statically validate an
agent.py/agent.js/agent.tsconfig. - You need safety checks before open-sourcing Deep Agents examples/templates.
Tooling In This Skill
scripts/init_deep_agent_project.py: scaffolds Python/JS projects with templates.scripts/validate_deep_agent_config.py: static checks for Deep Agent config quality.references/deep-agents-reference.md: detailed API, middleware, backends, migration, troubleshooting.assets/templates/deep-agent-simple/: minimal Python starter template.assets/examples/basic-deep-agent/: richer Python example.
Recommended Workflow
- Decide if Deep Agents is the right abstraction.
- Scaffold with
init_deep_agent_project.py(Python or JS). - Customize tools, prompt, backend, subagents, and persistence.
- Run
validate_deep_agent_config.py. - Use
references/deep-agents-reference.mdfor advanced configuration. - Run the generated project and verify traces/behavior.
Choose The Right Abstraction
| Need | Deep Agents | LangChain create_agent |
LangGraph |
|---|---|---|---|
| Built-in planning/filesystem/subagents | â Best fit | â ï¸ Manual middleware setup | â Manual graph design |
| Fast path for complex multi-step tasks | â | â ï¸ | â ï¸ |
| Fully custom graph topology | â | â | â Best fit |
| Minimal/simple agent (1-3 steps) | â ï¸ Overhead | â Best fit | â ï¸ |
Initialize A Project
Use repo-local scripts and prefer uv run.
# Python simple template
uv run skills/deepagents-setup-configuration/scripts/init_deep_agent_project.py my-agent --language python --template simple --path skills/
# Python with subagents
uv run skills/deepagents-setup-configuration/scripts/init_deep_agent_project.py my-agent --language python --template with-subagents --path skills/
# Python CLI-config template (memory/checkpointer toggles)
uv run skills/deepagents-setup-configuration/scripts/init_deep_agent_project.py my-agent --language python --template cli-config --path skills/
# JavaScript template
uv run skills/deepagents-setup-configuration/scripts/init_deep_agent_project.py my-agent --language javascript --template simple --path skills/
Templates currently supported by the script:
simplewith-subagentscli-config
Generated outputs include:
agent.pyoragent.jstools/example_tools.pyortools/example_tools.js.env.exampleREADME.md.gitignorepyproject.toml(Python) orpackage.json(JavaScript)
Validate Agent Configuration
Run static validation before shipping examples/templates:
uv run skills/deepagents-setup-configuration/scripts/validate_deep_agent_config.py path/to/agent.py
uv run skills/deepagents-setup-configuration/scripts/validate_deep_agent_config.py path/to/agent.js
uv run skills/deepagents-setup-configuration/scripts/validate_deep_agent_config.py path/to/agent.ts
Validator behavior:
- Errors on missing agent calls or invalid file types.
- Warns on risky/weak configs (missing prompt, odd backend usage, deprecated models).
- Supports dynamic config patterns (
create_deep_agent(**kwargs),createDeepAgent(config)), with warning that some static checks are skipped. - Validates HITL style:
interrupt_on/interruptOnshould be mapping/object, and requires checkpointer.
Current Deep Agents Defaults (Verified)
Default middleware includes:
TodoListMiddlewareFilesystemMiddlewareSubAgentMiddlewareSummarizationMiddlewareAnthropicPromptCachingMiddlewarePatchToolCallsMiddleware
Conditionally added middleware:
MemoryMiddlewarewhenmemoryis setSkillsMiddlewarewhenskillsis setHumanInTheLoopMiddlewarewheninterrupt_on/interruptOnis set
Core Configuration Patterns
agent = create_deep_agent(
model="anthropic:claude-sonnet-4-5-20250929", # string or model object
tools=[...],
system_prompt="...",
subagents=[...], # optional delegation specialists
middleware=[...], # optional custom middleware
store=store, # needed for StoreBackend patterns
backend=backend_factory, # State/Store/Filesystem/Composite
checkpointer=checkpointer # required for HITL interrupts
)
Backend guidance:
StateBackend(default): thread-scoped, ephemeral.StoreBackend: persistent files via LangGraph store (requiresstore=).CompositeBackend: route prefixes (common/memories/->StoreBackend).FilesystemBackend: direct disk access; use carefully, prefervirtual_mode=Truewithroot_dir.
HITL And Persistence
If using human approval interrupts:
- Python: use
interrupt_on={...} - JavaScript: use
interruptOn={...} - Always provide a checkpointer (
InMemorySaver,MemorySaver, Sqlite/Postgres saver, etc.)
Migration Guidance
langgraph.prebuilt.create_react_agentis deprecated in LangGraph v1.- For standard agents, prefer
langchain.agents.create_agent. - For harness capabilities (planning/filesystem/subagents), use
deepagents.create_deep_agent/createDeepAgent.
Versioning Note
deepagentsis currently a pre-1.0 package, so minor-version upgrades may include API changes.- Re-validate generated templates and examples when bumping
deepagentsversions.
Open-Source Safety Checklist
Before publishing this skill:
- Ensure no real secrets are committed (
.env.examplemust stay placeholder-only). - Remove generated artifacts like
__pycache__/and*.pycfrom skill folders. - Avoid absolute local paths in code/examples.
- Keep provider credentials in environment variables only.
- Re-run validator on all shipped
agent.py/agent.jstemplates.
Troubleshooting Quick Hits
- Model/tool-call errors: verify tool-calling model and provider credentials.
- Files not persisting: confirm
StoreBackendroute +store=wiring. - HITL not interrupting: verify interrupt mapping/object and checkpointer.
- Too much overhead for simple tasks: use
create_agentor plain LangGraph.
Resources
references/deep-agents-reference.mdfor detailed API and migration patterns.assets/templates/deep-agent-simple/for minimal template files.assets/examples/basic-deep-agent/for a fuller runnable example.- Python docs: https://docs.langchain.com/oss/python/deepagents/overview
- JavaScript docs: https://docs.langchain.com/oss/javascript/deepagents/overview
- LangGraph v1 migration: https://docs.langchain.com/oss/python/migrate/langgraph-v1