ecosystem-primer

GỌI ĐẦU TIÊN cho bất kỳ dự án xây dựng agent LangChain / LangGraph / Deep Agents nào trước khi tham khảo các kỹ năng khác hoặc viết bất kỳ mã agent nào. Bắt buộc bắt đầu…

npx skills add https://github.com/langchain-ai/skills-benchmarks --skill ecosystem-primer
LangChain Inc. maintains three layered open-source tools for building agents, plus LangSmith for observability. The stack, top-down:
  • Deep Agents (top layer, harness) — batteries-included toolkit built on LangChain + LangGraph. Ships with planning, file management, subagent spawning, and memory out of the box.
  • LangGraph (middle layer, runtime) — low-level orchestration for durable execution, custom control flow, and stateful workflows. LangChain agents run on top of LangGraph.
  • LangChain (bottom layer, framework) — abstractions for models, tools, and the agent loop. Provider-agnostic, easiest to start with.
  • LangSmith (cross-cutting) — observability and evaluation platform. Framework-agnostic; always recommended alongside any of the above.

Higher layers depend on lower ones, but you don't need to use lower layers directly. Deep Agents gives you LangGraph's durable execution without writing graph code. LangChain gives you models and tools without managing graph edges.


Step 1 — Choose Your Tool

Evaluate these conditions in order and stop at the first match:

  1. If the task needs planning, file management across a long session, persistent memory, subagent delegation, or on-demand skills → Deep Agents
  2. Else, if the task needs custom control flow (deterministic loops, branching logic) → LangGraph
  3. Else, if it's a single-purpose agent with a fixed set of tools → LangChain (create_agent function)
  4. Else, if it's a pure model call, retrieval pipeline, or simple prompt chain with no agent loop → LangChain (direct model / chain)

This is your layer. BUT you are not done: later in Step 4, you MUST load the layer-specific skill before writing any agent code.


Tool Profiles

LangChain — agent framework

Best for:

  • Single-purpose agents with a fixed tool set
  • RAG pipelines and document Q&A
  • Model calls, prompt templates, structured output

Not ideal when:

  • The agent needs to plan across many steps or manage large context
  • Control flow is conditional, iterative, or parallel
  • State must persist across sessions

All LangChain agents use create_agent(model, tools=[...]).

LangGraph — agent runtime

Best for:

  • Custom control flow — deterministic loops, reflection cycles, parallel fan-out
  • Complex workflows combining deterministic and agentic steps
  • Human-in-the-loop with precise interrupt and resume points
  • State that must survive failures or span long sessions

Not ideal when:

  • You want planning, file management, and subagent delegation out of the box (use Deep Agents instead)
  • The workflow is simple enough for a straight tool loop

All LangGraph graphs use StateGraph(State) with explicit nodes, edges, and conditional edges.

Deep Agents — agent harness

Best for:

  • Long-running tasks that require planning and decomposition
  • Agents that read, write, and manage files across a session
  • Delegating subtasks to specialized subagents
  • Persistent memory across sessions
  • Loading domain-specific skills on demand

Not ideal when:

  • The task is simple enough for a single-purpose agent
  • You need precise hand-crafted control over every graph edge (use LangGraph directly)

All Deep Agents use create_deep_agent(model, tools=[...]).


Mixing Layers

The tools are layered, so they can be combined in the same project. Common patterns:

  • Deep Agents orchestrator → LangGraph subagent — when the main agent needs planning and memory but one subtask requires a deterministic graph.
  • LangGraph graph wrapped as a tool or subagent — when a specialized pipeline (e.g. RAG, reflection loop) is called by a broader agent.

A compiled LangGraph graph can be registered as a named subagent inside Deep Agents — the orchestrator delegates to it via the task tool without knowing its internal structure. LangChain tools and retrievers work freely inside both LangGraph nodes and Deep Agents tools.


Step 2 — Set Environment Variables

Always set these for observability. These are the current LangSmith env var names. Copy them as-is. OLDER NAMES NO LONGER WORK.

LANGSMITH_API_KEY= LANGSMITH_TRACING=true LANGSMITH_PROJECT=

Model-provider and tool-specific keys (ANTHROPIC_API_KEY, OPENAI_API_KEY, TAVILY_API_KEY, etc.) depend on your stack — set them as needed.


Step 3 — How the Docs Work

All documentation lives at docs.langchain.com, organized into two top-level sections:

  • OSS — LangChain, LangGraph, Deep Agents. Python (/oss/python/) and TypeScript (/oss/javascript/) trees in parallel.
  • LangSmith — observability, evaluation, deployment, prompt engineering.

Each product has its own page tree: overview → quickstart → how-to guides → reference.

Canonical landing pages

Start here rather than tree-searching from root (swap pythonjavascript for TypeScript):

  • LangChain/oss/python/langchain/overview
  • LangGraph/oss/python/langgraph/overview
  • Deep Agents/oss/python/deepagents/overview
  • LangSmith/langsmith/home (no language split)

Accessing docs in an agent context

If the LangChain Docs MCP server is connected (mcp__docs-langchain__* tools are available), query it directly:

tree /oss/python -L 2                        # explore Python structure
tree /oss/javascript -L 2                    # parallel TypeScript structure
cat /oss/python/langchain/quickstart.mdx     # read a specific page
rg -il "checkpointer" /oss/python/langgraph/ # search by keyword

If the MCP server is not available, use the llms.txt index:

  1. Fetch https://docs.langchain.com/llms.txt — structured list of all pages with descriptions
  2. Identify the 2–4 most relevant pages for the question
  3. Fetch those pages directly for accurate, up-to-date content

Always prefer fetching live docs over relying on training-data knowledge — these libraries evolve fast and APIs change often.


Step 4 — Load the Right Skill Next

Now load the skill below that matches your layer from Step 1. This is required — the layer-specific skill carries the current API; the primer alone does not.

LangChain

  • langchain-fundamentals — building any LangChain agent
  • langchain-rag — adding RAG / vector store retrieval
  • langchain-middleware — structured output with Pydantic
  • langchain-dependencies — package versions, installs, or dependency management questions

LangGraph

  • langgraph-fundamentals — any LangGraph graph
  • langgraph-human-in-the-loop — human-in-the-loop or approval workflows
  • langgraph-persistence — state that must survive restarts, or cross-thread memory

Deep Agents

Always load deep-agents-core first. Then, as needed:

  • deep-agents-orchestration — subagent delegation or orchestration
  • deep-agents-memory — cross-session persistent memory

Thêm skills từ langchain-ai

langgraph-docs
langchain-ai
Truy cập tài liệu LangGraph để xây dựng tác nhân có trạng thái và quy trình làm việc đa tác nhân. Lấy tài liệu Python chính thức của LangGraph bao gồm máy trạng thái, thiết kế tác nhân dựa trên đồ thị và các mẫu có sự can thiệp của con người. Ưu tiên tài liệu phù hợp theo loại truy vấn: hướng dẫn triển khai cho câu hỏi cách làm, trang khái niệm cho lý thuyết, hướng dẫn cho ví dụ từ đầu đến cuối và tham chiếu API cho chi tiết kỹ thuật. Tự động chọn 2–4 URL tài liệu phù hợp nhất và truy xuất nội dung của chúng để trả lời...
official
langgraph-human-in-the-loop
langchain-ai
Tạm dừng thực thi đồ thị để con người xem xét, phê duyệt hoặc xác thực, sau đó tiếp tục với đầu vào của họ. Yêu cầu ba thành phần: một bộ kiểm tra điểm dừng (InMemorySaver hoặc PostgresSaver), một ID luồng trong cấu hình và tải trọng ngắt có thể tuần tự hóa JSON. interrupt(value) tạm dừng và hiển thị dữ liệu; Command(resume=value) tiếp tục và trả về giá trị đó cho nút đã tạm dừng. Tất cả mã trước interrupt() sẽ thực thi lại khi tiếp tục, vì vậy các tác dụng phụ phải có tính chất đơn giản (sử dụng upsert, không phải insert). Hỗ trợ quy trình phê duyệt,...
official
web-research
langchain-ai
Sử dụng kỹ năng này cho các yêu cầu liên quan đến nghiên cứu web; nó cung cấp một cách tiếp cận có cấu trúc để thực hiện nghiên cứu web toàn diện
official
langchain-oss-primer
langchain-ai
LUÔN BẮT ĐẦU TỪ ĐÂY cho bất kỳ dự án xây dựng agent LangChain, Deep Agents hoặc LangGraph nào. Điểm khởi đầu bắt buộc trước khi chọn các kỹ năng khác hoặc viết bất kỳ…
official
skill-creator
langchain-ai
Hướng dẫn tạo kỹ năng hiệu quả để mở rộng khả năng của tác nhân với kiến thức chuyên môn, quy trình làm việc hoặc tích hợp công cụ. Sử dụng kỹ năng này khi người dùng…
official
social-media
langchain-ai
Soạn thảo bài đăng mạng xã hội theo từng nền tảng với nội dung dựa trên nghiên cứu và hình ảnh đồng hành được tạo tự động. Hỗ trợ bài đăng LinkedIn (1.300 ký tự với giọng văn chuyên nghiệp) và chuỗi Twitter/X (280 ký tự mỗi tweet theo định dạng 1/🧵). Yêu cầu ủy quyền nghiên cứu cho một trợ lý phụ trước khi viết, sau đó đọc lại kết quả để đảm bảo độ chính xác và phù hợp. Tự động tạo hình ảnh mạng xã hội bắt mắt bằng công cụ generate_social_image với bố cục đậm, tương phản cao, tối ưu cho kích thước nhỏ...
official
deep-agents-memory
langchain-ai
Các backend bộ nhớ và tệp có thể cắm cho Deep Agents với các tùy chọn định tuyến tạm thời, bền vững và kết hợp. Bốn loại backend: StateBackend (theo luồng, tạm thời), StoreBackend (bền vững xuyên phiên), FilesystemBackend (truy cập đĩa thực cho phát triển cục bộ) và CompositeBackend (định tuyến các đường dẫn khác nhau đến các backend khác nhau). FilesystemMiddleware cung cấp sáu công cụ thao tác tệp: ls, read_file, write_file, edit_file, glob, grep. CompositeBackend sử dụng so khớp tiền tố dài nhất để định tuyến...
official
deep-agents-orchestration
langchain-ai
Điều phối các tác nhân phụ, lập kế hoạch tác vụ đa bước và yêu cầu phê duyệt của con người cho các thao tác nhạy cảm. Ủy quyền công việc cho các tác nhân phụ chuyên biệt thông qua công cụ tác vụ; các tác nhân phụ tùy chỉnh hỗ trợ bộ công cụ và lời nhắc hệ thống riêng biệt, trong khi tác nhân phụ "đa năng" mặc định kế thừa cấu hình của tác nhân chính. Lập kế hoạch và theo dõi các quy trình phức tạp với write_todos, sắp xếp tác vụ qua các trạng thái đang chờ, đang tiến hành và đã hoàn thành; yêu c
official