deepagents-typescript-quickstart

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Deep Agents TypeScript quickstart

Deep Agents TypeScript 快速入门

Follow the live docs — do not invent an alternate API from memory:
Fetch that page (Docs MCP or HTTP) and implement the research-agent shape it shows (
createDeepAgent
, research system prompt, invoke with a research question like “What is LangGraph?”). Requires Node 22+.
请遵循在线文档——不要凭记忆自行创建替代API:
获取该页面内容(通过Docs MCP或HTTP),并实现其中展示的research-agent结构(
createDeepAgent
、研究系统提示词,使用类似“What is LangGraph?”的研究问题调用)。要求Node 22或更高版本。

Local setup constraints

本地设置约束

Apply these on top of the quickstart (they keep setup minimal and model-agnostic):
  1. Ask which provider/model to use. Showcase that Deep Agents are model-agnostic. Suggested prompt:
    Which model should this agent use? Pass a
    provider:model
    string — e.g.
    openai:gpt-5.5
    ,
    anthropic:claude-sonnet-5
    ,
    google-genai:gemini-3.5-flash
    . Default if you're unsure:
    anthropic:claude-sonnet-5
    .
    We'll use that provider's built-in web search (no separate search API key).
  2. Create a new directory (e.g.
    deep-agent/
    ) and do all work there — do not pollute the open project.
  3. Do not use Tavily (or
    @langchain/tavily
    ). Replace the quickstart's search tool with the chosen provider's built-in web search. Look up the current export/tool shape on that provider's LangChain docs (examples as of writing — re-check if needed):
    ProviderBuilt-in search tool
    Anthropic
    @langchain/anthropic
    tools.webSearch_*()
    (or equivalent dict)
    OpenAI
    { type: "web_search" }
    Google
    { google_search: {} }
    Prefer Anthropic / OpenAI / Google so provider search is available. Only secret: that provider's API key in
    .env
    (gitignored). Skip LangSmith tracing unless they ask.
  4. Install packages from the quickstart minus Tavily; add the provider package for their model.
  5. Run the research example, show output, then stop. Point to
    deep-agents-core
    / customization / Managed Deep Agents for next steps.
在快速入门基础上应用以下规则(这些规则可保持设置极简且与模型无关):
  1. 询问用户要使用的提供商/模型。展示Deep Agents的模型无关性。建议提示词:
    该代理应使用哪个模型?请传入
    provider:model
    格式的字符串——例如
    openai:gpt-5.5
    anthropic:claude-sonnet-5
    google-genai:gemini-3.5-flash
    。如果不确定,默认值为:
    anthropic:claude-sonnet-5

    我们将使用该提供商内置的网页搜索功能(无需单独的搜索API密钥)。
  2. 创建一个目录(例如
    deep-agent/
    ),并在该目录中完成所有操作——不要污染现有项目。
  3. 请勿使用Tavily(或
    @langchain/tavily
    )。将快速入门指南中的搜索工具替换为所选提供商的内置网页搜索。请查看该提供商LangChain文档中的当前导出/工具结构(以下为撰写时的示例——如有需要请重新核对):
    提供商内置搜索工具
    Anthropic
    @langchain/anthropic
    tools.webSearch_*()
    (或等效字典)
    OpenAI
    { type: "web_search" }
    Google
    { google_search: {} }
    优先选择Anthropic / OpenAI / Google,因为这些提供商支持内置搜索功能。仅需保密的信息是:
    .env
    文件中的提供商API密钥(已添加到git忽略列表)。除非用户要求,否则跳过LangSmith追踪。
  4. 安装快速入门指南中的所有包,但排除Tavily;添加所选模型对应的提供商包。
  5. 运行研究示例,展示输出结果,然后停止。下一步可参考
    deep-agents-core
    、自定义功能或托管式Deep Agents。