deep-agents

โดย langchain-ai

สร้างเอเจนต์ที่ครบครันด้วยการวางแผน การจัดการบริบท การมอบหมายงานให้เอเจนต์ย่อย และการทำงานในสภาพแวดล้อมที่ปลอดภัย ใช้สำหรับงานที่ซับซ้อนและมีหลายขั้นตอนซึ่งต้องการ...

npx skills add https://github.com/langchain-ai/docs --skill deep-agents

Deep Agents

Deep Agents is the easiest way to start building agents powered by LLMs—with built-in capabilities for task planning, file systems for context management, subagent delegation, and long-term memory. It is an "agent harness" built on LangChain core building blocks and the LangGraph runtime.

When to use

Use Deep Agents when you need to:

  • Build agents fast with sensible defaults and minimal configuration
  • Handle complex, multi-step tasks that benefit from automatic planning
  • Manage context with a built-in virtual filesystem for large inputs
  • Delegate subtasks to specialized subagents
  • Run code safely in sandboxed execution environments
  • Use a terminal agent via Deep Agents Code

When NOT to use

  • For simple tool-calling agents without planning or subagents, use LangChain agents instead—lighter weight
  • For custom graph-based orchestration with explicit control flow, use LangGraph directly
  • Deep Agents is the highest-level abstraction—it trades flexibility for convenience

Install

# Python
pip install deepagents

# JavaScript/TypeScript
npm install deepagents langchain @langchain/core

Quick reference

Create a deep agent

# pip install deepagents langchain-anthropic
from deepagents import create_deep_agent

def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"It's always sunny in {city}!"

agent = create_deep_agent(
    model="anthropic:claude-sonnet-4-6",
    tools=[get_weather],
    system_prompt="You are a helpful assistant",
)

result = agent.invoke(
    {"messages": [{"role": "user", "content": "What is the weather in SF?"}]}
)

Use Deep Agents Code

# Install Deep Agents Code
pip install deepagents-code

# Run an interactive terminal agent
deepagents

Built-in capabilities

CapabilityDescription
PlanningAutomatic task decomposition for complex requests
File systemVirtual filesystem for reading, writing, and managing context
SubagentsSpawn child agents for parallel subtask execution
Context managementAutomatic context compression for long conversations
Sandboxed executionRun code in isolated environments (Modal, Runloop, Daytona)
ProtocolsACP, MCP, and A2A support for interoperability

Key documentation

  • Overview—What Deep Agents is and how it compares to LangChain and LangGraph
  • Quickstart—Build your first deep agent
  • Customization—Configure models, tools, and behavior
  • Context engineering—Manage context for complex tasks
  • Subagents—Delegate work to child agents
  • Sandboxes—Run code in isolated environments
  • Code—Deep Agents Code, the terminal agent interface
  • Deploy—Deploy to production

API reference

For SDK class and method details, use the LangChain API Reference site:

  • MCP server: https://reference.langchain.com/mcp

Related skills

  • langchain—Core building blocks that Deep Agents is built on
  • langgraph—Runtime that powers Deep Agents' durable execution
  • langsmith—Trace, evaluate, and deploy your deep agents

Skills เพิ่มเติมจาก langchain-ai

langgraph-docs
langchain-ai
เข้าถึงเอกสาร LangGraph เพื่อสร้างเอเจนต์ที่มีสถานะและเวิร์กโฟลว์แบบหลายเอเจนต์ ดึงข้อมูลเอกสาร Python อย่างเป็นทางการของ LangGraph ซึ่งครอบคลุมเครื่องจักรสถานะ การออกแบบเอเจนต์แบบกราฟ และรูปแบบมนุษย์ในวงจร จัดลำดับความสำคัญของเอกสารที่เกี่ยวข้องตามประเภทคำถาม: คู่มือการใช้งานสำหรับคำถามวิธีทำ หน้าคอนเซปต์สำหรับทฤษฎี บทช่วยสอนสำหรับตัวอย่างแบบครบวงจร และเอกสารอ้างอิง API สำหรับรายละเอียดทางเทคนิค เลือก URL เอกสารที่เกี่ยวข้องมากที่สุด 2–4 รายการโดยอัตโนมัติและดึงเนื้อหามาเพื่อตอบ...
official
langgraph-human-in-the-loop
langchain-ai
หยุดการทำงานของกราฟเพื่อให้มนุษย์ตรวจสอบ อนุมัติ หรือตรวจสอบความถูกต้อง จากนั้นดำเนินการต่อด้วยข้อมูลที่มนุษย์ป้อนเข้าไป ต้องมีสามองค์ประกอบ: ตัวตรวจสอบจุด (InMemorySaver หรือ PostgresSaver), ID เธรดใน config, และเพย์โหลดขัดจังหวะที่แปลงเป็น JSON ได้ interrupt(value) จะหยุดและแสดงข้อมูล; Command(resume=value) จะดำเนินการต่อและส่งคืนค่านั้นไปยังโหนดที่ถูกหยุด โค้ดทั้งหมดก่อน interrupt() จะถูกเรียกใช้ใหม่เมื่อดำเนินการต่อ ดังนั้นผลข้างเคียงต้องเป็น idempotent (ใช้ upsert ไม่ใช่ insert) รองรับเวิร์กโฟลว์การอนุมัติ...
official
web-research
langchain-ai
ใช้ทักษะนี้สำหรับคำขอที่เกี่ยวข้องกับการค้นคว้าทางเว็บ โดยมีแนวทางที่มีโครงสร้างเพื่อดำเนินการค้นคว้าทางเว็บอย่างครอบคลุม
official
langchain-oss-primer
langchain-ai
เริ่มต้นที่นี่เสมอสำหรับโปรเจกต์สร้างเอเจนต์ LangChain, Deep Agents หรือ LangGraph ใดๆ จุดเริ่มต้นที่จำเป็นก่อนเลือกสกิลอื่นหรือเขียนอะไรก็ตาม…
official
skill-creator
langchain-ai
คู่มือสำหรับสร้างสกิลที่มีประสิทธิภาพเพื่อขยายความสามารถของเอเจนต์ด้วยความรู้เฉพาะทาง เวิร์กโฟลว์ หรือการรวมเครื่องมือ ใช้สกิลนี้เมื่อผู้ใช้…
official
social-media
langchain-ai
ร่างโพสต์โซเชียลมีเดียเฉพาะแพลตฟอร์มพร้อมเนื้อหาที่มีงานวิจัยรองรับและภาพประกอบที่สร้างขึ้น รองรับโพสต์ LinkedIn (1,300 ตัวอักษรด้วยน้ำเสียงมืออาชีพ) และเธรด Twitter/X (280 ตัวอักษรต่อทวีตในรูปแบบ 1/🧵) ต้องมอบหมายการวิจัยให้กับซับเอเจนต์ก่อนเขียน จากนั้นอ่านผลลัพธ์เพื่อให้แน่ใจว่าถูกต้องและเกี่ยวข้อง สร้างภาพโซเชียลที่สะดุดตาโดยอัตโนมัติโดยใช้เครื่องมือ generate_social_image ด้วยองค์ประกอบที่โดดเด่นและคอนทราสต์สูงซึ่งปรับให้เหมาะสมสำหรับขนาดเล็ก...
official
deep-agents-memory
langchain-ai
ปลั๊กอินหน่วยความจำและแบ็กเอนด์ไฟล์สำหรับ Deep Agents พร้อมตัวเลือกการกำหนดเส้นทางแบบชั่วคราว ถาวร และแบบผสม แบ็กเอนด์สี่ประเภท: StateBackend (ขอบเขตเธรด, ชั่วคราว), StoreBackend (คงอยู่ข้ามเซสชัน), FilesystemBackend (เข้าถึงดิสก์จริงสำหรับการพัฒนาในเครื่อง) และ CompositeBackend (กำหนดเส้นทางพาธที่แตกต่างไปยังแบ็กเอนด์ที่แตกต่างกัน) FilesystemMiddleware มีเครื่องมือปฏิบัติการไฟล์หกอย่าง: ls, read_file, write_file, edit_file, glob, grep CompositeBackend ใช้การจับคู่คำนำหน้าที่ยาวที่สุดเพื่อกำหนดเส้นทาง...
official
deep-agents-orchestration
langchain-ai
จัดระเบียบเอเจนต์ย่อย วางแผนงานหลายขั้นตอน และต้องได้รับการอนุมัติจากมนุษย์สำหรับการดำเนินการที่ละเอียดอ่อน มอบหมายงานให้กับเอเจนต์ย่อยเฉพาะทางผ่านเครื่องมืองาน เอเจนต์ย่อยแบบกำหนดเองรองรับชุดเครื่องมือและพรอมต์ระบบที่แยกออกจากกัน ในขณะที่เอเจนต์ย่อย "วัตถุประสงค์ทั่วไป" เริ่มต้นจะสืบทอดการกำหนดค่าเอเจนต์หลัก วางแผนและติดตามเวิร์กโฟลว์ที่ซับซ้อนด้วย write_todos โดยจัดระเบียบงานในสถานะรอดำเนินการ กำลังดำเนินการ และเสร็จสมบูรณ์ ต้องใช้ thread_id เพื่อความต่อเนื่องในการเรียกใช้หลายครั้ง ดำเนินการ...
official