deepagents-typescript-quickstart
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDeep 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 (, research system prompt, invoke with a research question like “What is LangGraph?”). Requires Node 22+.
createDeepAgent请遵循在线文档——不要凭记忆自行创建替代API:
获取该页面内容(通过Docs MCP或HTTP),并实现其中展示的research-agent结构(、研究系统提示词,使用类似“What is LangGraph?”的研究问题调用)。要求Node 22或更高版本。
createDeepAgentLocal setup constraints
本地设置约束
Apply these on top of the quickstart (they keep setup minimal and model-agnostic):
-
Ask which provider/model to use. Showcase that Deep Agents are model-agnostic. Suggested prompt:Which model should this agent use? Pass astring — e.g.
provider:model,openai:gpt-5.5,anthropic:claude-sonnet-5. Default if you're unsure:google-genai:gemini-3.5-flash.anthropic:claude-sonnet-5
We'll use that provider's built-in web search (no separate search API key). -
Create a new directory (e.g.) and do all work there — do not pollute the open project.
deep-agent/ -
Do not use Tavily (or). 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):
@langchain/tavilyProvider Built-in search tool Anthropic @langchain/anthropic(or equivalent dict)tools.webSearch_*()OpenAI { type: "web_search" }Google { google_search: {} }Prefer Anthropic / OpenAI / Google so provider search is available. Only secret: that provider's API key in(gitignored). Skip LangSmith tracing unless they ask..env -
Install packages from the quickstart minus Tavily; add the provider package for their model.
-
Run the research example, show output, then stop. Point to/ customization / Managed Deep Agents for next steps.
deep-agents-core
在快速入门基础上应用以下规则(这些规则可保持设置极简且与模型无关):
-
询问用户要使用的提供商/模型。展示Deep Agents的模型无关性。建议提示词:该代理应使用哪个模型?请传入格式的字符串——例如
provider:model、openai:gpt-5.5、anthropic:claude-sonnet-5。如果不确定,默认值为:google-genai:gemini-3.5-flash。anthropic:claude-sonnet-5
我们将使用该提供商内置的网页搜索功能(无需单独的搜索API密钥)。 -
创建一个新目录(例如),并在该目录中完成所有操作——不要污染现有项目。
deep-agent/ -
请勿使用Tavily(或)。将快速入门指南中的搜索工具替换为所选提供商的内置网页搜索。请查看该提供商LangChain文档中的当前导出/工具结构(以下为撰写时的示例——如有需要请重新核对):
@langchain/tavily提供商 内置搜索工具 Anthropic @langchain/anthropic(或等效字典)tools.webSearch_*()OpenAI { type: "web_search" }Google { google_search: {} }优先选择Anthropic / OpenAI / Google,因为这些提供商支持内置搜索功能。仅需保密的信息是:文件中的提供商API密钥(已添加到git忽略列表)。除非用户要求,否则跳过LangSmith追踪。.env -
安装快速入门指南中的所有包,但排除Tavily;添加所选模型对应的提供商包。
-
运行研究示例,展示输出结果,然后停止。下一步可参考、自定义功能或托管式Deep Agents。
deep-agents-core