Build a multi-step web research agent with subagent delegation using Managed Deep Agents or the Deep Agents SDK
Overview
This guide shows how to build a multi-step web research agent with Deep Agents. The agent decomposes research questions into focused tasks, delegates them to specialized sub-agents, and synthesizes findings into a comprehensive report.The agent you build will:
Plan research using the opt-in todo list middleware
Delegate focused research tasks to sub-agents with isolated context
Assess search results and plan next steps as you gather information
Synthesize findings with proper citations into a final report
The spawned sub-agents conduct web searches with Tavily, fetching full webpage content for analysis.
Tavily for web search (optional; free tier is sufficient)
LangSmith for tracing (optional if you are using the SDK; required for Managed Deep Agents)
Choose your path
This guide shows how to build this agent with Managed Deep Agents and the Deep Agents SDK. Managed Deep Agents lets you deploy agents without having to manage infrastructure. The Deep Agents SDK, lets you have maximum flexibility while using the same Deep Agents harness and you can host agents yourself, or run a custom Agent Server.
Do not commit the .env file into version control. It contains secrets.
3
Install search dependencies
No extra packages are required for the search tool in this tutorial. It uses the built-in fetch API and the Tavily HTTP endpoint.
Build the agent
1
Add tools
Create a custom search tool. The tavily_search tool uses Tavily for URL discovery, then fetches full webpage content so the agent can analyze complete sources instead of summaries.Create tools/search.ts:
tools/search.ts
import { tool } from "langchain";import { z } from "zod";async function fetchWebpageContent( url: string, timeout = 10_000,): Promise<string> { try { const controller = new AbortController(); const id = setTimeout(() => controller.abort(), timeout); const response = await fetch(url, { headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36", }, signal: controller.signal, }); clearTimeout(id); if (!response.ok) { return `Error fetching ${url}: HTTP ${response.status}`; } return await response.text(); } catch (e) { return `Error fetching ${url}: ${e}`; }}export const tavilySearch = tool( async ({ query, maxResults = 1, topic = "general", }: { query: string; maxResults?: number; topic?: "general" | "news" | "finance"; }) => { const response = await fetch("https://api.tavily.com/search", { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${process.env.TAVILY_API_KEY}`, }, body: JSON.stringify({ query, max_results: maxResults, topic }), }); const data = (await response.json()) as { results: Array<{ url: string; title: string }>; }; const results = data.results ?? []; const resultTexts: string[] = []; for (const result of results) { const content = await fetchWebpageContent(result.url); resultTexts.push( `## ${result.title}\n**URL:** ${result.url}\n\n${content}\n---`, ); } return ( `Found ${resultTexts.length} result(s) for '${query}':\n\n` + resultTexts.join("\n") ); }, { name: "tavily_search", description: "Search the web for information on a given query. Uses Tavily to discover relevant URLs, then fetches and returns full webpage content.", schema: z.object({ query: z.string().describe("Search query to execute"), maxResults: z .number() .optional() .default(1) .describe("Maximum number of results to return (default: 1)"), topic: z .enum(["general", "news", "finance"]) .optional() .default("general") .describe( "Topic filter - 'general', 'news', or 'finance' (default: 'general')", ), }), },);
2
Add orchestrator instructions
Put the research workflow and sub-agent coordination guidance in instructions.md. Managed Deep Agents loads this file as the orchestrator system prompt:
instructions.md
# Research WorkflowFollow this workflow for all research requests:1. **Plan**: Create a todo list with write_todos to break down the research into focused tasks2. **Save the request**: Use write_file() to save the user's research question to `/research_request.md`3. **Research**: Delegate research tasks to sub-agents using the task() tool - ALWAYS use sub-agents for research, never conduct research yourself4. **Synthesize**: Review all sub-agent findings and consolidate citations (each unique URL gets one number across all findings)5. **Write Report**: Write a comprehensive final report to `/final_report.md` (see Report Writing Guidelines below)6. **Verify**: Read `/research_request.md` and confirm you've addressed all aspects with proper citations and structure## Research Planning Guidelines- Batch similar research tasks into a single TODO to minimize overhead- For simple fact-finding questions, use 1 sub-agent- For comparisons or multi-faceted topics, delegate to multiple parallel sub-agents- Each sub-agent should research one specific aspect and return findings## Report Writing GuidelinesWhen writing the final report to `/final_report.md`, follow these structure patterns:**For comparisons:**1. Introduction2. Overview of topic A3. Overview of topic B4. Detailed comparison5. Conclusion**For lists/rankings:**Simply list items with details - no introduction needed:1. Item 1 with explanation2. Item 2 with explanation3. Item 3 with explanation**For summaries/overviews:**1. Overview of topic2. Key concept 13. Key concept 24. Key concept 35. Conclusion**General guidelines:**- Use clear section headings (## for sections, ### for subsections)- Write in paragraph form by default - be text-heavy, not just bullet points- Do NOT use self-referential language ("I found...", "I researched...")- Write as a professional report without meta-commentary- Each section should be comprehensive and detailed- Use bullet points only when listing is more appropriate than prose**Citation format:**- Cite sources inline using [1], [2], [3] format- Assign each unique URL a single citation number across ALL sub-agent findings- End report with ### Sources section listing each numbered source- Number sources sequentially without gaps (1,2,3,4...)- Format: [1] Source Title: URL (each on separate line for proper list rendering)- Example: Some important finding [1]. Another key insight [2]. ### Sources [1] AI Research Paper: https://example.com/paper [2] Industry Analysis: https://example.com/analysis# Sub-Agent Research CoordinationYour role is to coordinate research by delegating tasks from your TODO list to specialized research sub-agents.## Delegation Strategy**DEFAULT: Start with 1 sub-agent** for most queries:- "What is quantum computing?" -> 1 sub-agent (general overview)- "List the top 10 coffee shops in San Francisco" -> 1 sub-agent- "Summarize the history of the internet" -> 1 sub-agent- "Research context engineering for AI agents" -> 1 sub-agent (covers all aspects)**ONLY parallelize when the query EXPLICITLY requires comparison or has clearly independent aspects:****Explicit comparisons** -> 1 sub-agent per element:- "Compare OpenAI vs Anthropic vs DeepMind AI safety approaches" -> 3 parallel sub-agents- "Compare Python vs JavaScript for web development" -> 2 parallel sub-agents**Clearly separated aspects** -> 1 sub-agent per aspect (use sparingly):- "Research renewable energy adoption in Europe, Asia, and North America" -> 3 parallel sub-agents (geographic separation)- Only use this pattern when aspects cannot be covered efficiently by a single comprehensive search## Key Principles- **Bias towards single sub-agent**: One comprehensive research task is more token-efficient than multiple narrow ones- **Avoid premature decomposition**: Don't break "research X" into "research X overview", "research X techniques", "research X applications" - just use 1 sub-agent for all of X- **Parallelize only for clear comparisons**: Use multiple sub-agents when comparing distinct entities or geographically separated data## Parallel Execution Limits- Use at most 3 parallel sub-agents per iteration- Make multiple task() calls in a single response to enable parallel execution- Each sub-agent returns findings independently## Research Limits- Stop after 3 delegation rounds if you haven't found adequate sources- Stop when you have sufficient information to answer comprehensively- Bias towards focused research over exhaustive exploration
When you deploy, Managed Deep Agents syncs these instructions to Context Hub.
3
Create the agent
You just put the main agent’s instructions in instructions.md. Replace the scaffolded agent entry with the full file below. It sets the model, tools, the research sub-agent (including that sub-agent’s own prompt), and TodoListMiddleware so the agent can call write_todos for task planning. name is required: MDA uses it as the LangGraph assistant ID and the default deployment name.Replace agent.ts. Choose your provider:
Claude
Gemini
agent.ts
import { defineDeepAgent } from "managed-deepagents";import { todoListMiddleware } from "langchain";import { tavilySearch } from "./tools/search";const currentDate = new Date().toISOString().split("T")[0];const RESEARCHER_INSTRUCTIONS = `You are a research assistant conducting research on the user's input topic. For context, today's date is {date}.Your job is to use tools to gather information about the user's input topic.You can use the tavily_search tool to find resources that can help answer the research question.You can call it in series or in parallel, your research is conducted in a tool-calling loop.You have access to the tavily_search tool for conducting web searches.Think like a human researcher with limited time. Follow these steps:1. **Read the question carefully** - What specific information does the user need?2. **Start with broader searches** - Use broad, comprehensive queries first3. **After each search, pause and assess** - Do I have enough to answer? What's still missing?4. **Execute narrower searches as you gather information** - Fill in the gaps5. **Stop when you can answer confidently** - Don't keep searching for perfection**Tool Call Budgets** (Prevent excessive searching):- **Simple queries**: Use 2-3 search tool calls maximum- **Complex queries**: Use up to 5 search tool calls maximum- **Always stop**: After 5 search tool calls if you cannot find the right sources**Stop Immediately When**:- You can answer the user's question comprehensively- You have 3+ relevant examples/sources for the question- Your last 2 searches returned similar informationAfter each search, assess results before continuing: What key information did I find? What's missing? Do I have enough to answer? Should I search more or provide my answer?When providing your findings back to the orchestrator:1. **Structure your response**: Organize findings with clear headings and detailed explanations2. **Cite sources inline**: Use [1], [2], [3] format when referencing information from your searches3. **Include Sources section**: End with ### Sources listing each numbered source with title and URLThe orchestrator will consolidate citations from all sub-agents into the final report.`;const researchSubAgent = { name: "research-agent", description: "Delegate research to the sub-agent. Give one topic at a time.", systemPrompt: RESEARCHER_INSTRUCTIONS.replace("{date}", currentDate), tools: [tavilySearch],};export const agent = defineDeepAgent({ name: "deep-research", model: "anthropic:claude-sonnet-5-5", tools: [tavilySearch], subagents: [researchSubAgent], middleware: [todoListMiddleware()],});
agent.ts
import { defineDeepAgent } from "managed-deepagents";import { todoListMiddleware } from "langchain";import { tavilySearch } from "./tools/search";const currentDate = new Date().toISOString().split("T")[0];const RESEARCHER_INSTRUCTIONS = `You are a research assistant conducting research on the user's input topic. For context, today's date is {date}.Your job is to use tools to gather information about the user's input topic.You can use the tavily_search tool to find resources that can help answer the research question.You can call it in series or in parallel, your research is conducted in a tool-calling loop.You have access to the tavily_search tool for conducting web searches.Think like a human researcher with limited time. Follow these steps:1. **Read the question carefully** - What specific information does the user need?2. **Start with broader searches** - Use broad, comprehensive queries first3. **After each search, pause and assess** - Do I have enough to answer? What's still missing?4. **Execute narrower searches as you gather information** - Fill in the gaps5. **Stop when you can answer confidently** - Don't keep searching for perfection**Tool Call Budgets** (Prevent excessive searching):- **Simple queries**: Use 2-3 search tool calls maximum- **Complex queries**: Use up to 5 search tool calls maximum- **Always stop**: After 5 search tool calls if you cannot find the right sources**Stop Immediately When**:- You can answer the user's question comprehensively- You have 3+ relevant examples/sources for the question- Your last 2 searches returned similar informationAfter each search, assess results before continuing: What key information did I find? What's missing? Do I have enough to answer? Should I search more or provide my answer?When providing your findings back to the orchestrator:1. **Structure your response**: Organize findings with clear headings and detailed explanations2. **Cite sources inline**: Use [1], [2], [3] format when referencing information from your searches3. **Include Sources section**: End with ### Sources listing each numbered source with title and URLThe orchestrator will consolidate citations from all sub-agents into the final report.`;const researchSubAgent = { name: "research-agent", description: "Delegate research to the sub-agent. Give one topic at a time.", systemPrompt: RESEARCHER_INSTRUCTIONS.replace("{date}", currentDate), tools: [tavilySearch],};export const agent = defineDeepAgent({ name: "deep-research", model: "google:gemini-3-pro-preview", tools: [tavilySearch], subagents: [researchSubAgent], middleware: [todoListMiddleware()],});
Run the agent
1
Run locally
Install dependencies and start the agent:
npm installnpx mda dev
pnpm installpnpm exec mda dev
bun installbunx mda dev
mda dev loads API keys from .env, starts a local Agent Server, and opens the agent in LangSmith Studio.In Studio, send a research question such as:
Compare the main approaches to context engineering for AI agents in 2025.
You should see the orchestrator plan with write_todos, delegate to the research sub-agent, and write a report. For more information, see Develop locally with LangSmith Studio.
2
Deploy (optional)
npx mda deploy
pnpm exec mda deploy
bunx mda deploy
On success, the CLI prints the deployment dashboard URL. See Deploy.
Add the custom search tool. The tavily_search tool uses Tavily for URL discovery, then fetches full webpage content so the agent can analyze complete sources instead of summaries.
import { tool } from "langchain";import { z } from "zod";async function fetchWebpageContent( url: string, timeout = 10_000,): Promise<string> { try { const controller = new AbortController(); const id = setTimeout(() => controller.abort(), timeout); const response = await fetch(url, { headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36", }, signal: controller.signal, }); clearTimeout(id); if (!response.ok) { return `Error fetching ${url}: HTTP ${response.status}`; } return await response.text(); } catch (e) { return `Error fetching ${url}: ${e}`; }}const tavilySearch = tool( async ({ query, maxResults = 1, topic = "general", }: { query: string; maxResults?: number; topic?: "general" | "news" | "finance"; }) => { const response = await fetch("https://api.tavily.com/search", { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${process.env.TAVILY_API_KEY}`, }, body: JSON.stringify({ query, max_results: maxResults, topic }), }); const data = (await response.json()) as { results: Array<{ url: string; title: string }>; }; const results = data.results ?? []; const resultTexts: string[] = []; for (const result of results) { const content = await fetchWebpageContent(result.url); resultTexts.push( `## ${result.title}\n**URL:** ${result.url}\n\n${content}\n---`, ); } return ( `Found ${resultTexts.length} result(s) for '${query}':\n\n` + resultTexts.join("\n") ); }, { name: "tavily_search", description: "Search the web for information on a given query. Uses Tavily to discover relevant URLs, then fetches and returns full webpage content.", schema: z.object({ query: z.string().describe("Search query to execute"), maxResults: z .number() .optional() .default(1) .describe("Maximum number of results to return (default: 1)"), topic: z .enum(["general", "news", "finance"]) .optional() .default("general") .describe( "Topic filter - 'general', 'news', or 'finance' (default: 'general')", ), }), },);
2
Create the agent
Below the tools, add the prompt constants and then create the agent. The three constants (RESEARCH_WORKFLOW_INSTRUCTIONS, RESEARCHER_INSTRUCTIONS, and SUBAGENT_DELEGATION_INSTRUCTIONS) must live in the same file as the create_deep_agent / createDeepAgent call. TodoListMiddleware is opt-in task planning so the agent can call write_todos.Add the prompts to agent.ts:
const RESEARCH_WORKFLOW_INSTRUCTIONS = `# Research WorkflowFollow this workflow for all research requests:1. **Plan**: Create a todo list with write_todos to break down the research into focused tasks2. **Save the request**: Use write_file() to save the user's research question to \`/research_request.md\`3. **Research**: Delegate research tasks to sub-agents using the task() tool - ALWAYS use sub-agents for research, never conduct research yourself4. **Synthesize**: Review all sub-agent findings and consolidate citations (each unique URL gets one number across all findings)5. **Write Report**: Write a comprehensive final report to \`/final_report.md\` (see Report Writing Guidelines below)6. **Verify**: Read \`/research_request.md\` and confirm you've addressed all aspects with proper citations and structure## Research Planning Guidelines- Batch similar research tasks into a single TODO to minimize overhead- For simple fact-finding questions, use 1 sub-agent- For comparisons or multi-faceted topics, delegate to multiple parallel sub-agents- Each sub-agent should research one specific aspect and return findings## Report Writing GuidelinesWhen writing the final report to \`/final_report.md\`, follow these structure patterns:**For comparisons:**1. Introduction2. Overview of topic A3. Overview of topic B4. Detailed comparison5. Conclusion**For lists/rankings:**Simply list items with details - no introduction needed:1. Item 1 with explanation2. Item 2 with explanation3. Item 3 with explanation**For summaries/overviews:**1. Overview of topic2. Key concept 13. Key concept 24. Key concept 35. Conclusion**General guidelines:**- Use clear section headings (## for sections, ### for subsections)- Write in paragraph form by default - be text-heavy, not just bullet points- Do NOT use self-referential language ("I found...", "I researched...")- Write as a professional report without meta-commentary- Each section should be comprehensive and detailed- Use bullet points only when listing is more appropriate than prose**Citation format:**- Cite sources inline using [1], [2], [3] format- Assign each unique URL a single citation number across ALL sub-agent findings- End report with ### Sources section listing each numbered source- Number sources sequentially without gaps (1,2,3,4...)- Format: [1] Source Title: URL (each on separate line for proper list rendering)- Example: Some important finding [1]. Another key insight [2]. ### Sources [1] AI Research Paper: https://example.com/paper [2] Industry Analysis: https://example.com/analysis`;
const RESEARCHER_INSTRUCTIONS = `You are a research assistant conducting research on the user's input topic. For context, today's date is {date}.Your job is to use tools to gather information about the user's input topic.You can use the tavily_search tool to find resources that can help answer the research question.You can call it in series or in parallel, your research is conducted in a tool-calling loop.You have access to the tavily_search tool for conducting web searches.Think like a human researcher with limited time. Follow these steps:1. **Read the question carefully** - What specific information does the user need?2. **Start with broader searches** - Use broad, comprehensive queries first3. **After each search, pause and assess** - Do I have enough to answer? What's still missing?4. **Execute narrower searches as you gather information** - Fill in the gaps5. **Stop when you can answer confidently** - Don't keep searching for perfection**Tool Call Budgets** (Prevent excessive searching):- **Simple queries**: Use 2-3 search tool calls maximum- **Complex queries**: Use up to 5 search tool calls maximum- **Always stop**: After 5 search tool calls if you cannot find the right sources**Stop Immediately When**:- You can answer the user's question comprehensively- You have 3+ relevant examples/sources for the question- Your last 2 searches returned similar informationAfter each search, assess results before continuing: What key information did I find? What's missing? Do I have enough to answer? Should I search more or provide my answer?When providing your findings back to the orchestrator:1. **Structure your response**: Organize findings with clear headings and detailed explanations2. **Cite sources inline**: Use [1], [2], [3] format when referencing information from your searches3. **Include Sources section**: End with ### Sources listing each numbered source with title and URLExample:## Key FindingsContext engineering is a critical technique for AI agents [1]. Studies show that proper context management can improve performance by 40% [2].### Sources[1] Context Engineering Guide: https://example.com/context-guide[2] AI Performance Study: https://example.com/studyThe orchestrator will consolidate citations from all sub-agents into the final report.`;
const SUBAGENT_DELEGATION_INSTRUCTIONS = `# Sub-Agent Research CoordinationYour role is to coordinate research by delegating tasks from your TODO list to specialized research sub-agents.## Delegation Strategy**DEFAULT: Start with 1 sub-agent** for most queries:- "What is quantum computing?" -> 1 sub-agent (general overview)- "List the top 10 coffee shops in San Francisco" -> 1 sub-agent- "Summarize the history of the internet" -> 1 sub-agent- "Research context engineering for AI agents" -> 1 sub-agent (covers all aspects)**ONLY parallelize when the query EXPLICITLY requires comparison or has clearly independent aspects:****Explicit comparisons** -> 1 sub-agent per element:- "Compare OpenAI vs Anthropic vs DeepMind AI safety approaches" -> 3 parallel sub-agents- "Compare Python vs JavaScript for web development" -> 2 parallel sub-agents**Clearly separated aspects** -> 1 sub-agent per aspect (use sparingly):- "Research renewable energy adoption in Europe, Asia, and North America" -> 3 parallel sub-agents (geographic separation)- Only use this pattern when aspects cannot be covered efficiently by a single comprehensive search## Key Principles- **Bias towards single sub-agent**: One comprehensive research task is more token-efficient than multiple narrow ones- **Avoid premature decomposition**: Don't break "research X" into "research X overview", "research X techniques", "research X applications" - just use 1 sub-agent for all of X- **Parallelize only for clear comparisons**: Use multiple sub-agents when comparing distinct entities or geographically separated data## Parallel Execution Limits- Use at most {maxConcurrentResearchUnits} parallel sub-agents per iteration- Make multiple task() calls in a single response to enable parallel execution- Each sub-agent returns findings independently## Research Limits- Stop after {maxResearcherIterations} delegation rounds if you haven't found adequate sources- Stop when you have sufficient information to answer comprehensively- Bias towards focused research over exhaustive exploration`;
Then add the model and agent. Choose your provider:
Claude
Gemini
import { createDeepAgent } from "deepagents";import { ChatAnthropic } from "@langchain/anthropic";import { todoListMiddleware } from "langchain";const maxConcurrentResearchUnits = 3;const maxResearcherIterations = 3;const currentDate = new Date().toISOString().split("T")[0];const INSTRUCTIONS = RESEARCH_WORKFLOW_INSTRUCTIONS + "\n\n" + "=".repeat(80) + "\n\n" + SUBAGENT_DELEGATION_INSTRUCTIONS.replace( "{maxConcurrentResearchUnits}", String(maxConcurrentResearchUnits), ).replace("{maxResearcherIterations}", String(maxResearcherIterations));const researchSubAgent = { name: "research-agent", description: "Delegate research to the sub-agent. Give one topic at a time.", systemPrompt: RESEARCHER_INSTRUCTIONS.replace("{date}", currentDate), tools: [tavilySearch],};const model = new ChatAnthropic({ model: "claude-sonnet-5-5",});const agent = await createDeepAgent({ model, tools: [tavilySearch], systemPrompt: INSTRUCTIONS, subagents: [researchSubAgent], middleware: [todoListMiddleware()],});
import { createDeepAgent } from "deepagents";import { ChatGoogle } from "@langchain/google/node";import { todoListMiddleware } from "langchain";const maxConcurrentResearchUnits = 3;const maxResearcherIterations = 3;const currentDate = new Date().toISOString().split("T")[0];const INSTRUCTIONS = RESEARCH_WORKFLOW_INSTRUCTIONS + "\n\n" + "=".repeat(80) + "\n\n" + SUBAGENT_DELEGATION_INSTRUCTIONS.replace( "{maxConcurrentResearchUnits}", String(maxConcurrentResearchUnits), ).replace("{maxResearcherIterations}", String(maxResearcherIterations));const researchSubAgent = { name: "research-agent", description: "Delegate research to the sub-agent. Give one topic at a time.", systemPrompt: RESEARCHER_INSTRUCTIONS.replace("{date}", currentDate), tools: [tavilySearch],};const model = new ChatGoogle({ model: "gemini-3-pro-preview", temperature: 0,});const agent = createDeepAgent({ model, tools: [tavilySearch], systemPrompt: INSTRUCTIONS, subagents: [researchSubAgent], middleware: [todoListMiddleware()],});
Run the agent
You can run the agent synchronously, meaning it will wait for the full result and then print it, or you can stream updates as they come in.Add the code from the respective tab at the bottom of agent.ts:
Run synchronously
Stream updates
{ async function main() { const result = await agent.invoke({ messages: [ { role: "user", content: "What are the main differences between RAG and fine-tuning for LLM applications?", }, ], }); for (const msg of result.messages ?? []) { if (msg.content) { console.log(msg.content); } } } main().catch((err) => { console.error(err); process.exitCode = 1; });}
{ async function main() { const stream = await agent.streamEvents( { messages: [ { role: "user", content: "Compare Python vs JavaScript for web development", }, ], }, { version: "v3" }, ); for await (const message of stream.messages) { for await (const token of message.text) { process.stdout.write(token); } } } main().catch((err) => { console.error(err); process.exitCode = 1; });}
Run the agent from the project root:
npx tsx agent.ts
If you set the LANGSMITH_API_KEY environment variable before running, you can view the agent’s traces in LangSmith to debug and monitor multi-step behavior.
Now that you’ve built the agent, customize the workflow by editing the orchestrator instructions (Managed Deep Agents: instructions.md; SDK: prompt constants in your agent file). You can also tune the delegation limits to allow more parallel sub-agents or delegation rounds.For more information on the concepts in this tutorial, see:
Subagents: Configure subagents with different tools and prompts
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Docs by LangChain","description":"Documentation for LangSmith, Fleet, and our open source packages.","colors":{"primary":"#161F34","light":"#7FC8FF","dark":"#006DDD"},"logo":{"light":"https://mintcdn.com/langchain-5e9cc07a/nQm-sjd_MByLhgeW/images/brand/langchain-docs-dark-blue.png?fit=max\u0026auto=format\u0026n=nQm-sjd_MByLhgeW\u0026q=85\u0026s=5babf1a1962208fd7eed942fa2432ecb","dark":"https://mintcdn.com/langchain-5e9cc07a/nQm-sjd_MByLhgeW/images/brand/langchain-docs-light-blue.png?fit=max\u0026auto=format\u0026n=nQm-sjd_MByLhgeW\u0026q=85\u0026s=0bcd2a1f2599ed228bcedf0f535b45b1"},"favicon":{"light":"https://mintcdn.com/langchain-5e9cc07a/8njVp3mXF3LrAS1d/images/brand/docs-favicon.png?fit=max\u0026auto=format\u0026n=8njVp3mXF3LrAS1d\u0026q=85\u0026s=a61c2b4666f558992e1fd44750b08465","dark":"https://mintcdn.com/langchain-5e9cc07a/8njVp3mXF3LrAS1d/images/brand/docs-favicon.png?fit=max\u0026auto=format\u0026n=8njVp3mXF3LrAS1d\u0026q=85\u0026s=a61c2b4666f558992e1fd44750b08465"},"appearance":{"default":"system","strict":false},"background":{"color":{"light":"#FFFFFF","dark":"#030710"}},"navbar":{"links":[{"icon":"message","href":"https://chat.langchain.com/","label":"Ask AI"},{"icon":"brand-github","href":"https://github.com/langchain-ai","label":"GitHub"}],"primary":{"type":"button","label":"Try LangSmith","href":"https://smith.langchain.com/"}},"footer":{"socials":{"github":"https://github.com/langchain-ai","x":"https://x.com/LangChain","linkedin":"https://www.linkedin.com/company/langchain","youtube":"https://www.youtube.com/@LangChain"},"links":[{"header":"Resources","items":[{"label":"Forum","href":"https://forum.langchain.com/"},{"label":"Changelog","href":"https://changelog.langchain.com/"},{"label":"LangChain Academy","href":"https://academy.langchain.com/"},{"label":"Contact Sales","href":"https://www.langchain.com/contact-sales"}]},{"header":"Company","items":[{"label":"Home","href":"https://langchain.com/"},{"label":"Trust Center","href":"https://trust.langchain.com/"},{"label":"Careers","href":"https://langchain.com/careers"},{"label":"Blog","href":"https://blog.langchain.com/"}]}]},"seo":{"metatags":{"canonical":"https://docs.langchain.com","google-site-verification":"9_2KHeJwmEdwgncBRk1MsKxriZz7Sc21EJdbfCxkTEo"}},"fonts":{"heading":{"family":"TWK Lausanne","weight":700,"source":"fonts/TWKLausanne-700.woff2","format":"woff2"},"body":{"family":"Inter","weight":400}},"icons":{"library":"tabler"},"styling":{"eyebrows":"breadcrumbs","codeblocks":{"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}},"latex":true},"integrations":{"gtm":{"tagId":"GTM-MBBX68ST"}},"banner":{"content":"Would you notice if your agent got worse in production? [Tell us in our annual survey](https://form.typeform.com/to/U2EAO1Lz) for the chance to win LangChain swag.","dismissible":true},"errors":{"404":{"redirect":false,"title":"Page not found","description":"We couldn't find the page you were looking for."}},"contextual":{"options":["copy","view",{"title":"llms.txt","description":"Open llms.txt for this site","icon":"file","href":"https://docs.langchain.com/llms.txt"},"chatgpt","claude","mcp","cursor","vscode"],"display":"header"},"interaction":{"drilldown":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"langchain-5e9cc07a","hasAudioNarration":false,"actualSubdomain":"langchain-5e9cc07a","customDomains":["docs.langchain.com"],"gitSource":{"type":"github","owner":"langchain-ai","repo":"docs","deployBranch":"prod","contentDirectory":"build","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":false,"issues":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b0f3e3f65d1a69adc1c8058","clientVersion":"0.0.4397","searchFilterCounts":[{"language":"default","tag":"Reference","count":842},{"language":"default","tag":"AGENT IMPROVEMENT","count":833},{"language":"default","tag":"AGENT RUNTIME","count":769},{"language":"default","tag":"Monitor","count":743},{"language":"default","tag":"LangSmith REST API","count":632},{"language":"default","tag":"Build","count":486},{"language":"default","tag":"Deploy","count":257},{"language":"default","tag":"TypeScript","count":254},{"language":"default","tag":"AGENT GOVERNANCE","count":233},{"language":"default","tag":"Python","count":232}],"searchSettings":{"maxResults":10,"showContentSnippets":true,"isFiltersEnabled":false}},"assistantConfig":{"enableAskAiButton":false,"enableAskAiSearchBar":true,"deflection":{"enabled":false,"email":"support@langchain.dev"}},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","href":"/_mintlify/custom/langchain-5e9cc07a/d59117b7cd22d12d/style.css"}]}
{"page":{"pagePath":"oss/javascript/deepagents/deep-research","slug":"/oss/javascript/deepagents/deep-research","pageMetadata":{"title":"Build a deep research agent","sidebarTitle":"Deep Research","description":"Build a multi-step web research agent with subagent delegation using Managed Deep Agents or the Deep Agents SDK","href":"/oss/javascript/deepagents/deep-research"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Build a multi-step web research agent with subagent delegation using Managed Deep Agents or the Deep Agents SDK\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{Callout,CodeBlock,CodeGroup,Heading,Note,Step,Steps,Tab,Tabs,Warning}=_components;if(!Callout)_missingMdxReference(`Callout`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`This guide shows how to build a multi-step web research agent with `,_jsx(_components.a,{href:`/oss/javascript/deepagents`,children:`Deep Agents`}),`. The agent decomposes research questions into focused tasks, delegates them to specialized sub-agents, and synthesizes findings into a comprehensive report.`]}),`\n`,_jsx(_components.p,{children:`The agent you build will:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Plan research using the opt-in todo list middleware`}),`\n`,_jsx(_components.li,{children:`Delegate focused research tasks to sub-agents with isolated context`}),`\n`,_jsx(_components.li,{children:`Assess search results and plan next steps as you gather information`}),`\n`,_jsx(_components.li,{children:`Synthesize findings with proper citations into a final report`}),`\n`]}),`\n`,_jsx(_components.p,{children:`The spawned sub-agents conduct web searches with Tavily, fetching full webpage content for analysis.`}),`\n`,_jsx(Heading,{level:`3`,id:`key-concepts`,children:`Key concepts`}),`\n`,_jsx(_components.p,{children:`This tutorial covers:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/oss/javascript/deepagents/subagents`,children:`Subagents`}),` for parallel, context-isolated research`]}),`\n`,_jsxs(_components.li,{children:[`Custom `,_jsx(_components.a,{href:`/oss/javascript/langchain/tools`,children:`tools`}),` for web search`]}),`\n`,_jsxs(_components.li,{children:[`Multi-step planning with the opt-in `,_jsx(_components.a,{href:`/oss/javascript/deepagents/overview#task-planning`,children:`planning tool`})]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsx(_components.p,{children:`API keys for:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Anthropic (Claude) or Google (Gemini)`}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://www.tavily.com/`,children:`Tavily`}),` for web search (optional; free tier is sufficient)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://smith.langchain.com?utm_source=docs\u0026utm_medium=cta\u0026utm_campaign=langsmith-signup\u0026utm_content=oss-deepagents-deep-research`,children:`LangSmith`}),` for tracing (optional if you are using the SDK; required for Managed Deep Agents)`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`choose-your-path`,children:`Choose your path`}),`\n`,_jsxs(_components.p,{children:[`This guide shows how to build this agent with `,_jsx(_components.a,{href:`/langsmith/javascript/managed-deep-agents-overview`,children:`Managed Deep Agents`}),` and the Deep Agents SDK. Managed Deep Agents lets you deploy agents without having to manage infrastructure. The Deep Agents SDK, lets you have maximum flexibility while using the same Deep Agents harness and you can host agents yourself, or run a custom `,_jsx(_components.a,{href:`/langsmith/agent-server`,children:`Agent Server`}),`.`]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Managed Deep Agents`,id:`managed-deep-agents`,\"data-child-tab-ids\":`[\"claude\",\"gemini\",\"claude-2\",\"gemini-2\"]`,\"data-child-heading-ids\":`[\"setup\",\"build-the-agent\",\"run-the-agent\"]`,children:[_jsx(Note,{children:_jsxs(_components.p,{children:[`Managed Deep Agents is in `,_jsx(_components.a,{href:`/langsmith/release-stages`,children:`beta`}),` on `,_jsx(_components.a,{href:`/langsmith/cloud`,children:`LangSmith Cloud`}),` and `,_jsx(_components.a,{href:`/langsmith/byoc`,children:`Bring Your Own Cloud (BYOC)`}),`. Use Managed Deep Agents CLI and SDK v0.10 or later for BYOC.`]})}),_jsx(Heading,{level:`3`,id:`setup`,children:`Setup`}),_jsx(_components.p,{children:`To follow along, you need:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Node.js and npm.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`An API key for your model provider of choice.`}),`\n`]}),`\n`]}),_jsxs(Steps,{children:[_jsx(Step,{title:`Create the project`,children:_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`npm`,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`npx`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` managed-deepagents`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` init`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deep-research`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-style\":`italic`},children:`cd`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deep-research`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`pnpm`,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`pnpm`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` dlx`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` managed-deepagents`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` init`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deep-research`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-style\":`italic`},children:`cd`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deep-research`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`bun`,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`bunx`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` managed-deepagents`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` init`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deep-research`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-style\":`italic`},children:`cd`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deep-research`})]}),`\n`]})})})]})}),_jsxs(Step,{title:`Add API keys`,children:[_jsxs(_components.p,{children:[`Add your model provider key, Tavily key, and LangSmith API key to `,_jsx(_components.code,{children:`.env`}),`:`]}),_jsxs(Tabs,{children:[_jsx(Tab,{title:`Claude`,id:`claude`,children:_jsx(CodeBlock,{filename:`.env`,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ANTHROPIC_API_KEY=\u003cANTHROPIC_API_KEY>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`TAVILY_API_KEY=\u003cTAVILY_API_KEY>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`LANGSMITH_API_KEY=\u003cLANGSMITH_API_KEY>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})}),_jsx(Tab,{title:`Gemini`,id:`gemini`,children:_jsx(CodeBlock,{filename:`.env`,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GOOGLE_API_KEY=\u003cGOOGLE_API_KEY>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`TAVILY_API_KEY=\u003cTAVILY_API_KEY>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`LANGSMITH_API_KEY=\u003cLANGSMITH_API_KEY>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})})]}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`Do not commit the `,_jsx(_components.code,{children:`.env`}),` file into version control. It contains secrets.`]})})]}),_jsx(Step,{title:`Install search dependencies`,children:_jsxs(_components.p,{children:[`No extra packages are required for the search tool in this tutorial. It uses the built-in `,_jsx(_components.code,{children:`fetch`}),` API and the Tavily HTTP endpoint.`]})})]}),_jsx(Heading,{level:`3`,id:`build-the-agent`,children:`Build the agent`}),_jsxs(Steps,{children:[_jsxs(Step,{title:`Add tools`,children:[_jsxs(_components.p,{children:[`Create a custom search tool. The `,_jsx(_components.code,{children:`tavily_search`}),` tool uses Tavily for URL discovery, then fetches full webpage content so the agent can analyze complete sources instead of summaries.`]}),_jsxs(_components.p,{children:[`Create `,_jsx(_components.code,{children:`tools/search.ts`}),`:`]}),_jsx(CodeBlock,{filename:`tools/search.ts`,numberOfLines:`82`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`82`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tool `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"langchain\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` z `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"zod\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`async`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` function`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` fetchWebpageContent`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E64553`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#EBA0AC`,\"--shiki-dark-font-style\":`italic`},children:` url`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` string`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E64553`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#EBA0AC`,\"--shiki-dark-font-style\":`italic`},children:` timeout`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 10_000`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`)`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F9E2AF`,\"--shiki-dark-font-style\":`italic`},children:` Promise`}),_jsx(_components.span,{style:{color:`#04A5E5`,\"--shiki-dark\":`#89DCEB`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`string`}),_jsx(_components.span,{style:{color:`#04A5E5`,\"--shiki-dark\":`#89DCEB`},children:`>`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` try`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` controller `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#CBA6F7`,\"--shiki-dark-font-weight\":`bold`},children:` new`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` AbortController`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` id `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` setTimeout`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` =>`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` controller`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`abort`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` timeout)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` response `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` fetch`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(url`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` headers`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"User-Agent\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` signal`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` controller`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`signal`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` clearTimeout`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(id)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` if`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`!`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`response`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`ok) `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` return`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `Error fetching \"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`url`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`: HTTP `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`response`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`status`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` return`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` response`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`text`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` catch`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (e) `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` return`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `Error fetching \"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`url`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`: `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`e`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`export`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tavilySearch `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` tool`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` async`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` query`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxResults `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 1`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` topic `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"general\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` query`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` string;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxResults`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`?:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` number;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` topic`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`?:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"general\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` |`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"news\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` |`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"finance\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`) `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=>`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` response `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` fetch`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"https://api.tavily.com/search\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` method`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` headers`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Authorization`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`process`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`env`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`TAVILY_API_KEY`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` body`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` JSON`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`stringify`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` query`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` max_results`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxResults`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` topic `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` data `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`await`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` response`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`json`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()) `}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`as`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` results`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F9E2AF`,\"--shiki-dark-font-style\":`italic`},children:` Array`}),_jsx(_components.span,{style:{color:`#04A5E5`,\"--shiki-dark\":`#89DCEB`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#CDD6F4`,\"--shiki-dark-font-style\":`italic`},children:` url`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` string`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#CDD6F4`,\"--shiki-dark-font-style\":`italic`},children:` title`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` string`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#04A5E5`,\"--shiki-dark\":`#89DCEB`},children:`>`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` };`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` results `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` data`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`results `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`??`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` []`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` resultTexts`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` string`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F9E2AF`,\"--shiki-dark-font-style\":`italic`},children:`[] `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` []`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` for`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` result `}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`of`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` results) `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` content `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` fetchWebpageContent`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(result`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`url)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` resultTexts`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`push`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `## \"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`result`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`title`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**URL:** `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`result`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`url`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`content`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"---`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` )`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` return`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `Found \"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`resultTexts`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`length`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` result(s) for '`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`query`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`':`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` +`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` resultTexts`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`join`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` )`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` name`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"tavily_search\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` description`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Search the web for information on a given query. Uses Tavily to discover relevant URLs, then fetches and returns full webpage content.\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` schema`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` z`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`object`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` query`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` z`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`string`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`describe`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"Search query to execute\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxResults`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` z`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`number`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`optional`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`default`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`1`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`describe`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"Maximum number of results to return (default: 1)\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` topic`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` z`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`enum`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`([`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"general\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"news\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"finance\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`optional`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`default`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"general\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`describe`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Topic filter - 'general', 'news', or 'finance' (default: 'general')\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` )`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})]}),_jsxs(Step,{title:`Add orchestrator instructions`,children:[_jsxs(_components.p,{children:[`Put the research workflow and sub-agent coordination guidance in `,_jsx(_components.code,{children:`instructions.md`}),`. Managed Deep Agents loads this file as the orchestrator system prompt:`]}),_jsx(CodeBlock,{filename:`instructions.md`,wrap:`true`,expandable:`true`,numberOfLines:`99`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`99`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-dark\":`#F38BA8`},children:`# Research Workflow`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`Follow this workflow for all research requests:`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`1.`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` **`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Plan`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: Create a todo list with write_todos to break down the research into focused tasks`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`2.`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` **`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Save the request`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: Use write_file() to save the user's research question to `}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`/research_request.md`\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`3.`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` **`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Research`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: Delegate research tasks to sub-agents using the task() tool - ALWAYS use sub-agents for research, never conduct research yourself`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`4.`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` **`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Synthesize`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: Review all sub-agent findings and consolidate citations (each unique URL gets one number across all findings)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`5.`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` **`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Write Report`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: Write a comprehensive final report to `}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`/final_report.md`\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (see Report Writing Guidelines below)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`6.`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` **`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Verify`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: Read `}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`/research_request.md`\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` and confirm you've addressed all aspects with proper citations and structure`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`## Research Planning Guidelines`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Batch similar research tasks into a single TODO to minimize overhead`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` For simple fact-finding questions, use 1 sub-agent`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` For comparisons or multi-faceted topics, delegate to multiple parallel sub-agents`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Each sub-agent should research one specific aspect and return findings`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`## Report Writing Guidelines`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`When writing the final report to `}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`/final_report.md`\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`, follow these structure patterns:`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`For comparisons:`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`1.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Introduction`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`2.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Overview of topic A`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`3.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Overview of topic B`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`4.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Detailed comparison`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`5.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Conclusion`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`For lists/rankings:`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`Simply list items with details - no introduction needed:`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`1.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Item 1 with explanation`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`2.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Item 2 with explanation`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`3.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Item 3 with explanation`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`For summaries/overviews:`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`1.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Overview of topic`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`2.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Key concept 1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`3.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Key concept 2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`4.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Key concept 3`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`5.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Conclusion`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`General guidelines:`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Use clear section headings (## for sections, ### for subsections)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Write in paragraph form by default - be text-heavy, not just bullet points`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Do NOT use self-referential language (\"I found...\", \"I researched...\")`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Write as a professional report without meta-commentary`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Each section should be comprehensive and detailed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Use bullet points only when listing is more appropriate than prose`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Citation format:`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Cite sources inline using `}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`[`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`1`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`]`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`, `}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`[`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`2`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`]`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`, `}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`[`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`3`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`]`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` format`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Assign each unique URL a single citation number across ALL sub-agent findings`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` End report with ### Sources section listing each numbered source`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Number sources sequentially without gaps (1,2,3,4...)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Format: `}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`[`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`1`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`]`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Source Title: URL (each on separate line for proper list rendering)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Example:`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Some important finding `}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`[`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`1`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`]`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`. Another key insight `}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`[`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`2`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`]`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`.`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-dark\":`#F9E2AF`},children:` ### Sources`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:` [`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`1`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`]`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` AI Research Paper: https://example.com/paper`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:` [`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`2`}),_jsx(_components.span,{style:{color:`#7287FD`,\"--shiki-dark\":`#B4BEFE`},children:`]`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Industry Analysis: https://example.com/analysis`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-dark\":`#F38BA8`},children:`# Sub-Agent Research Coordination`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`Your role is to coordinate research by delegating tasks from your TODO list to specialized research sub-agents.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`## Delegation Strategy`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`DEFAULT: Start with 1 sub-agent`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` for most queries:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` \"What is quantum computing?\" -> 1 sub-agent (general overview)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` \"List the top 10 coffee shops in San Francisco\" -> 1 sub-agent`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` \"Summarize the history of the internet\" -> 1 sub-agent`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` \"Research context engineering for AI agents\" -> 1 sub-agent (covers all aspects)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`ONLY parallelize when the query EXPLICITLY requires comparison or has clearly independent aspects:`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Explicit comparisons`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` -> 1 sub-agent per element:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` \"Compare OpenAI vs Anthropic vs DeepMind AI safety approaches\" -> 3 parallel sub-agents`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` \"Compare Python vs JavaScript for web development\" -> 2 parallel sub-agents`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Clearly separated aspects`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` -> 1 sub-agent per aspect (use sparingly):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` \"Research renewable energy adoption in Europe, Asia, and North America\" -> 3 parallel sub-agents (geographic separation)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Only use this pattern when aspects cannot be covered efficiently by a single comprehensive search`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`## Key Principles`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` **`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Bias towards single sub-agent`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: One comprehensive research task is more token-efficient than multiple narrow ones`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` **`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Avoid premature decomposition`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: Don't break \"research X\" into \"research X overview\", \"research X techniques\", \"research X applications\" - just use 1 sub-agent for all of X`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` **`}),_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-weight\":`bold`},children:`Parallelize only for clear comparisons`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`**`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: Use multiple sub-agents when comparing distinct entities or geographically separated data`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`## Parallel Execution Limits`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Use at most 3 parallel sub-agents per iteration`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Make multiple task() calls in a single response to enable parallel execution`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Each sub-agent returns findings independently`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`## Research Limits`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Stop after 3 delegation rounds if you haven't found adequate sources`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Stop when you have sufficient information to answer comprehensively`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`-`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Bias towards focused research over exhaustive exploration`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`When you deploy, Managed Deep Agents syncs these instructions to `,_jsx(_components.a,{href:`/langsmith/javascript/managed-deep-agents-context-hub`,children:`Context Hub`}),`.`]})]}),_jsxs(Step,{title:`Create the agent`,children:[_jsxs(_components.p,{children:[`You just put the main agent’s instructions in `,_jsx(_components.code,{children:`instructions.md`}),`. Replace the scaffolded agent entry with the full file below. It sets the model, tools, the research sub-agent (including that sub-agent’s own prompt), and `,_jsx(_components.a,{href:`https://reference.langchain.com/javascript/langchain/index/todoListMiddleware`,children:_jsx(_components.code,{children:`TodoListMiddleware`})}),` so the agent can call `,_jsx(_components.code,{children:`write_todos`}),` for `,_jsx(_components.a,{href:`/oss/javascript/deepagents/overview#task-planning`,children:`task planning`}),`. `,_jsx(_components.code,{children:`name`}),` is required: MDA uses it as the LangGraph assistant ID and the default deployment name.`]}),_jsxs(_components.p,{children:[`Replace `,_jsx(_components.code,{children:`agent.ts`}),`. Choose your provider:`]}),_jsxs(Tabs,{children:[_jsx(Tab,{title:`Claude`,id:`claude-2`,children:_jsx(CodeBlock,{filename:`agent.ts`,numberOfLines:`58`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`58`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` defineDeepAgent `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"managed-deepagents\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` todoListMiddleware `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"langchain\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tavilySearch `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"./tools/search\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` currentDate `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#CBA6F7`,\"--shiki-dark-font-weight\":`bold`},children:` new`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` Date`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`toISOString`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`split`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"T\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)[`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`0`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` RESEARCHER_INSTRUCTIONS `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `You are a research assistant conducting research on the user's input topic. For context, today's date is {date}.\"})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Your job is to use tools to gather information about the user's input topic.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`You can use the tavily_search tool to find resources that can help answer the research question.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`You can call it in series or in parallel, your research is conducted in a tool-calling loop.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`You have access to the tavily_search tool for conducting web searches.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Think like a human researcher with limited time. Follow these steps:`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`1. **Read the question carefully** - What specific information does the user need?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`2. **Start with broader searches** - Use broad, comprehensive queries first`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`3. **After each search, pause and assess** - Do I have enough to answer? What's still missing?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`4. **Execute narrower searches as you gather information** - Fill in the gaps`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`5. **Stop when you can answer confidently** - Don't keep searching for perfection`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**Tool Call Budgets** (Prevent excessive searching):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Simple queries**: Use 2-3 search tool calls maximum`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Complex queries**: Use up to 5 search tool calls maximum`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Always stop**: After 5 search tool calls if you cannot find the right sources`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**Stop Immediately When**:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- You can answer the user's question comprehensively`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- You have 3+ relevant examples/sources for the question`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Your last 2 searches returned similar information`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`After each search, assess results before continuing: What key information did I find? What's missing? Do I have enough to answer? Should I search more or provide my answer?`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`When providing your findings back to the orchestrator:`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`1. **Structure your response**: Organize findings with clear headings and detailed explanations`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`2. **Cite sources inline**: Use [1], [2], [3] format when referencing information from your searches`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`3. **Include Sources section**: End with ### Sources listing each numbered source with title and URL`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`The orchestrator will consolidate citations from all sub-agents into the final report.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` researchSubAgent `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` name`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"research-agent\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` description`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Delegate research to the sub-agent. Give one topic at a time.\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` systemPrompt`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` RESEARCHER_INSTRUCTIONS`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`replace`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"{date}\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` currentDate)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tools`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [tavilySearch]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`};`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`export`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` agent `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` defineDeepAgent`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` name`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"deep-research\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` model`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"anthropic:claude-sonnet-5-5\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tools`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [tavilySearch]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` subagents`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [researchSubAgent]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` middleware`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`todoListMiddleware`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})}),_jsx(Tab,{title:`Gemini`,id:`gemini-2`,children:_jsx(CodeBlock,{filename:`agent.ts`,numberOfLines:`58`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`58`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` defineDeepAgent `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"managed-deepagents\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` todoListMiddleware `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"langchain\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tavilySearch `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"./tools/search\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` currentDate `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#CBA6F7`,\"--shiki-dark-font-weight\":`bold`},children:` new`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` Date`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`toISOString`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`split`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"T\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)[`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`0`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` RESEARCHER_INSTRUCTIONS `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `You are a research assistant conducting research on the user's input topic. For context, today's date is {date}.\"})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Your job is to use tools to gather information about the user's input topic.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`You can use the tavily_search tool to find resources that can help answer the research question.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`You can call it in series or in parallel, your research is conducted in a tool-calling loop.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`You have access to the tavily_search tool for conducting web searches.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Think like a human researcher with limited time. Follow these steps:`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`1. **Read the question carefully** - What specific information does the user need?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`2. **Start with broader searches** - Use broad, comprehensive queries first`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`3. **After each search, pause and assess** - Do I have enough to answer? What's still missing?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`4. **Execute narrower searches as you gather information** - Fill in the gaps`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`5. **Stop when you can answer confidently** - Don't keep searching for perfection`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**Tool Call Budgets** (Prevent excessive searching):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Simple queries**: Use 2-3 search tool calls maximum`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Complex queries**: Use up to 5 search tool calls maximum`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Always stop**: After 5 search tool calls if you cannot find the right sources`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**Stop Immediately When**:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- You can answer the user's question comprehensively`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- You have 3+ relevant examples/sources for the question`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Your last 2 searches returned similar information`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`After each search, assess results before continuing: What key information did I find? What's missing? Do I have enough to answer? Should I search more or provide my answer?`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`When providing your findings back to the orchestrator:`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`1. **Structure your response**: Organize findings with clear headings and detailed explanations`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`2. **Cite sources inline**: Use [1], [2], [3] format when referencing information from your searches`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`3. **Include Sources section**: End with ### Sources listing each numbered source with title and URL`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`The orchestrator will consolidate citations from all sub-agents into the final report.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` researchSubAgent `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` name`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"research-agent\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` description`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Delegate research to the sub-agent. Give one topic at a time.\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` systemPrompt`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` RESEARCHER_INSTRUCTIONS`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`replace`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"{date}\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` currentDate)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tools`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [tavilySearch]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`};`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`export`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` agent `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` defineDeepAgent`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` name`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"deep-research\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` model`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"google:gemini-3-pro-preview\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tools`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [tavilySearch]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` subagents`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [researchSubAgent]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` middleware`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`todoListMiddleware`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})})]})]})]}),_jsx(Heading,{level:`3`,id:`run-the-agent`,children:`Run the agent`}),_jsxs(Steps,{children:[_jsxs(Step,{title:`Run locally`,children:[_jsx(_components.p,{children:`Install dependencies and start the agent:`}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`npm`,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`npm`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` install`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`npx`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` mda`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` dev`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`pnpm`,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`pnpm`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` install`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`pnpm`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` exec`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` mda`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` dev`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`bun`,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`bun`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` install`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`bunx`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` mda`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` dev`})]}),`\n`]})})})]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`mda dev`}),` loads API keys from `,_jsx(_components.code,{children:`.env`}),`, starts a local Agent Server, and opens the agent in LangSmith Studio.`]}),_jsx(_components.p,{children:`In Studio, send a research question such as:`}),_jsx(CodeBlock,{filename:``,wrap:`true`,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Compare the main approaches to context engineering for AI agents in 2025.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsxs(_components.p,{children:[`You should see the orchestrator plan with `,_jsx(_components.code,{children:`write_todos`}),`, delegate to the research sub-agent, and write a report. For more information, see `,_jsx(_components.a,{href:`/langsmith/javascript/managed-deep-agents-local-development`,children:`Develop locally with LangSmith Studio`}),`.`]})]}),_jsxs(Step,{title:`Deploy (optional)`,children:[_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`npm`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`npx`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` mda`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deploy`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`pnpm`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`pnpm`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` exec`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` mda`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deploy`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`bun`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`bunx`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` mda`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deploy`})]}),`\n`]})})})]}),_jsxs(_components.p,{children:[`On success, the CLI prints the deployment dashboard URL. See `,_jsx(_components.a,{href:`/langsmith/javascript/managed-deep-agents-deploy`,children:`Deploy`}),`.`]})]})]})]}),_jsxs(Tab,{title:`Deep Agents SDK`,id:`deep-agents-sdk`,\"data-child-tab-ids\":`[\"claude-3\",\"gemini-3\",\"claude-4\",\"gemini-4\",\"claude-5\",\"gemini-5\",\"run-synchronously\",\"stream-updates\"]`,\"data-child-heading-ids\":`[\"setup-2\",\"build-the-agent-2\",\"run-the-agent-2\",\"full-code\"]`,children:[_jsx(Heading,{level:`3`,id:`setup-2`,children:`Setup`}),_jsxs(Steps,{children:[_jsx(Step,{title:`Create project directory`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`mkdir`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deep-research-agent`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D20F39`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F38BA8`,\"--shiki-dark-font-style\":`italic`},children:`cd`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deep-research-agent`})]}),`\n`]})})})}),_jsx(Step,{title:`Install dependencies`,children:_jsxs(Tabs,{children:[_jsx(Tab,{title:`Claude`,id:`claude-3`,children:_jsx(CodeBlock,{filename:`npm`,wrap:`true`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`npm`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` install`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deepagents`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` langchain`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` @langchain/anthropic`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` @langchain/core`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` zod`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` tsx`})]}),`\n`]})})})}),_jsx(Tab,{title:`Gemini`,id:`gemini-3`,children:_jsx(CodeBlock,{filename:`npm`,wrap:`true`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`npm`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` install`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` deepagents`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` langchain`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` @langchain/google`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` @langchain/core`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` zod`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` tsx`})]}),`\n`]})})})})]})}),_jsx(Step,{title:`Set API keys`,children:_jsxs(Tabs,{children:[_jsx(Tab,{title:`Claude`,id:`claude-4`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`export`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` ANTHROPIC_API_KEY`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"your_anthropic_api_key\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`export`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` TAVILY_API_KEY`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"your_tavily_api_key\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`export`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` LANGSMITH_API_KEY`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"your_langsmith_api_key\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#9399B2`,\"--shiki-dark-font-style\":`italic`},children:` # Optional`})]}),`\n`]})})})}),_jsx(Tab,{title:`Gemini`,id:`gemini-4`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`export`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` GOOGLE_API_KEY`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"your_google_api_key\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`export`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` TAVILY_API_KEY`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"your_tavily_api_key\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`export`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` LANGSMITH_API_KEY`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"your_langsmith_api_key\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#9399B2`,\"--shiki-dark-font-style\":`italic`},children:` # Optional`})]}),`\n`]})})})})]})})]}),_jsx(Heading,{level:`3`,id:`build-the-agent-2`,children:`Build the agent`}),_jsxs(_components.p,{children:[`Create `,_jsx(_components.code,{children:`agent.ts`}),` in your project directory:`]}),_jsxs(Steps,{children:[_jsxs(Step,{title:`Add tools`,children:[_jsxs(_components.p,{children:[`Add the custom search tool. The `,_jsx(_components.code,{children:`tavily_search`}),` tool uses Tavily for URL discovery, then fetches full webpage content so the agent can analyze complete sources instead of summaries.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`82`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`82`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tool `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"langchain\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` z `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"zod\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`async`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` function`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` fetchWebpageContent`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E64553`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#EBA0AC`,\"--shiki-dark-font-style\":`italic`},children:` url`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` string`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E64553`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#EBA0AC`,\"--shiki-dark-font-style\":`italic`},children:` timeout`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` =`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 10_000`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`)`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F9E2AF`,\"--shiki-dark-font-style\":`italic`},children:` Promise`}),_jsx(_components.span,{style:{color:`#04A5E5`,\"--shiki-dark\":`#89DCEB`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`string`}),_jsx(_components.span,{style:{color:`#04A5E5`,\"--shiki-dark\":`#89DCEB`},children:`>`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` try`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` controller `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#CBA6F7`,\"--shiki-dark-font-weight\":`bold`},children:` new`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` AbortController`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` id `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` setTimeout`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` =>`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` controller`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`abort`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` timeout)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` response `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` fetch`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(url`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` headers`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"User-Agent\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` signal`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` controller`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`signal`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` clearTimeout`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(id)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` if`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`!`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`response`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`ok) `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` return`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `Error fetching \"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`url`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`: HTTP `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`response`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`status`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` return`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` response`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`text`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` catch`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (e) `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` return`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `Error fetching \"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`url`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`: `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`e`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tavilySearch `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` tool`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` async`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` query`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxResults `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 1`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` topic `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"general\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`: `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` query`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` string;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxResults`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`?:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` number;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` topic`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`?:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"general\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` |`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"news\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` |`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"finance\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`) `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=>`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` response `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` fetch`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"https://api.tavily.com/search\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` method`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` headers`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` Authorization`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`process`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`env`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`TAVILY_API_KEY`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` body`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` JSON`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`stringify`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` query`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` max_results`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxResults`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` topic `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` data `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`await`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` response`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`json`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()) `}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`as`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` results`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F9E2AF`,\"--shiki-dark-font-style\":`italic`},children:` Array`}),_jsx(_components.span,{style:{color:`#04A5E5`,\"--shiki-dark\":`#89DCEB`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#CDD6F4`,\"--shiki-dark-font-style\":`italic`},children:` url`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` string`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#CDD6F4`,\"--shiki-dark-font-style\":`italic`},children:` title`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` string`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#04A5E5`,\"--shiki-dark\":`#89DCEB`},children:`>`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` };`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` results `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` data`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`results `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`??`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` []`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` resultTexts`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` string`}),_jsx(_components.span,{style:{color:`#DF8E1D`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F9E2AF`,\"--shiki-dark-font-style\":`italic`},children:`[] `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` []`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` for`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` result `}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`of`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` results) `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` content `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` fetchWebpageContent`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(result`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`url)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` resultTexts`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`push`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `## \"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`result`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`title`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**URL:** `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`result`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`url`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`content`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"---`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` )`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` return`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `Found \"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`resultTexts`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`length`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` result(s) for '`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:\"${\"}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`query`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`':`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` +`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` resultTexts`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`join`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` )`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` name`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"tavily_search\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` description`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Search the web for information on a given query. Uses Tavily to discover relevant URLs, then fetches and returns full webpage content.\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` schema`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` z`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`object`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` query`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` z`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`string`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`describe`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"Search query to execute\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxResults`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` z`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`number`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`optional`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`default`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`1`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`describe`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"Maximum number of results to return (default: 1)\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` topic`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` z`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`enum`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`([`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"general\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"news\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"finance\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`optional`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`default`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"general\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` .`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`describe`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Topic filter - 'general', 'news', or 'finance' (default: 'general')\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` )`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})]}),_jsxs(Step,{title:`Create the agent`,children:[_jsxs(_components.p,{children:[`Below the tools, add the prompt constants and then create the agent. The three constants (`,_jsx(_components.code,{children:`RESEARCH_WORKFLOW_INSTRUCTIONS`}),`, `,_jsx(_components.code,{children:`RESEARCHER_INSTRUCTIONS`}),`, and `,_jsx(_components.code,{children:`SUBAGENT_DELEGATION_INSTRUCTIONS`}),`) must live in the same file as the `,_jsx(_components.code,{children:`create_deep_agent`}),` / `,_jsx(_components.code,{children:`createDeepAgent`}),` call. `,_jsx(_components.a,{href:`https://reference.langchain.com/javascript/langchain/index/todoListMiddleware`,children:_jsx(_components.code,{children:`TodoListMiddleware`})}),` is opt-in `,_jsx(_components.a,{href:`/oss/javascript/deepagents/overview#task-planning`,children:`task planning`}),` so the agent can call `,_jsx(_components.code,{children:`write_todos`}),`.`]}),_jsxs(_components.p,{children:[`Add the prompts to `,_jsx(_components.code,{children:`agent.ts`}),`:`]}),_jsx(CodeBlock,{filename:``,wrap:`true`,expandable:`true`,numberOfLines:`63`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`63`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` RESEARCH_WORKFLOW_INSTRUCTIONS `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `# Research Workflow\"})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Follow this workflow for all research requests:`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`1. **Plan**: Create a todo list with write_todos to break down the research into focused tasks`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`2. **Save the request**: Use write_file() to save the user's research question to `}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:\"\\\\`\"}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`/research_request.md`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:\"\\\\`\"})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`3. **Research**: Delegate research tasks to sub-agents using the task() tool - ALWAYS use sub-agents for research, never conduct research yourself`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`4. **Synthesize**: Review all sub-agent findings and consolidate citations (each unique URL gets one number across all findings)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`5. **Write Report**: Write a comprehensive final report to `}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:\"\\\\`\"}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`/final_report.md`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:\"\\\\`\"}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` (see Report Writing Guidelines below)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`6. **Verify**: Read `}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:\"\\\\`\"}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`/research_request.md`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:\"\\\\`\"}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` and confirm you've addressed all aspects with proper citations and structure`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`## Research Planning Guidelines`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Batch similar research tasks into a single TODO to minimize overhead`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- For simple fact-finding questions, use 1 sub-agent`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- For comparisons or multi-faceted topics, delegate to multiple parallel sub-agents`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Each sub-agent should research one specific aspect and return findings`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`## Report Writing Guidelines`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`When writing the final report to `}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:\"\\\\`\"}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`/final_report.md`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:\"\\\\`\"}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`, follow these structure patterns:`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**For comparisons:**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`1. Introduction`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`2. Overview of topic A`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`3. Overview of topic B`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`4. Detailed comparison`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`5. Conclusion`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**For lists/rankings:**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Simply list items with details - no introduction needed:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`1. Item 1 with explanation`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`2. Item 2 with explanation`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`3. Item 3 with explanation`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**For summaries/overviews:**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`1. Overview of topic`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`2. Key concept 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`3. Key concept 2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`4. Key concept 3`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`5. Conclusion`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**General guidelines:**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Use clear section headings (## for sections, ### for subsections)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Write in paragraph form by default - be text-heavy, not just bullet points`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Do NOT use self-referential language (\"I found...\", \"I researched...\")`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Write as a professional report without meta-commentary`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Each section should be comprehensive and detailed`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Use bullet points only when listing is more appropriate than prose`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**Citation format:**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Cite sources inline using [1], [2], [3] format`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Assign each unique URL a single citation number across ALL sub-agent findings`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- End report with ### Sources section listing each numbered source`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Number sources sequentially without gaps (1,2,3,4...)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Format: [1] Source Title: URL (each on separate line for proper list rendering)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Example:`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` Some important finding [1]. Another key insight [2].`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` ### Sources`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` [1] AI Research Paper: https://example.com/paper`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` [2] Industry Analysis: https://example.com/analysis`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:``,wrap:`true`,expandable:`true`,numberOfLines:`44`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`44`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` RESEARCHER_INSTRUCTIONS `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `You are a research assistant conducting research on the user's input topic. For context, today's date is {date}.\"})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Your job is to use tools to gather information about the user's input topic.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`You can use the tavily_search tool to find resources that can help answer the research question.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`You can call it in series or in parallel, your research is conducted in a tool-calling loop.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`You have access to the tavily_search tool for conducting web searches.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Think like a human researcher with limited time. Follow these steps:`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`1. **Read the question carefully** - What specific information does the user need?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`2. **Start with broader searches** - Use broad, comprehensive queries first`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`3. **After each search, pause and assess** - Do I have enough to answer? What's still missing?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`4. **Execute narrower searches as you gather information** - Fill in the gaps`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`5. **Stop when you can answer confidently** - Don't keep searching for perfection`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**Tool Call Budgets** (Prevent excessive searching):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Simple queries**: Use 2-3 search tool calls maximum`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Complex queries**: Use up to 5 search tool calls maximum`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Always stop**: After 5 search tool calls if you cannot find the right sources`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**Stop Immediately When**:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- You can answer the user's question comprehensively`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- You have 3+ relevant examples/sources for the question`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Your last 2 searches returned similar information`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`After each search, assess results before continuing: What key information did I find? What's missing? Do I have enough to answer? Should I search more or provide my answer?`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`When providing your findings back to the orchestrator:`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`1. **Structure your response**: Organize findings with clear headings and detailed explanations`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`2. **Cite sources inline**: Use [1], [2], [3] format when referencing information from your searches`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`3. **Include Sources section**: End with ### Sources listing each numbered source with title and URL`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Example:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`## Key Findings`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Context engineering is a critical technique for AI agents [1]. Studies show that proper context management can improve performance by 40% [2].`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`### Sources`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`[1] Context Engineering Guide: https://example.com/context-guide`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`[2] AI Performance Study: https://example.com/study`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`The orchestrator will consolidate citations from all sub-agents into the final report.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:``,wrap:`true`,expandable:`true`,numberOfLines:`36`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`36`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` SUBAGENT_DELEGATION_INSTRUCTIONS `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\" `# Sub-Agent Research Coordination\"})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`Your role is to coordinate research by delegating tasks from your TODO list to specialized research sub-agents.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`## Delegation Strategy`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**DEFAULT: Start with 1 sub-agent** for most queries:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- \"What is quantum computing?\" -> 1 sub-agent (general overview)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- \"List the top 10 coffee shops in San Francisco\" -> 1 sub-agent`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- \"Summarize the history of the internet\" -> 1 sub-agent`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- \"Research context engineering for AI agents\" -> 1 sub-agent (covers all aspects)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**ONLY parallelize when the query EXPLICITLY requires comparison or has clearly independent aspects:**`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**Explicit comparisons** -> 1 sub-agent per element:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- \"Compare OpenAI vs Anthropic vs DeepMind AI safety approaches\" -> 3 parallel sub-agents`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- \"Compare Python vs JavaScript for web development\" -> 2 parallel sub-agents`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`**Clearly separated aspects** -> 1 sub-agent per aspect (use sparingly):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- \"Research renewable energy adoption in Europe, Asia, and North America\" -> 3 parallel sub-agents (geographic separation)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Only use this pattern when aspects cannot be covered efficiently by a single comprehensive search`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`## Key Principles`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Bias towards single sub-agent**: One comprehensive research task is more token-efficient than multiple narrow ones`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Avoid premature decomposition**: Don't break \"research X\" into \"research X overview\", \"research X techniques\", \"research X applications\" - just use 1 sub-agent for all of X`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- **Parallelize only for clear comparisons**: Use multiple sub-agents when comparing distinct entities or geographically separated data`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`## Parallel Execution Limits`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Use at most {maxConcurrentResearchUnits} parallel sub-agents per iteration`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Make multiple task() calls in a single response to enable parallel execution`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Each sub-agent returns findings independently`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`## Research Limits`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Stop after {maxResearcherIterations} delegation rounds if you haven't found adequate sources`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`- Stop when you have sufficient information to answer comprehensively`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:\"- Bias towards focused research over exhaustive exploration`\"}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})}),_jsx(_components.p,{children:`Then add the model and agent. Choose your provider:`}),_jsxs(Tabs,{children:[_jsx(Tab,{title:`Claude`,id:`claude-5`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`37`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`37`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` createDeepAgent `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"deepagents\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` ChatAnthropic `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"@langchain/anthropic\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` todoListMiddleware `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"langchain\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxConcurrentResearchUnits `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 3`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxResearcherIterations `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 3`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` currentDate `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#CBA6F7`,\"--shiki-dark-font-weight\":`bold`},children:` new`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` Date`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`toISOString`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`split`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"T\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)[`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`0`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` INSTRUCTIONS `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` RESEARCH_WORKFLOW_INSTRUCTIONS `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`+`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` +`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"=\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`repeat`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`80`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`) `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`+`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` +`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` SUBAGENT_DELEGATION_INSTRUCTIONS`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`replace`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"{maxConcurrentResearchUnits}\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` String`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(maxConcurrentResearchUnits)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` )`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`replace`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"{maxResearcherIterations}\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` String`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(maxResearcherIterations))`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` researchSubAgent `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` name`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"research-agent\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` description`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Delegate research to the sub-agent. Give one topic at a time.\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` systemPrompt`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` RESEARCHER_INSTRUCTIONS`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`replace`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"{date}\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` currentDate)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tools`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [tavilySearch]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`};`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` model `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#CBA6F7`,\"--shiki-dark-font-weight\":`bold`},children:` new`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` ChatAnthropic`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` model`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"claude-sonnet-5-5\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` agent `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` createDeepAgent`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` model`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tools`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [tavilySearch]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` systemPrompt`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` INSTRUCTIONS`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` subagents`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [researchSubAgent]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` middleware`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`todoListMiddleware`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})}),_jsx(Tab,{title:`Gemini`,id:`gemini-5`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`38`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`38`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` createDeepAgent `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"deepagents\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` ChatGoogle `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"@langchain/google/node\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`import`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` todoListMiddleware `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` from`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"langchain\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxConcurrentResearchUnits `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 3`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` maxResearcherIterations `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 3`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` currentDate `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#CBA6F7`,\"--shiki-dark-font-weight\":`bold`},children:` new`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` Date`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`toISOString`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`split`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"T\"`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)[`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`0`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` INSTRUCTIONS `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` RESEARCH_WORKFLOW_INSTRUCTIONS `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`+`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` +`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"=\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`repeat`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:`80`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`) `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`+`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"`}),_jsx(_components.span,{style:{color:`#EA76CB`,\"--shiki-dark\":`#F5C2E7`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` +`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` SUBAGENT_DELEGATION_INSTRUCTIONS`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`replace`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"{maxConcurrentResearchUnits}\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` String`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(maxConcurrentResearchUnits)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` )`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`replace`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"{maxResearcherIterations}\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` String`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(maxResearcherIterations))`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` researchSubAgent `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` name`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"research-agent\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` description`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Delegate research to the sub-agent. Give one topic at a time.\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` systemPrompt`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` RESEARCHER_INSTRUCTIONS`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`replace`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:`\"{date}\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` currentDate)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tools`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [tavilySearch]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`};`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` model `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#CBA6F7`,\"--shiki-dark-font-weight\":`bold`},children:` new`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` ChatGoogle`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` model`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"gemini-3-pro-preview\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` temperature`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 0`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` agent `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` createDeepAgent`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` model`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` tools`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [tavilySearch]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` systemPrompt`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` INSTRUCTIONS`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` subagents`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [researchSubAgent]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` middleware`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`todoListMiddleware`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`]})})})})]})]})]}),_jsx(Heading,{level:`3`,id:`run-the-agent-2`,children:`Run the agent`}),_jsx(_components.p,{children:`You can run the agent synchronously, meaning it will wait for the full result and then print it, or you can stream updates as they come in.`}),_jsxs(_components.p,{children:[`Add the code from the respective tab at the bottom of `,_jsx(_components.code,{children:`agent.ts`}),`:`]}),_jsxs(Tabs,{children:[_jsx(Tab,{title:`Run synchronously`,value:`sync`,id:`run-synchronously`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`24`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` async`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` function`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` main`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`()`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` result `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` agent`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`invoke`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` messages`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` role`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` content`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"What are the main differences between RAG and fine-tuning for LLM applications?\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` ]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` for`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` msg `}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`of`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` result`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`messages `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`??`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` []) `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` if`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (msg`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`content) `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` console`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`log`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(msg`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`content)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` main`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`catch`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#E64553`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#EBA0AC`,\"--shiki-dark-font-style\":`italic`},children:`err`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`)`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` =>`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` console`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`error`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(err)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` process`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`exitCode `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 1`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`})}),`\n`]})})})}),_jsx(Tab,{title:`Stream updates`,value:`stream`,id:`stream-updates`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`25`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`25`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` async`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` function`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` main`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`()`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` stream `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` agent`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`streamEvents`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` messages`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` role`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` content`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"Compare Python vs JavaScript for web development\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` ]`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` version`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`:`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` \"v3\"`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` )`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` for`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` message `}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`of`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` stream`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`messages) `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` for`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:` await`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` (`}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`const`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` token `}),_jsx(_components.span,{style:{color:`#8839EF`,\"--shiki-dark\":`#CBA6F7`},children:`of`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` message`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`text) `}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` process`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`stdout`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`write`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(token)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:` main`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`()`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`catch`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`(`}),_jsx(_components.span,{style:{color:`#E64553`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#EBA0AC`,\"--shiki-dark-font-style\":`italic`},children:`err`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`)`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:` =>`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` console`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`error`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`(err)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:` process`}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`.`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`exitCode `}),_jsx(_components.span,{style:{color:`#179299`,\"--shiki-dark\":`#94E2D5`},children:`=`}),_jsx(_components.span,{style:{color:`#FE640B`,\"--shiki-dark\":`#FAB387`},children:` 1`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:` }`}),_jsx(_components.span,{style:{color:`#4C4F69`,\"--shiki-dark\":`#CDD6F4`},children:`)`}),_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#7C7F93`,\"--shiki-dark\":`#9399B2`},children:`}`})}),`\n`]})})})})]}),_jsx(_components.p,{children:`Run the agent from the project root:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes catppuccin-latte catppuccin-mocha`,style:{backgroundColor:`#eff1f5`,\"--shiki-dark-bg\":`#1e1e2e`,color:`#4c4f69`,\"--shiki-dark\":`#cdd6f4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1E66F5`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#89B4FA`,\"--shiki-dark-font-style\":`italic`},children:`npx`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` tsx`}),_jsx(_components.span,{style:{color:`#40A02B`,\"--shiki-dark\":`#A6E3A1`},children:` agent.ts`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`If you set the `,_jsx(_components.code,{children:`LANGSMITH_API_KEY`}),` environment variable before running, you can view the agent’s traces in `,_jsx(_components.a,{href:`/langsmith/observability`,children:`LangSmith`}),` to debug and monitor multi-step behavior.`]}),_jsx(Heading,{level:`3`,id:`full-code`,children:`Full code`}),_jsxs(_components.p,{children:[`View the complete `,_jsx(_components.a,{href:`https://github.com/langchain-ai/deepagents/tree/main/examples/deep_research`,children:`Deep Research example`}),` on GitHub.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),`\n`,_jsxs(_components.p,{children:[`Now that you’ve built the agent, customize the workflow by editing the orchestrator instructions (Managed Deep Agents: `,_jsx(_components.code,{children:`instructions.md`}),`; SDK: prompt constants in your agent file). You can also tune the delegation limits to allow more parallel sub-agents or delegation rounds.`]}),`\n`,_jsx(_components.p,{children:`For more information on the concepts in this tutorial, see:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/oss/javascript/deepagents/subagents`,children:`Subagents`}),`: Configure subagents with different tools and prompts`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/oss/javascript/deepagents/customization`,children:`Customization`}),`: Customize models, tools, system prompts, and optional `,_jsx(_components.a,{href:`/oss/javascript/deepagents/overview#task-planning`,children:`task planning`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/langsmith/javascript/managed-deep-agents-overview`,children:`Managed Deep Agents`}),`: Build deep agents with managed deployment infrastructure`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/langsmith/observability`,children:`LangSmith`}),`: Trace research runs and debug multi-step behavior`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`https://academy.langchain.com/courses/deep-research-with-langgraph`,children:`Deep Research Course`}),`: Full course on deep research with LangGraph`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsxs(`div`,{className:`source-links`,children:[_jsx(Callout,{icon:`terminal-2`,children:_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/use-these-docs`,children:`Connect these docs`}),` to your agent of choice via MCP for real-time answers.`]})}),_jsx(Callout,{icon:`edit`,children:_jsxs(_components.p,{children:[_jsx(_components.a,{href:`https://github.com/langchain-ai/docs/edit/main/src/oss/deepagents/deep-research.mdx`,children:`Edit this page on GitHub`}),` or `,_jsx(_components.a,{href:`https://github.com/langchain-ai/docs/issues/new/choose`,children:`file an issue`}),`.`]})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}},"config":{},"pageMetadata":{"title":"Build a deep research agent","sidebarTitle":"Deep Research","description":"Build a multi-step web research agent with subagent delegation using Managed Deep Agents or the Deep Agents SDK","href":"/oss/javascript/deepagents/deep-research"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[{"title":"Key concepts","slug":"key-concepts","depth":3,"children":[]}]},{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"Choose your path","slug":"choose-your-path","depth":2,"children":[{"title":"Setup","slug":"setup","depth":3,"children":[],"tabId":"managed-deep-agents"},{"title":"Build the agent","slug":"build-the-agent","depth":3,"children":[],"tabId":"managed-deep-agents"},{"title":"Run the agent","slug":"run-the-agent","depth":3,"children":[],"tabId":"managed-deep-agents"},{"title":"Setup","slug":"setup-2","depth":3,"children":[],"tabId":"deep-agents-sdk"},{"title":"Build the agent","slug":"build-the-agent-2","depth":3,"children":[],"tabId":"deep-agents-sdk"},{"title":"Run the agent","slug":"run-the-agent-2","depth":3,"children":[],"tabId":"deep-agents-sdk"},{"title":"Full code","slug":"full-code","depth":3,"children":[],"tabId":"deep-agents-sdk"}]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/langchain-5e9cc07a/8e2bdc5fa13bae3b/language-toggle.js","/_mintlify/custom/langchain-5e9cc07a/e53df5e6c631412e/ChatLangChainEmbed.js","/_mintlify/custom/langchain-5e9cc07a/de0c938f8f025ce1/integration-downloads-table.js","/_mintlify/custom/langchain-5e9cc07a/bf5a14ed20580d69/default-changelog-filter.js","/_mintlify/custom/langchain-5e9cc07a/2b68992dd6b93a5a/changelog-navigation.js"],"subdomain":"langchain-5e9cc07a","siteName":"Docs by LangChain","title":"Build a deep research agent - Docs by LangChain","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-12-01T00:58:34.359Z","originalFileLocation":"oss/javascript/deepagents/deep-research.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Build a multi-step web research agent with subagent delegation using Managed Deep Agents or the Deep Agents SDK\">\u003cmeta data-mint-head name=\"application-name\" content=\"Docs by LangChain\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Build a deep research agent - Docs by LangChain\">\u003cmeta data-mint-head property=\"og:description\" content=\"Build a multi-step web research agent with subagent delegation using Managed Deep Agents or the Deep Agents SDK\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Docs by LangChain\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.langchain.com/oss/javascript/deepagents/deep-research\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://langchain-5e9cc07a.mintlify.site/_mintlify/api/og/v2?division=Deep+Agents\u0026amp;title=Build+a+deep+research+agent\u0026amp;description=Build+a+multi-step+web+research+agent+with+subagent+delegation+using+Managed+Deep+Agents+or+the+Deep+Agents+SDK\u0026amp;theme=f35197f94eda06999e44c5f5\u0026amp;signature=308cc7d492ef0e294cf268eab86f2fa04710c5f625ded352c238ef6b2e34782e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Build a deep research agent - Docs by LangChain\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Build a multi-step web research agent with subagent delegation using Managed Deep Agents or the Deep Agents SDK\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://langchain-5e9cc07a.mintlify.site/_mintlify/api/og/v2?division=Deep+Agents\u0026amp;title=Build+a+deep+research+agent\u0026amp;description=Build+a+multi-step+web+research+agent+with+subagent+delegation+using+Managed+Deep+Agents+or+the+Deep+Agents+SDK\u0026amp;theme=f35197f94eda06999e44c5f5\u0026amp;signature=308cc7d492ef0e294cf268eab86f2fa04710c5f625ded352c238ef6b2e34782e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/langchain-5e9cc07a/YSQua9Gt91yRswvJ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Docs by LangChain\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#161F34\">\u003cmeta data-mint-head name=\"google-site-verification\" content=\"9_2KHeJwmEdwgncBRk1MsKxriZz7Sc21EJdbfCxkTEo\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.langchain.com/oss/javascript/deepagents/deep-research\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/oss/javascript/deepagents/deep-research.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.langchain.com/#organization\",\"name\":\"Docs by LangChain\",\"url\":\"https://docs.langchain.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/langchain-5e9cc07a/nQm-sjd_MByLhgeW/images/brand/langchain-docs-dark-blue.png?fit=max\u0026auto=format\u0026n=nQm-sjd_MByLhgeW\u0026q=85\u0026s=5babf1a1962208fd7eed942fa2432ecb\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.langchain.com#website\",\"name\":\"Docs by LangChain\",\"url\":\"https://docs.langchain.com\",\"publisher\":{\"@id\":\"https://docs.langchain.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.langchain.com/oss/javascript/deepagents/deep-research#webpage\",\"url\":\"https://docs.langchain.com/oss/javascript/deepagents/deep-research\",\"name\":\"Build a deep research agent\",\"description\":\"Build a multi-step web research agent with subagent delegation using Managed Deep Agents or the Deep Agents SDK\",\"dateModified\":\"2026-12-01T00:58:34.359Z\",\"isPartOf\":{\"@id\":\"https://docs.langchain.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.langchain.com/oss/javascript/deepagents/deep-research#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.langchain.com/oss/javascript/deepagents/deep-research#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Docs by LangChain\",\"item\":\"https://docs.langchain.com\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build a deep research agent\",\"item\":\"https://docs.langchain.com/oss/javascript/deepagents/deep-research\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.langchain.com/oss/javascript/deepagents/deep-research#article\",\"headline\":\"Build a deep research agent\",\"name\":\"Build a deep research agent\",\"description\":\"Build a multi-step web research agent with subagent delegation using Managed Deep Agents or the Deep Agents SDK\",\"url\":\"https://docs.langchain.com/oss/javascript/deepagents/deep-research\",\"mainEntityOfPage\":{\"@id\":\"https://docs.langchain.com/oss/javascript/deepagents/deep-research#webpage\"},\"dateModified\":\"2026-12-01T00:58:34.359Z\",\"publisher\":{\"@id\":\"https://docs.langchain.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.langchain.com#website\"}}]}\u003c/script>","agentPointerHref":"/oss/javascript/deepagents/deep-research.md","siteName":"Docs by LangChain","nav":{"global":null,"products":[{"product":"AGENT RUNTIME","menu":[{"item":"No-code agents","icon":"wand","description":"Build agents without code","tabs":[{"tab":"Studio","pages":[{"title":"Build an agent with LangSmith Studio","sidebarTitle":"Build an agent","href":"/langsmith/build-an-agent"}]},{"tab":"Fleet","pages":[{"title":"No-code agents with LangSmith Fleet","sidebarTitle":"Overview","mode":"wide","href":"/langsmith/fleet"},{"group":"Get started","pages":[{"title":"Quickstart","href":"/langsmith/fleet/quickstart"},{"title":"Essentials","href":"/langsmith/fleet/essentials"},{"title":"Templates","href":"/langsmith/fleet/templates"},{"title":"Agent platform comparison","sidebarTitle":"Compare","href":"/langsmith/fleet/comparison"}]},{"group":"Configure","pages":[{"title":"Manage workspace administration","sidebarTitle":"Workspace admin","href":"/langsmith/fleet/workspace-admin"},{"title":"Agent identity","href":"/langsmith/fleet/agent-identity"},{"title":"Manage agent settings","sidebarTitle":"Agent settings","href":"/langsmith/fleet/manage-agent-settings"},{"title":"Computer use","href":"/langsmith/fleet/computer-use"}]},{"group":"Tools and automation","pages":[{"title":"Tool integrations","sidebarTitle":"Tools","mode":"wide","href":"/langsmith/fleet/tools"},{"title":"Channels","href":"/langsmith/fleet/channels"},{"title":"Schedules","href":"/langsmith/fleet/schedules"},{"title":"Skills","href":"/langsmith/fleet/skills"},{"title":"Integrate Slack with an agent","sidebarTitle":"Slack","href":"/langsmith/fleet/slack-app"},{"title":"Integrate Microsoft Teams with an agent","sidebarTitle":"Microsoft Teams","href":"/langsmith/fleet/teams-app"},{"title":"Remote MCP servers","href":"/langsmith/fleet/remote-mcp-servers"},{"title":"Arcade integration","sidebarTitle":"Arcade","href":"/langsmith/fleet/arcade"},{"title":"Salesforce integration","sidebarTitle":"Salesforce","href":"/langsmith/fleet/salesforce"}]},{"group":"Advanced","pages":[{"title":"Use Fleet agents in code","sidebarTitle":"Use in code","href":"/langsmith/fleet/code"},{"title":"Call Fleet agents over MCP and A2A","sidebarTitle":"Call over MCP and A2A","href":"/langsmith/fleet/mcp-a2a-endpoints"},{"title":"LangSmith Tool Server","sidebarTitle":"MCP framework","href":"/langsmith/fleet/mcp-framework"},{"title":"Fleet webhooks","sidebarTitle":"Webhooks","href":"/langsmith/fleet/webhooks"},{"title":"Auth-aware tool responses","sidebarTitle":"Auth responses","mode":"wide","href":"/langsmith/fleet/auth-format"}]},{"group":"Additional resources","pages":[{"title":"Access \u0026 oversight","href":"/langsmith/fleet/access-and-oversight"},{"title":"Self-hosted","url":"https://docs.langchain.com/langsmith/enable-self-hosted-fleet","href":"/langsmith/fleet/self-hosted-link"},{"title":"LangSmith Fleet changelog","sidebarTitle":"Changelog","mode":"wide","href":"/langsmith/fleet/changelog"}]}]}]},{"item":"Build","icon":"hammer","description":"Build agents with open source","dropdowns":[{"dropdown":"Python","icon":{"style":"regular","name":"brand-python"},"tabs":[{"tab":"Overview","pages":[{"title":"Build","sidebarTitle":"Overview","mode":"custom","icon":"hammer","href":"/build-overview"}]},{"tab":"Managed Deep Agents","pages":[{"group":"Get started","tag":"BETA","pages":[{"title":"Managed Deep Agents","sidebarTitle":"Overview","href":"/langsmith/python/managed-deep-agents-overview"},{"title":"Managed Deep Agents quickstart","sidebarTitle":"Quickstart","href":"/langsmith/python/managed-deep-agents-quickstart"},{"title":"Managed Deep Agents project structure","sidebarTitle":"Project structure","href":"/langsmith/python/managed-deep-agents-project-structure"},{"title":"Move from Deep Agents to Managed Deep Agents","sidebarTitle":"Move from Deep Agents","href":"/langsmith/python/managed-deep-agents-migrate"}]},{"group":"Agent capabilities","pages":[{"title":"Define a Managed Deep Agent","sidebarTitle":"Agent definition","href":"/langsmith/python/managed-deep-agents-agent-definition"},{"title":"Add instructions to Managed Deep Agents","sidebarTitle":"Instructions","href":"/langsmith/python/managed-deep-agents-instructions"},{"title":"Add skills to Managed Deep Agents","sidebarTitle":"Skills","href":"/langsmith/python/managed-deep-agents-skills"},{"title":"Add custom tools to Managed Deep Agents","sidebarTitle":"Tools","href":"/langsmith/python/managed-deep-agents-tools"},{"title":"Web search","sidebarTitle":"Web search","href":"/langsmith/python/managed-deep-agents-search"},{"title":"Manage connections","sidebarTitle":"Connections","href":"/langsmith/python/managed-deep-agents-connections"},{"title":"Connect to MCP servers","sidebarTitle":"MCP","href":"/langsmith/python/managed-deep-agents-mcp-connectors"},{"title":"Add custom middleware to Managed Deep Agents","sidebarTitle":"Middleware","href":"/langsmith/python/managed-deep-agents-middleware"},{"title":"Add memory to Managed Deep Agents","sidebarTitle":"Memory","href":"/langsmith/python/managed-deep-agents-memory"},{"title":"Add a sandbox to Managed Deep Agents","sidebarTitle":"Sandboxes","href":"/langsmith/python/managed-deep-agents-sandboxes"},{"title":"Browser use","sidebarTitle":"Browser use","href":"/langsmith/python/managed-deep-agents-browser-use"},{"title":"Subagents","sidebarTitle":"Subagents","href":"/langsmith/python/managed-deep-agents-subagents"},{"title":"Add identity to Managed Deep Agents","sidebarTitle":"Identity","href":"/langsmith/python/managed-deep-agents-identity"},{"group":"Channels","expanded":false,"pages":[{"title":"Connect Managed Deep Agents to channels","sidebarTitle":"Overview","href":"/langsmith/python/managed-deep-agents-channels"},{"title":"Connect a Managed Deep Agent to Slack","sidebarTitle":"Slack","href":"/langsmith/python/managed-deep-agents-channels-slack"},{"title":"Connect a Managed Deep Agent to a custom channel over HTTP","sidebarTitle":"Custom","href":"/langsmith/python/managed-deep-agents-channels-http"},{"title":"Prompt Slack users with agent-owned interrupts","sidebarTitle":"Agent-owned interrupts","href":"/langsmith/python/managed-deep-agents-agent-owned-interrupts"}]},{"title":"Add schedules to Managed Deep Agents","sidebarTitle":"Schedules","href":"/langsmith/python/managed-deep-agents-schedules"},{"title":"Evaluate Managed Deep Agents","sidebarTitle":"Evals","href":"/langsmith/python/managed-deep-agents-evals"},{"title":"Managed Deep Agents runtime","sidebarTitle":"Runtime","href":"/langsmith/python/managed-deep-agents-runtime"}]},{"group":"Patterns","pages":[{"title":"Managed Deep Agents patterns","sidebarTitle":"Overview","href":"/langsmith/python/managed-deep-agents-patterns"},{"title":"Build a daily digest agent","sidebarTitle":"Daily digest","href":"/langsmith/python/managed-deep-agents-tutorial"},{"title":"Build a Slack watch agent","sidebarTitle":"Watch mode","href":"/langsmith/python/managed-deep-agents-watch-mode"},{"title":"Work toward a goal over time","sidebarTitle":"Goals","href":"/langsmith/python/managed-deep-agents-goal-oriented"},{"title":"Dream over traces","sidebarTitle":"Dreaming","href":"/langsmith/python/managed-deep-agents-dreaming"},{"title":"Investigate an incident with a swarm","sidebarTitle":"Swarm","href":"/langsmith/python/managed-deep-agents-swarm"}]},{"group":"Build and deploy","pages":[{"title":"Develop locally with LangSmith Studio","sidebarTitle":"Local Studio","href":"/langsmith/python/managed-deep-agents-local-development"},{"title":"Deploy a Managed Deep Agent","sidebarTitle":"Deploy an agent","href":"/langsmith/python/managed-deep-agents-deploy"},{"title":"Connect MCP clients to a Managed Deep Agent","sidebarTitle":"MCP endpoint","href":"/langsmith/python/managed-deep-agents-mcp-endpoint"},{"title":"Build a custom frontend for a Managed Deep Agent","sidebarTitle":"Custom frontend","href":"/langsmith/python/managed-deep-agents-custom-frontend"},{"title":"Manage Context Hub for Managed Deep Agents","sidebarTitle":"Context Hub","href":"/langsmith/python/managed-deep-agents-context-hub"},{"title":"Managed Deep Agents CLI reference","sidebarTitle":"CLI reference","href":"/langsmith/python/managed-deep-agents-cli"},{"title":"Changelog","url":"https://github.com/langchain-ai/managed-deepagents/blob/main/CHANGELOG.md","href":"/langsmith/python/managed-deep-agents-changelog"}]},{"group":"Templates","pages":[{"title":"Deploy the open-source design agent","sidebarTitle":"Design agent","href":"/langsmith/python/managed-deep-agents-design-agent"},{"title":"Deploy the open-source paid media agent","sidebarTitle":"Paid media agent","href":"/langsmith/python/managed-deep-agents-paid-media-agent"}]}]},{"tab":"Deep Agents","pages":[{"title":"Deep Agents overview","sidebarTitle":"Overview","href":"/oss/python/deepagents/overview"},{"group":"Get started","pages":[{"title":"Quickstart","href":"/oss/python/deepagents/quickstart"},{"title":"Customize Deep Agents","sidebarTitle":"Customization","href":"/oss/python/deepagents/customization"},{"title":"Models","href":"/oss/python/deepagents/models"},{"title":"Comparison with Claude Agent SDK","sidebarTitle":"Comparison with Claude Agent SDK","href":"/oss/python/deepagents/comparison"},{"title":"Changelog","url":"https://docs.langchain.com/oss/python/releases/changelog","href":"/oss/python/deepagents/changelog-py"}]},{"group":"Deployment","pages":[{"title":"Managed Deep Agents","sidebarTitle":"Managed Deep Agents","tag":"BETA","url":"/https/docs.langchain.com/langsmith/python/managed-deep-agents-overview","href":"/langsmith/python/managed-deep-agents"},{"group":"Going to production","root":{"title":"Going to production","href":"/oss/python/deepagents/going-to-production"},"pages":[{"title":"Fault tolerance","href":"/oss/python/deepagents/fault-tolerance"}]}]},{"group":"Execution environment","expanded":true,"pages":[{"title":"Tools","href":"/oss/python/deepagents/tools"},{"title":"Backends","href":"/oss/python/deepagents/backends"},{"title":"Permissions","href":"/oss/python/deepagents/permissions"},{"title":"Multimodal inputs and outputs","sidebarTitle":"Multimodality","href":"/oss/python/deepagents/multimodal"},{"title":"Sandboxes","sidebarTitle":"Sandboxes","href":"/oss/python/deepagents/sandboxes"},{"title":"Browser use","href":"/oss/python/deepagents/browser-use"},{"title":"Interpreters","href":"/oss/python/deepagents/interpreters"},{"title":"Streaming","href":"/oss/python/deepagents/streaming"},{"title":"Event streaming","tag":"Beta","href":"/oss/python/deepagents/event-streaming"}]},{"group":"Context management","expanded":true,"pages":[{"title":"Skills","href":"/oss/python/deepagents/skills"},{"title":"Memory","href":"/oss/python/deepagents/memory"},{"title":"Retrieval","href":"/oss/python/deepagents/retrieval"},{"title":"Context engineering in Deep Agents","sidebarTitle":"Context engineering","href":"/oss/python/deepagents/context-engineering"},{"title":"Profiles","tag":"Beta","href":"/oss/python/deepagents/profiles"},{"title":"OpenWiki","sidebarTitle":"OpenWiki","url":"/https/docs.langchain.com/oss/openwiki/overview","href":"/oss/python/deepagents/openwiki"}]},{"group":"Delegation","expanded":true,"pages":[{"title":"Subagents","href":"/oss/python/deepagents/subagents"},{"title":"Dynamic subagents","href":"/oss/python/deepagents/dynamic-subagents"},{"title":"Async subagents","href":"/oss/python/deepagents/async-subagents"}]},{"group":"Steering","expanded":true,"pages":[{"title":"Human-in-the-loop","href":"/oss/python/deepagents/human-in-the-loop"},{"title":"Grading rubrics","href":"/oss/python/deepagents/rubric"}]},{"group":"Middleware","expanded":true,"pages":[{"title":"Middleware overview","sidebarTitle":"Overview","href":"/oss/python/langchain/middleware/overview"},{"title":"Prebuilt middleware","href":"/oss/python/langchain/middleware/built-in"},{"title":"Custom middleware","href":"/oss/python/langchain/middleware/custom"}]},{"group":"Frontend","pages":[{"title":"Overview","href":"/oss/python/deepagents/frontend/overview"},{"group":"Patterns","pages":[{"title":"Subagent streaming","href":"/oss/python/deepagents/frontend/subagent-streaming"},{"title":"Todo list","href":"/oss/python/deepagents/frontend/todo-list"},{"title":"Sandbox","href":"/oss/python/deepagents/frontend/sandbox"}]}]},{"group":"Protocols","pages":[{"title":"Agent Client Protocol (ACP)","href":"/oss/python/deepagents/acp"},{"title":"Model Context Protocol","sidebarTitle":"MCP with LangChain","url":"/https/docs.langchain.com/oss/python/langchain/mcp","href":"/oss/python/deepagents/mcp"},{"title":"A2A server","sidebarTitle":"A2A with LangSmith","url":"/https/docs.langchain.com/langsmith/server-a2a","href":"/oss/python/deepagents/a2a"},{"title":"Agent User Interaction Protocol (AG-UI)","sidebarTitle":"AG-UI","href":"/oss/python/deepagents/ag-ui"}]}]},{"tab":"LangChain","pages":[{"title":"LangChain overview","sidebarTitle":"Overview","href":"/oss/python/langchain/overview"},{"group":"Get started","pages":[{"title":"Install LangChain","sidebarTitle":"Install","href":"/oss/python/langchain/install"},{"title":"Quickstart","href":"/oss/python/langchain/quickstart"},{"title":"Changelog","url":"https://docs.langchain.com/oss/python/releases/changelog","href":"/oss/python/langchain/changelog-py"},{"title":"Philosophy","mode":"wide","href":"/oss/python/langchain/philosophy"}]},{"group":"Core components","pages":[{"title":"Agents","href":"/oss/python/langchain/agents"},{"title":"Models","href":"/oss/python/langchain/models"},{"title":"Messages","href":"/oss/python/langchain/messages"},{"title":"Tools","href":"/oss/python/langchain/tools"},{"title":"Short-term memory","href":"/oss/python/langchain/short-term-memory"},{"title":"Streaming","href":"/oss/python/langchain/streaming"},{"title":"Event streaming","href":"/oss/python/langchain/event-streaming"},{"title":"Structured output","href":"/oss/python/langchain/structured-output"}]},{"group":"Middleware","pages":[{"title":"Middleware overview","sidebarTitle":"Overview","href":"/oss/python/langchain/middleware/overview"},{"title":"Prebuilt middleware","href":"/oss/python/langchain/middleware/built-in"},{"title":"Custom middleware","href":"/oss/python/langchain/middleware/custom"}]},{"group":"Frontend","pages":[{"title":"Overview","href":"/oss/python/langchain/frontend/overview"},{"group":"Patterns","pages":[{"title":"Markdown messages","href":"/oss/python/langchain/frontend/markdown-messages"},{"title":"Tool calling","href":"/oss/python/langchain/frontend/tool-calling"},{"title":"Headless tools","href":"/oss/python/langchain/frontend/headless-tools"},{"title":"Human-in-the-Loop","href":"/oss/python/langchain/frontend/human-in-the-loop"},{"title":"Branching chat","href":"/oss/python/langchain/frontend/branching-chat"},{"title":"Reasoning tokens","href":"/oss/python/langchain/frontend/reasoning-tokens"},{"title":"Structured output","href":"/oss/python/langchain/frontend/structured-output"},{"title":"Message queues","href":"/oss/python/langchain/frontend/message-queues"},{"title":"Join \u0026 rejoin streams","href":"/oss/python/langchain/frontend/join-rejoin"},{"title":"Time travel","href":"/oss/python/langchain/frontend/time-travel"},{"group":"Generative UI","pages":[{"title":"Generative UI overview","sidebarTitle":"Overview","href":"/oss/python/langchain/frontend/generative-ui-overview"},{"title":"Controlled generative UI","sidebarTitle":"Controlled","href":"/oss/python/langchain/frontend/controlled-generative-ui"},{"title":"Declarative generative UI","sidebarTitle":"Declarative","href":"/oss/python/langchain/frontend/declarative-generative-ui"},{"title":"Open-ended generative UI","sidebarTitle":"Open-ended","href":"/oss/python/langchain/frontend/open-ended-generative-ui"}]}]},{"group":"Integrations","pages":[{"title":"Overview","href":"/oss/python/langchain/frontend/integrations/overview"},{"title":"CopilotKit","href":"/oss/python/langchain/frontend/integrations/copilotkit"},{"title":"AI Elements","href":"/oss/python/langchain/frontend/integrations/ai-elements"},{"title":"assistant-ui","href":"/oss/python/langchain/frontend/integrations/assistant-ui"},{"title":"OpenUI","href":"/oss/python/langchain/frontend/integrations/openui"}]}]},{"group":"Advanced usage","pages":[{"title":"Guardrails","href":"/oss/python/langchain/guardrails"},{"title":"Runtime","href":"/oss/python/langchain/runtime"},{"title":"Context engineering in agents","sidebarTitle":"Context engineering","href":"/oss/python/langchain/context-engineering"},{"group":"MCP","pages":[{"title":"Model Context Protocol (MCP)","sidebarTitle":"Overview","href":"/oss/python/langchain/mcp/index"},{"title":"Tools","href":"/oss/python/langchain/mcp/tools"},{"title":"Connections","href":"/oss/python/langchain/mcp/connections"},{"title":"Authentication","href":"/oss/python/langchain/mcp/auth"}]},{"title":"Human-in-the-loop","href":"/oss/python/langchain/human-in-the-loop"},{"group":"Multi-agent","pages":[{"title":"Multi-agent","sidebarTitle":"Overview","href":"/oss/python/langchain/multi-agent/index"},{"title":"Subagents","href":"/oss/python/langchain/multi-agent/subagents"},{"title":"Handoffs","href":"/oss/python/langchain/multi-agent/handoffs"},{"title":"Skills","href":"/oss/python/langchain/multi-agent/skills"},{"title":"Router","href":"/oss/python/langchain/multi-agent/router"},{"title":"Custom workflow","href":"/oss/python/langchain/multi-agent/custom-workflow"}]},{"title":"Retrieval","href":"/oss/python/deepagents/retrieval"},{"title":"Long-term memory","href":"/oss/python/langchain/long-term-memory"}]},{"group":"Agent development","pages":[{"title":"LangSmith Studio","sidebarTitle":"LangSmith Studio","href":"/oss/python/langchain/studio"},{"group":"Test","pages":[{"title":"Test","sidebarTitle":"Overview","href":"/oss/python/langchain/test/index"},{"title":"Unit testing","href":"/oss/python/langchain/test/unit-testing"},{"title":"Integration testing","href":"/oss/python/langchain/test/integration-testing"},{"title":"Agent Evals","href":"/oss/python/langchain/test/evals"}]},{"title":"Agent Chat UI","href":"/oss/python/langchain/ui"}]},{"group":"Production","pages":[{"title":"Deployment","sidebarTitle":"Deployment","href":"/oss/python/langchain/deploy"},{"title":"LangSmith Observability","sidebarTitle":"Observability","href":"/oss/python/langchain/observability"}]}]},{"tab":"LangGraph","pages":[{"title":"LangGraph overview","sidebarTitle":"Overview","href":"/oss/python/langgraph/overview"},{"group":"Get started","pages":[{"title":"Quickstart","href":"/oss/python/langgraph/quickstart"},{"title":"Changelog","url":"https://docs.langchain.com/oss/python/releases/changelog","href":"/oss/python/langgraph/changelog-py"}]},{"group":"Capabilities","pages":[{"title":"Persistence","href":"/oss/python/langgraph/persistence"},{"title":"Checkpointers","href":"/oss/python/langgraph/checkpointers"},{"title":"Stores","href":"/oss/python/langgraph/stores"},{"title":"Fault tolerance","href":"/oss/python/langgraph/fault-tolerance"},{"title":"Streaming","href":"/oss/python/langgraph/streaming"},{"title":"Event streaming","href":"/oss/python/langgraph/event-streaming"},{"title":"Interrupts","href":"/oss/python/langgraph/interrupts"},{"title":"Use time-travel","sidebarTitle":"Time travel","href":"/oss/python/langgraph/use-time-travel"},{"title":"Memory","href":"/oss/python/langgraph/add-memory"},{"title":"Subgraphs","sidebarTitle":"Subgraphs","href":"/oss/python/langgraph/use-subgraphs"}]},{"group":"Patterns","pages":[{"title":"Workflows and agents","sidebarTitle":"Workflows + agents","href":"/oss/python/langgraph/workflows-agents"}]},{"group":"Build with the Graph API","pages":[{"title":"Thinking in the Graph API","sidebarTitle":"Thinking in the Graph API","href":"/oss/python/langgraph/thinking-in-graph-api"},{"title":"Build checklist for the Graph API","sidebarTitle":"Build checklist","href":"/oss/python/langgraph/use-graph-api"},{"title":"Graph API overview","sidebarTitle":"Graph API","href":"/oss/python/langgraph/graph-api"},{"title":"Define and update state","sidebarTitle":"Define and update state","href":"/oss/python/langgraph/graph-api-state"},{"title":"Build sequences, branches, and loops","sidebarTitle":"Control flow","href":"/oss/python/langgraph/graph-api-control-flow"},{"title":"Use Send and Command","sidebarTitle":"Send and Command","href":"/oss/python/langgraph/graph-api-send-command"},{"title":"Configure nodes","sidebarTitle":"Configure nodes","href":"/oss/python/langgraph/graph-api-nodes"},{"title":"Visualize your graph","sidebarTitle":"Visualize your graph","href":"/oss/python/langgraph/graph-api-visualize"}]},{"group":"Deployment","pages":[{"title":"Run a local server","sidebarTitle":"Local server","href":"/oss/python/langgraph/local-server"},{"title":"Application structure","href":"/oss/python/langgraph/application-structure"},{"title":"Test","href":"/oss/python/langgraph/test"},{"title":"Backward compatibility","href":"/oss/python/langgraph/backward-compatibility"},{"title":"LangSmith Studio","href":"/oss/python/langgraph/studio"},{"title":"Agent Chat UI","href":"/oss/python/langgraph/ui"},{"title":"Deployment","sidebarTitle":"Deployment","href":"/oss/python/langgraph/deploy"},{"title":"LangSmith Observability","href":"/oss/python/langgraph/observability"}]},{"group":"Frontend","pages":[{"title":"Overview","href":"/oss/python/langgraph/frontend/overview"},{"title":"Graph execution","href":"/oss/python/langgraph/frontend/graph-execution"},{"title":"Custom stream channels","href":"/oss/python/langgraph/frontend/custom-stream-channels"}]},{"group":"Advanced","pages":[{"title":"Functional API overview","sidebarTitle":"Functional API","href":"/oss/python/langgraph/functional-api"},{"title":"LangGraph runtime","sidebarTitle":"Runtime","href":"/oss/python/langgraph/pregel"}]},{"title":"Studio","url":"https://docs.langchain.com/langsmith/studio","href":"/oss/python/studio"}]},{"tab":"OpenWiki","pages":[{"title":"OpenWiki","sidebarTitle":"Overview","mode":"wide","href":"/oss/openwiki/overview"},{"title":"Quickstart","sidebarTitle":"Quickstart","href":"/oss/openwiki/quickstart"},{"group":"Modes","pages":[{"title":"Code mode","sidebarTitle":"Code mode","href":"/oss/openwiki/code-mode"},{"title":"Personal mode","sidebarTitle":"Personal mode","href":"/oss/openwiki/personal-mode"}]},{"title":"Coding-agent integrations","sidebarTitle":"Integrations","href":"/oss/openwiki/integrations"},{"title":"Search and link wikis","sidebarTitle":"Search and link","href":"/oss/openwiki/search-and-link"},{"title":"Visualize your wiki","sidebarTitle":"Visualize","href":"/oss/openwiki/visualize"},{"title":"Command reference","sidebarTitle":"CLI reference","href":"/oss/openwiki/cli-reference"},{"title":"Customize OpenWiki","sidebarTitle":"Customize OpenWiki","href":"/oss/openwiki/customize"},{"title":"Model providers","sidebarTitle":"Providers","href":"/oss/openwiki/providers"},{"title":"Automate updates","sidebarTitle":"Automate updates","href":"/oss/openwiki/automate-updates"},{"title":"Changelog","url":"https://github.com/langchain-ai/openwiki/releases","href":"/oss/openwiki/changelog"}]},{"tab":"Integrations","pages":[{"title":"LangChain Python integrations","sidebarTitle":"LangChain integrations","mode":"wide","href":"/oss/python/integrations/providers/overview"},{"title":"All LangChain Python integration providers","sidebarTitle":"All providers","mode":"wide","href":"/oss/python/integrations/providers/all_providers"},{"group":"Popular Providers","icon":"users-group","pages":[{"title":"OpenAI integrations","sidebarTitle":"OpenAI","href":"/oss/python/integrations/providers/openai"},{"title":"Anthropic (Claude) integrations","sidebarTitle":"Anthropic","href":"/oss/python/integrations/providers/anthropic"},{"title":"Google integrations","sidebarTitle":"Google","href":"/oss/python/integrations/providers/google"},{"title":"AWS (Amazon) integrations","sidebarTitle":"AWS","href":"/oss/python/integrations/providers/aws"},{"title":"NVIDIA","href":"/oss/python/integrations/providers/nvidia"},{"title":"Hugging Face integrations","sidebarTitle":"Hugging Face","href":"/oss/python/integrations/providers/huggingface"},{"title":"Microsoft integrations","sidebarTitle":"Microsoft","href":"/oss/python/integrations/providers/microsoft"},{"title":"Ollama integrations","sidebarTitle":"Ollama","href":"/oss/python/integrations/providers/ollama"},{"title":"Groq integrations","sidebarTitle":"Groq","href":"/oss/python/integrations/providers/groq"},{"title":"Fireworks integrations","sidebarTitle":"Fireworks","href":"/oss/python/integrations/providers/fireworks"},{"title":"Browserbase integrations","href":"/oss/python/integrations/providers/browserbase"}]},{"group":"Integrations by component","icon":"plug","pages":[{"title":"Chat model integrations","sidebarTitle":"Chat models","mode":"wide","href":"/oss/python/integrations/chat/index"},{"title":"Tool integrations","sidebarTitle":"Tools and toolkits","href":"/oss/python/integrations/tools/index"},{"title":"Middleware integrations","sidebarTitle":"Middleware","href":"/oss/python/integrations/middleware/index"},{"title":"Sandbox integrations","sidebarTitle":"Sandboxes","href":"/oss/python/integrations/sandboxes/index"},{"title":"Backend integrations","sidebarTitle":"Backends","href":"/oss/python/integrations/backends/index"},{"title":"Checkpointer integrations","sidebarTitle":"Checkpointers","href":"/oss/python/integrations/checkpointers/index"},{"title":"Store integrations","sidebarTitle":"Stores","href":"/oss/python/integrations/long-term-memory/index"},{"title":"Retriever integrations","sidebarTitle":"Retrievers","href":"/oss/python/integrations/retrievers/index"},{"title":"Text splitter integrations","sidebarTitle":"Text splitters","href":"/oss/python/integrations/splitters/index"},{"title":"Embedding model integrations","sidebarTitle":"Embedding models","href":"/oss/python/integrations/embeddings/index"},{"title":"Vector store integrations","sidebarTitle":"Vector stores","href":"/oss/python/integrations/vectorstores/index"},{"title":"Document loader integrations","sidebarTitle":"Document loaders","href":"/oss/python/integrations/document_loaders/index"}]}]},{"tab":"Learn","pages":[{"title":"Learn","href":"/oss/python/learn"},{"group":"Tutorials","icon":"code","pages":[{"group":"Deep Agents","expanded":true,"pages":[{"title":"Build a data analysis agent","sidebarTitle":"Data Analysis","href":"/oss/python/deepagents/data-analysis"},{"title":"Build a deep research agent","sidebarTitle":"Deep Research","href":"/oss/python/deepagents/deep-research"},{"title":"Build a content builder agent","sidebarTitle":"Content Builder","href":"/oss/python/deepagents/content-builder"},{"title":"Retrieval Augmented Generation (RAG) with Deep Agents","sidebarTitle":"RAG","href":"/oss/python/deepagents/rag"}]},{"group":"LangChain","expanded":true,"pages":[{"title":"Build a data analysis agent from scratch","sidebarTitle":"Deep Agent","href":"/oss/python/langchain/deep-agent-from-scratch"},{"title":"Build a semantic search engine with LangChain","sidebarTitle":"Semantic search","href":"/oss/python/langchain/knowledge-base"},{"title":"Chunk documents for retrieval","sidebarTitle":"Chunk documents","href":"/oss/python/langchain/chunking"},{"title":"Improve retrieval quality","href":"/oss/python/langchain/retrieval-optimization"},{"title":"Build a SQL agent","sidebarTitle":"SQL agent","href":"/oss/python/langchain/sql-agent"},{"title":"Build a voice agent with LangChain","sidebarTitle":"Voice agent","href":"/oss/python/langchain/voice-agent"}]},{"group":"Multi-agent","expanded":true,"pages":[{"title":"Build a personal assistant with subagents","sidebarTitle":"Subagents: Personal assistant","href":"/oss/python/langchain/multi-agent/subagents-personal-assistant"},{"title":"Build customer support with handoffs","sidebarTitle":"Handoffs: Customer support","href":"/oss/python/langchain/multi-agent/handoffs-customer-support"},{"title":"Build a multi-source knowledge base with routing","sidebarTitle":"Router: Knowledge base","href":"/oss/python/langchain/multi-agent/router-knowledge-base"},{"title":"Build a SQL assistant with on-demand skills","sidebarTitle":"Skills: SQL assistant","href":"/oss/python/langchain/multi-agent/skills-sql-assistant"}]},{"group":"LangGraph","expanded":true,"pages":[{"title":"Build a custom RAG agent with LangGraph","sidebarTitle":"Custom RAG agent","href":"/oss/python/langgraph/agentic-rag"},{"title":"Build a custom SQL agent","sidebarTitle":"Custom SQL agent","href":"/oss/python/langgraph/sql-agent"}]}]},{"group":"Conceptual overviews","icon":"book","pages":[{"title":"Runtimes, frameworks, and harnesses","sidebarTitle":"LangChain vs. LangGraph vs. Deep Agents","href":"/oss/python/concepts/products"},{"title":"Providers and models","href":"/oss/python/concepts/providers-and-models"},{"title":"Component architecture","href":"/oss/python/langchain/component-architecture"},{"title":"Memory overview","sidebarTitle":"Memory","href":"/oss/python/concepts/memory"},{"title":"Context overview","sidebarTitle":"Context","href":"/oss/python/concepts/context"},{"title":"Human-in-the-loop overview","sidebarTitle":"Human-in-the-loop","href":"/oss/python/concepts/human-in-the-loop"},{"title":"Graph API overview","sidebarTitle":"Graph API","href":"/oss/python/langgraph/graph-api"},{"title":"Functional API overview","sidebarTitle":"Functional API","href":"/oss/python/langgraph/functional-api"}]},{"group":"Additional resources","icon":"list","pages":[{"title":"Use docs programmatically","href":"/use-these-docs"},{"title":"LangChain Academy","url":"https://academy.langchain.com/","href":"/oss/python/langchain/academy"},{"title":"Case studies","href":"/oss/python/langgraph/case-studies"},{"title":"Get help","href":"/oss/python/langchain/get-help"}]}]},{"tab":"Reference","pages":[{"title":"Reference","sidebarTitle":"Overview","href":"/oss/python/reference/overview"},{"group":"Reference","pages":[{"title":"Deep Agents","url":"https://reference.langchain.com/python/deepagents","href":"/oss/python/reference/deepagents-python"},{"title":"LangChain SDK","url":"https://reference.langchain.com/python/langchain","href":"/oss/python/reference/langchain-python"},{"title":"LangGraph SDK","url":"https://reference.langchain.com/python/langgraph","href":"/oss/python/reference/langgraph-python"},{"title":"Integrations","url":"https://reference.langchain.com/python/integrations/overview","href":"/oss/python/reference/integrations-python"},{"title":"Errors","sidebarTitle":"Errors","href":"/oss/python/common-errors"}]},{"group":"Releases","pages":[{"title":"Versioning","href":"/oss/python/versioning"},{"title":"Changelog","sidebarTitle":"Changelog","href":"/oss/python/releases/changelog"},{"group":"Releases","boost":0.5,"pages":[{"title":"What's new in LangChain v1","sidebarTitle":"LangChain v1","href":"/oss/python/releases/langchain-v1"},{"title":"What's new in LangGraph v1","sidebarTitle":"LangGraph v1","href":"/oss/python/releases/langgraph-v1"}]},{"group":"Migration guides","boost":0.5,"pages":[{"title":"LangChain v1 migration guide","sidebarTitle":"LangChain v1","href":"/oss/python/migrate/langchain-v1"},{"title":"LangGraph v1 migration guide","sidebarTitle":"LangGraph v1","href":"/oss/python/migrate/langgraph-v1"},{"title":"Migrate from langgraph-supervisor","sidebarTitle":"langgraph-supervisor","href":"/oss/python/migrate/langgraph-supervisor"},{"title":"Migrate from langchain-mcp-adapters","sidebarTitle":"langchain-mcp-adapters","href":"/oss/python/migrate/langchain-mcp-adapters"}]}]},{"group":"Policies","pages":[{"title":"Release policy","href":"/oss/python/release-policy"},{"title":"Security policy","sidebarTitle":"Security","href":"/oss/python/security-policy"}]}]},{"tab":"Contribute","pages":[{"title":"Contributing","sidebarTitle":"Overview","href":"/oss/python/contributing/overview"},{"group":"Contribute","boost":0.5,"icon":"heart-plus","pages":[{"title":"Contributing to documentation","sidebarTitle":"Documentation","href":"/oss/python/contributing/documentation"},{"title":"Contributing to code","sidebarTitle":"Code","href":"/oss/python/contributing/code"},{"group":"Integrations","pages":[{"title":"Contributing integrations","sidebarTitle":"Guide","href":"/oss/python/contributing/integrations-langchain"},{"title":"Implement a LangChain integration","sidebarTitle":"Implement","href":"/oss/python/contributing/implement-langchain"},{"title":"Using standard tests","sidebarTitle":"Standard tests","href":"/oss/python/contributing/standard-tests-langchain"},{"title":"Publish an integration","sidebarTitle":"Publish","href":"/oss/python/contributing/publish-langchain"},{"title":"Co-marketing","href":"/oss/python/contributing/comarketing"}]}]}]}]},{"dropdown":"TypeScript","icon":{"style":"regular","name":"brand-typescript"},"tabs":[{"tab":"Overview","pages":[{"title":"Overview","href":"/build-overview"}]},{"tab":"Managed Deep Agents","pages":[{"title":"Managed Deep Agents","href":"/langsmith/javascript/managed-deep-agents-overview"}]},{"tab":"Deep Agents","pages":[{"title":"Deep Agents","href":"/oss/javascript/deepagents/overview"}]},{"tab":"LangChain","pages":[{"title":"LangChain","href":"/oss/javascript/langchain/overview"}]},{"tab":"LangGraph","pages":[{"title":"LangGraph","href":"/oss/javascript/langgraph/overview"}]},{"tab":"OpenWiki","pages":[{"title":"OpenWiki","href":"/oss/openwiki/overview"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/oss/javascript/integrations/providers/overview"}]},{"tab":"Learn","pages":[{"title":"Learn","description":"Tutorials, conceptual guides, and resources to help you get started.","href":"/oss/javascript/learn"},{"group":"Tutorials","icon":"code","pages":[{"group":"Deep Agents","expanded":true,"pages":[{"title":"Build a deep research agent","sidebarTitle":"Deep Research","href":"/oss/javascript/deepagents/deep-research"},{"title":"Build a content builder agent","sidebarTitle":"Content Builder","description":"Build a content writing agent with brand voice, skills, subagents, and image generation using Managed Deep Agents or the Deep Agents SDK","href":"/oss/javascript/deepagents/content-builder"},{"title":"Retrieval Augmented Generation (RAG) with Deep Agents","sidebarTitle":"RAG","href":"/oss/javascript/deepagents/rag"}]},{"group":"LangChain","expanded":true,"pages":[{"title":"Build a data analysis agent from scratch","sidebarTitle":"Deep Agent","href":"/oss/javascript/langchain/deep-agent-from-scratch"},{"title":"Build a semantic search engine with LangChain","sidebarTitle":"Semantic search","href":"/oss/javascript/langchain/knowledge-base"},{"title":"Chunk documents for retrieval","sidebarTitle":"Chunk documents","href":"/oss/javascript/langchain/chunking"},{"title":"Improve retrieval quality","href":"/oss/javascript/langchain/retrieval-optimization"},{"title":"Build a SQL agent","sidebarTitle":"SQL agent","href":"/oss/javascript/langchain/sql-agent"},{"title":"Build a voice agent with LangChain","sidebarTitle":"Voice agent","href":"/oss/javascript/langchain/voice-agent"}]},{"group":"Multi-agent","expanded":true,"pages":[{"title":"Build a personal assistant with subagents","sidebarTitle":"Subagents: Personal assistant","href":"/oss/javascript/langchain/multi-agent/subagents-personal-assistant"},{"title":"Build customer support with handoffs","sidebarTitle":"Handoffs: Customer support","href":"/oss/javascript/langchain/multi-agent/handoffs-customer-support"},{"title":"Build a multi-source knowledge base with routing","sidebarTitle":"Router: Knowledge base","href":"/oss/javascript/langchain/multi-agent/router-knowledge-base"},{"title":"Build a SQL assistant with on-demand skills","sidebarTitle":"Skills: SQL assistant","href":"/oss/javascript/langchain/multi-agent/skills-sql-assistant"}]},{"group":"LangGraph","expanded":true,"pages":[{"title":"Build a custom RAG agent with LangGraph","sidebarTitle":"Custom RAG agent","href":"/oss/javascript/langgraph/agentic-rag"},{"title":"Build a custom SQL agent","sidebarTitle":"Custom SQL agent","href":"/oss/javascript/langgraph/sql-agent"}]}]},{"group":"Conceptual overviews","icon":"book","pages":[{"title":"Runtimes, frameworks, and harnesses","sidebarTitle":"LangChain vs. LangGraph vs. Deep Agents","href":"/oss/javascript/concepts/products"},{"title":"Providers and models","href":"/oss/javascript/concepts/providers-and-models"},{"title":"Component architecture","href":"/oss/javascript/langchain/component-architecture"},{"title":"Memory overview","sidebarTitle":"Memory","href":"/oss/javascript/concepts/memory"},{"title":"Context overview","sidebarTitle":"Context","href":"/oss/javascript/concepts/context"},{"title":"Human-in-the-loop overview","sidebarTitle":"Human-in-the-loop","href":"/oss/javascript/concepts/human-in-the-loop"},{"title":"Graph API overview","sidebarTitle":"Graph API","href":"/oss/javascript/langgraph/graph-api"},{"title":"Functional API overview","sidebarTitle":"Functional API","href":"/oss/javascript/langgraph/functional-api"}]},{"group":"LangChain Academy","icon":"school","pages":[{"title":"LangChain Academy","url":"https://academy.langchain.com/","href":"/oss/javascript/langchain/academy"}]},{"group":"Additional resources","icon":"list","pages":[{"title":"Use docs programmatically","href":"/use-these-docs"},{"title":"Case studies","href":"/oss/javascript/langgraph/case-studies"},{"title":"Get help","href":"/oss/javascript/langchain/get-help"}]}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/oss/javascript/reference/overview"}]},{"tab":"Contribute","pages":[{"title":"Contribute","href":"/oss/javascript/contributing/overview"}]}]}]},{"item":"Deploy","icon":"rocket","description":"Ship agents to production","tabs":[{"tab":"Get started","pages":[{"title":"Deploy agents","sidebarTitle":"Overview","mode":"wide","href":"/langsmith/deploy-overview"},{"title":"Deploy your app to cloud","sidebarTitle":"Quickstart","icon":"rocket","href":"/langsmith/deployment-quickstart"},{"group":"Deployment components","pages":[{"title":"LangSmith Agent Server components","sidebarTitle":"Overview","mode":"wide","href":"/langsmith/components"},{"title":"LangSmith data plane","sidebarTitle":"Data plane","href":"/langsmith/data-plane"},{"title":"LangSmith control plane","sidebarTitle":"Control plane","href":"/langsmith/control-plane"}]},{"group":"Develop \u0026 test","pages":[{"title":"Local development \u0026 testing","icon":"device-laptop","href":"/langsmith/local-dev-testing"},{"title":"Studio","url":"https://docs.langchain.com/langsmith/studio","href":"/langsmith/studio-deploy"}]},{"group":"Frameworks and platforms","pages":[{"title":"Deploy Google ADK agents","sidebarTitle":"Deploy Google ADK","href":"/langsmith/deploy-google-adk"},{"title":"Deploy other frameworks","sidebarTitle":"Claude SDK, Strands, \u0026 more","href":"/langsmith/deploy-other-frameworks"},{"group":"Full-stack web apps","pages":[{"title":"Deploy full-stack web apps","sidebarTitle":"Overview","mode":"wide","href":"/langsmith/deploy-frameworks-and-platforms"},{"title":"Deploy with LangSmith and Vite","sidebarTitle":"LangSmith + Vite","href":"/langsmith/deploy-vite-langsmith"},{"title":"Deploy with Next.js","sidebarTitle":"Next.js","href":"/langsmith/deploy-nextjs"},{"title":"Deploy with SvelteKit","sidebarTitle":"SvelteKit","href":"/langsmith/deploy-sveltekit"},{"title":"Deploy with Nuxt","sidebarTitle":"Nuxt","href":"/langsmith/deploy-nuxt"},{"title":"Deploy with Cloudflare Workers","sidebarTitle":"Cloudflare Workers","href":"/langsmith/deploy-cloudflare-workers"},{"title":"Deploy with Deno Deploy","sidebarTitle":"Deno Deploy","href":"/langsmith/deploy-deno"}]}]},{"group":"Reference","pages":[{"title":"Reference","sidebarTitle":"Overview","mode":"wide","href":"/langsmith/deploy-reference-overview"},{"title":"LangSmith Agent Server SDK","url":"https://reference.langchain.com/python/langsmith/deployment/sdk/","href":"/langsmith/smith-deployments-sdk"},{"title":"LangGraph CLI","sidebarTitle":"LangGraph CLI","href":"/langsmith/cli"},{"title":"RemoteGraph","sidebarTitle":"RemoteGraph","url":"https://reference.langchain.com/python/langsmith/deployment/remote_graph/","href":"/langsmith/remote-graph"},{"group":"Agent Server API","boost":0.3,"pages":[{"title":"Agent Server API reference","sidebarTitle":"Overview","href":"/langsmith/server-api-ref"},{"group":"Assistants","pages":[{"title":"Create Assistant","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /assistants","href":"/langsmith/agent-server-api/assistants/create-assistant"},{"title":"Search Assistants","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /assistants/search","href":"/langsmith/agent-server-api/assistants/search-assistants"},{"title":"Count Assistants","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /assistants/count","href":"/langsmith/agent-server-api/assistants/count-assistants"},{"title":"Get Assistant","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /assistants/{assistant_id}","href":"/langsmith/agent-server-api/assistants/get-assistant"},{"title":"Delete Assistant","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json delete /assistants/{assistant_id}","href":"/langsmith/agent-server-api/assistants/delete-assistant"},{"title":"Patch Assistant","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json patch /assistants/{assistant_id}","href":"/langsmith/agent-server-api/assistants/patch-assistant"},{"title":"Get Assistant Graph","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /assistants/{assistant_id}/graph","href":"/langsmith/agent-server-api/assistants/get-assistant-graph"},{"title":"Get Assistant Subgraphs","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /assistants/{assistant_id}/subgraphs","href":"/langsmith/agent-server-api/assistants/get-assistant-subgraphs"},{"title":"Get Assistant Subgraphs by Namespace","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /assistants/{assistant_id}/subgraphs/{namespace}","href":"/langsmith/agent-server-api/assistants/get-assistant-subgraphs-by-namespace"},{"title":"Get Assistant Schemas","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /assistants/{assistant_id}/schemas","href":"/langsmith/agent-server-api/assistants/get-assistant-schemas"},{"title":"Get Assistant Versions","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /assistants/{assistant_id}/versions","href":"/langsmith/agent-server-api/assistants/get-assistant-versions"},{"title":"Set Latest Assistant Version","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /assistants/{assistant_id}/latest","href":"/langsmith/agent-server-api/assistants/set-latest-assistant-version"}]},{"group":"Threads","pages":[{"title":"Create Thread","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads","href":"/langsmith/agent-server-api/threads/create-thread"},{"title":"Search Threads","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/search","href":"/langsmith/agent-server-api/threads/search-threads"},{"title":"Count Threads","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/count","href":"/langsmith/agent-server-api/threads/count-threads"},{"title":"Prune Threads","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/prune","href":"/langsmith/agent-server-api/threads/prune-threads"},{"title":"Get Thread Storage","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /threads/{thread_id}/storage","href":"/langsmith/agent-server-api/threads/get-thread-storage"},{"title":"Get Thread State","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /threads/{thread_id}/state","href":"/langsmith/agent-server-api/threads/get-thread-state"},{"title":"Update Thread State","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/state","href":"/langsmith/agent-server-api/threads/update-thread-state"},{"title":"Get Thread State At Checkpoint","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /threads/{thread_id}/state/{checkpoint_id}","href":"/langsmith/agent-server-api/threads/get-thread-state-at-checkpoint"},{"title":"Get Thread State At Checkpoint","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/state/checkpoint","href":"/langsmith/agent-server-api/threads/get-thread-state-at-checkpoint-1"},{"title":"Get Thread History","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /threads/{thread_id}/history","href":"/langsmith/agent-server-api/threads/get-thread-history"},{"title":"Get Thread History Post","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/history","href":"/langsmith/agent-server-api/threads/get-thread-history-post"},{"title":"Copy Thread","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/copy","href":"/langsmith/agent-server-api/threads/copy-thread"},{"title":"Get Thread","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /threads/{thread_id}","href":"/langsmith/agent-server-api/threads/get-thread"},{"title":"Delete Thread","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json delete /threads/{thread_id}","href":"/langsmith/agent-server-api/threads/delete-thread"},{"title":"Patch Thread","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json patch /threads/{thread_id}","href":"/langsmith/agent-server-api/threads/patch-thread"},{"title":"Join Thread Stream","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /threads/{thread_id}/stream","href":"/langsmith/agent-server-api/threads/join-thread-stream"}]},{"group":"Streaming","pages":[{"title":"Protocol v2 Event Stream (SSE)","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/stream/events","href":"/langsmith/agent-server-api/streaming/protocol-v2-event-stream-sse"},{"title":"Protocol v2 Command","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/commands","href":"/langsmith/agent-server-api/streaming/protocol-v2-command"}]},{"group":"Thread Runs","pages":[{"title":"List Runs","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /threads/{thread_id}/runs","href":"/langsmith/agent-server-api/thread-runs/list-runs"},{"title":"Create Background Run","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/runs","href":"/langsmith/agent-server-api/thread-runs/create-background-run"},{"title":"Create Run, Stream Output","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/runs/stream","href":"/langsmith/agent-server-api/thread-runs/create-run-stream-output"},{"title":"Create Run, Wait for Output","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/runs/wait","href":"/langsmith/agent-server-api/thread-runs/create-run-wait-for-output"},{"title":"Get Run","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /threads/{thread_id}/runs/{run_id}","href":"/langsmith/agent-server-api/thread-runs/get-run"},{"title":"Delete Run","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json delete /threads/{thread_id}/runs/{run_id}","href":"/langsmith/agent-server-api/thread-runs/delete-run"},{"title":"Join Run","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /threads/{thread_id}/runs/{run_id}/join","href":"/langsmith/agent-server-api/thread-runs/join-run"},{"title":"Join Run Stream","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /threads/{thread_id}/runs/{run_id}/stream","href":"/langsmith/agent-server-api/thread-runs/join-run-stream"},{"title":"Cancel Run","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/runs/{run_id}/cancel","href":"/langsmith/agent-server-api/thread-runs/cancel-run"},{"title":"Cancel Runs","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /runs/cancel","href":"/langsmith/agent-server-api/thread-runs/cancel-runs"}]},{"group":"Crons","pages":[{"title":"Create Thread Cron","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /threads/{thread_id}/runs/crons","href":"/langsmith/agent-server-api/crons/create-thread-cron"},{"title":"Create Cron","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /runs/crons","href":"/langsmith/agent-server-api/crons/create-cron"},{"title":"Search Crons","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /runs/crons/search","href":"/langsmith/agent-server-api/crons/search-crons"},{"title":"Count Crons","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /runs/crons/count","href":"/langsmith/agent-server-api/crons/count-crons"},{"title":"Get Cron","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /runs/crons/{cron_id}","href":"/langsmith/agent-server-api/crons/get-cron"},{"title":"Delete Cron","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json delete /runs/crons/{cron_id}","href":"/langsmith/agent-server-api/crons/delete-cron"},{"title":"Update Cron","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json patch /runs/crons/{cron_id}","href":"/langsmith/agent-server-api/crons/update-cron"}]},{"group":"Stateless Runs","pages":[{"title":"Create Run, Stream Output","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /runs/stream","href":"/langsmith/agent-server-api/stateless-runs/create-run-stream-output"},{"title":"Create Run, Wait for Output","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /runs/wait","href":"/langsmith/agent-server-api/stateless-runs/create-run-wait-for-output"},{"title":"Create Background Run","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /runs","href":"/langsmith/agent-server-api/stateless-runs/create-background-run"},{"title":"Create Run Batch","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /runs/batch","href":"/langsmith/agent-server-api/stateless-runs/create-run-batch"}]},{"group":"Store","pages":[{"title":"Retrieve a single item.","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /store/items","href":"/langsmith/agent-server-api/store/retrieve-a-single-item"},{"title":"Store or update an item.","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json put /store/items","href":"/langsmith/agent-server-api/store/store-or-update-an-item"},{"title":"Delete an item.","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json delete /store/items","href":"/langsmith/agent-server-api/store/delete-an-item"},{"title":"Search or list items within a namespace prefix.","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /store/items/search","href":"/langsmith/agent-server-api/store/search-or-list-items-within-a-namespace-prefix"},{"title":"List namespaces with optional match conditions.","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /store/namespaces","href":"/langsmith/agent-server-api/store/list-namespaces-with-optional-match-conditions"}]},{"group":"A2A","pages":[{"title":"A2A JSON-RPC","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /a2a/{assistant_id}","href":"/langsmith/agent-server-api/a2a/a2a-json-rpc"}]},{"group":"MCP","pages":[{"title":"MCP Get","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /mcp/","href":"/langsmith/agent-server-api/mcp/mcp-get"},{"title":"MCP Post","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json post /mcp/","href":"/langsmith/agent-server-api/mcp/mcp-post"},{"title":"Terminate Session","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json delete /mcp/","href":"/langsmith/agent-server-api/mcp/terminate-session"}]},{"group":"System","pages":[{"title":"Root Health Check","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /","href":"/langsmith/agent-server-api/system/root-health-check"},{"title":"Server Information","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /info","href":"/langsmith/agent-server-api/system/server-information"},{"title":"System Metrics","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /metrics","href":"/langsmith/agent-server-api/system/system-metrics"},{"title":"API Documentation","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /docs","href":"/langsmith/agent-server-api/system/api-documentation"},{"title":"Health Check","deprecated":null,"version":null,"openapi":"/langsmith/agent-server-openapi.json get /ok","href":"/langsmith/agent-server-api/system/health-check"}]}]},{"group":"Control Plane API","boost":0.3,"pages":[{"title":"Control plane API reference for Agent Server hosting","sidebarTitle":"Overview","href":"/langsmith/api-ref-control-plane"},{"group":"Integrations (v1)","pages":[{"title":"List GitHub Integrations","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v1/integrations/github/install","href":"/api-reference/integrations-v1/list-github-integrations"},{"title":"List GitHub Repositories","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v1/integrations/github/{integration_id}/repos","href":"/api-reference/integrations-v1/list-github-repositories"},{"title":"List Forge GitHub Integrations","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v1/integrations/forge/github/install","href":"/api-reference/integrations-v1/list-forge-github-integrations"},{"title":"List Forge GitHub Repositories","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v1/integrations/forge/github/{integration_id}/repos","href":"/api-reference/integrations-v1/list-forge-github-repositories"}]},{"group":"Deployments (v2)","pages":[{"title":"List Deployments","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/deployments","href":"/api-reference/deployments-v2/list-deployments"},{"title":"Create Deployment","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/deployments","href":"/api-reference/deployments-v2/create-deployment"},{"title":"Delete Deployments","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json delete /v2/deployments","href":"/api-reference/deployments-v2/delete-deployments"},{"title":"Get Free Deployment Count","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/deployments/free-count","href":"/api-reference/deployments-v2/get-free-deployment-count"},{"title":"List Deployment Namespaces","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/deployments/namespaces","href":"/api-reference/deployments-v2/list-deployment-namespaces"},{"title":"Get Deployment","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/deployments/{deployment_id}","href":"/api-reference/deployments-v2/get-deployment"},{"title":"Delete Deployment","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json delete /v2/deployments/{deployment_id}","href":"/api-reference/deployments-v2/delete-deployment"},{"title":"Patch Deployment","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json patch /v2/deployments/{deployment_id}","href":"/api-reference/deployments-v2/patch-deployment"},{"title":"Patch Deployment Tier","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json patch /v2/deployments/{deployment_id}/deployment-tier","href":"/api-reference/deployments-v2/patch-deployment-tier"},{"title":"Patch Deployment Resource Tiers","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json patch /v2/deployments/{deployment_id}/resource-tiers","href":"/api-reference/deployments-v2/patch-deployment-resource-tiers"},{"title":"List Revisions","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/deployments/{deployment_id}/revisions","href":"/api-reference/deployments-v2/list-revisions"},{"title":"Create Deployment Revision","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/deployments/{deployment_id}/revisions","href":"/api-reference/deployments-v2/create-deployment-revision"},{"title":"Get Revision","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/deployments/{deployment_id}/revisions/{revision_id}","href":"/api-reference/deployments-v2/get-revision"},{"title":"Redeploy Revision","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/deployments/{deployment_id}/revisions/{revision_id}/redeploy","href":"/api-reference/deployments-v2/redeploy-revision"},{"title":"List Deployment Logs","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/deployments/{deployment_id}/logs","href":"/api-reference/deployments-v2/list-deployment-logs"},{"title":"List Revision Logs","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/deployments/{deployment_id}/revisions/{revision_id}/logs","href":"/api-reference/deployments-v2/list-revision-logs"},{"title":"Interrupt Deployment Revision","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/deployments/{deployment_id}/revisions/{revision_id}/interruption","href":"/api-reference/deployments-v2/interrupt-deployment-revision"},{"title":"Get Domain","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/deployments/{deployment_id}/custom-domain","href":"/api-reference/deployments-v2/get-domain"},{"title":"Add Domain","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/deployments/{deployment_id}/custom-domain","href":"/api-reference/deployments-v2/add-domain"},{"title":"Delete Domain","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json delete /v2/deployments/{deployment_id}/custom-domain","href":"/api-reference/deployments-v2/delete-domain"},{"title":"Verify Domain","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/deployments/{deployment_id}/custom-domain/verification","href":"/api-reference/deployments-v2/verify-domain"},{"title":"List Deployment Log Entries","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/deployment-logs","href":"/api-reference/deployments-v2/list-deployment-log-entries"}]},{"group":"Listeners (v2)","pages":[{"title":"List Listeners","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/listeners","href":"/api-reference/listeners-v2/list-listeners"},{"title":"Create Listener","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/listeners","href":"/api-reference/listeners-v2/create-listener"},{"title":"Get Listener","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/listeners/{listener_id}","href":"/api-reference/listeners-v2/get-listener"},{"title":"Delete Listener","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json delete /v2/listeners/{listener_id}","href":"/api-reference/listeners-v2/delete-listener"},{"title":"Patch Listener","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json patch /v2/listeners/{listener_id}","href":"/api-reference/listeners-v2/patch-listener"}]},{"group":"Integrations (v2)","pages":[{"title":"List Github Installations","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/integrations/github/installations","href":"/api-reference/integrations-v2/list-github-installations"},{"title":"List Github Installation Repositories","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/integrations/github/installations/{integration_id}/repositories","href":"/api-reference/integrations-v2/list-github-installation-repositories"},{"title":"Get Github Install Link Endpoint","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/integrations/github/installation-link","href":"/api-reference/integrations-v2/get-github-install-link-endpoint"},{"title":"List Forge Github Installations","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/integrations/forge-github/installations","href":"/api-reference/integrations-v2/list-forge-github-installations"},{"title":"List Forge Github Installation Repositories","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/integrations/forge-github/installations/{integration_id}/repositories","href":"/api-reference/integrations-v2/list-forge-github-installation-repositories"},{"title":"Get Forge Github Install Link Endpoint","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/integrations/forge-github/installation-link","href":"/api-reference/integrations-v2/get-forge-github-install-link-endpoint"},{"title":"Get Engine Picker Session Endpoint","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/integrations/forge-github/picker-sessions/{session_id}","href":"/api-reference/integrations-v2/get-engine-picker-session-endpoint"},{"title":"Create Engine Picker Session Selection","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/integrations/forge-github/picker-sessions/{session_id}/selection","href":"/api-reference/integrations-v2/create-engine-picker-session-selection"}]},{"group":"Auth Service (v2)","pages":[{"title":"List Oauth Providers","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/providers","href":"/api-reference/auth-service-v2/list-oauth-providers"},{"title":"Create Oauth Provider","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/auth/providers","href":"/api-reference/auth-service-v2/create-oauth-provider"},{"title":"List Platform Oauth Providers","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/platform-providers","href":"/api-reference/auth-service-v2/list-platform-oauth-providers"},{"title":"Get Platform Oauth Provider","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/platform-providers/{provider_id}","href":"/api-reference/auth-service-v2/get-platform-oauth-provider"},{"title":"Oauth Setup Callback","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/setup/{provider_id}","href":"/api-reference/auth-service-v2/oauth-setup-callback"},{"title":"Oauth Callback Get","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/callback/{provider_id}","href":"/api-reference/auth-service-v2/oauth-callback-get"},{"title":"Oauth Callback","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/auth/callback/{provider_id}","href":"/api-reference/auth-service-v2/oauth-callback"},{"title":"Authenticate","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/auth/authenticate","href":"/api-reference/auth-service-v2/authenticate"},{"title":"Wait For Auth Completion","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/wait/{auth_id}","href":"/api-reference/auth-service-v2/wait-for-auth-completion"},{"title":"Create Mcp Oauth Provider","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/auth/providers/mcp-discover","href":"/api-reference/auth-service-v2/create-mcp-oauth-provider"},{"title":"Get Oauth Provider","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/providers/{provider_id}","href":"/api-reference/auth-service-v2/get-oauth-provider"},{"title":"Delete Oauth Provider","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json delete /v2/auth/providers/{provider_id}","href":"/api-reference/auth-service-v2/delete-oauth-provider"},{"title":"Update Oauth Provider","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json patch /v2/auth/providers/{provider_id}","href":"/api-reference/auth-service-v2/update-oauth-provider"},{"title":"List Oauth Tokens For User","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/tokens","href":"/api-reference/auth-service-v2/list-oauth-tokens-for-user"},{"title":"Delete Oauth Tokens For User","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json delete /v2/auth/tokens","href":"/api-reference/auth-service-v2/delete-oauth-tokens-for-user"},{"title":"List Token Events For User","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/token-events","href":"/api-reference/auth-service-v2/list-token-events-for-user"},{"title":"Update Token Label","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json patch /v2/auth/tokens/{token_id}/metadata","href":"/api-reference/auth-service-v2/update-token-label"},{"title":"Import Oauth Token","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/auth/tokens/import","href":"/api-reference/auth-service-v2/import-oauth-token"},{"title":"Delete Single Oauth Token","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json delete /v2/auth/tokens/{token_id}","href":"/api-reference/auth-service-v2/delete-single-oauth-token"},{"title":"Check Oauth Token Exists","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/tokens/exists","href":"/api-reference/auth-service-v2/check-oauth-token-exists"},{"title":"Check Oauth Tokens Exist Batch","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/auth/tokens/exists/batch","href":"/api-reference/auth-service-v2/check-oauth-tokens-exist-batch"},{"title":"Check Workspace Slack Tokens Exist","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/tokens/workspace/slack/exists","href":"/api-reference/auth-service-v2/check-workspace-slack-tokens-exist"},{"title":"Revoke All Slack Tokens For Workspace","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json delete /v2/auth/tokens/workspace/slack","href":"/api-reference/auth-service-v2/revoke-all-slack-tokens-for-workspace"}]},{"group":"Agent Connections (v2)","pages":[{"title":"List Connections","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json get /v2/auth/agents/{agent_id}/connections","href":"/api-reference/agent-connections-v2/list-connections"},{"title":"Create Connection","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/auth/agents/{agent_id}/connections","href":"/api-reference/agent-connections-v2/create-connection"},{"title":"Remove Connection","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json delete /v2/auth/agents/{agent_id}/connections/{connection_id}","href":"/api-reference/agent-connections-v2/remove-connection"},{"title":"Upsert Agent Provider Token","deprecated":null,"version":null,"openapi":"https://api.host.langchain.com/openapi.json post /v2/auth/agents/{agent_id}/providers/{provider_id}/tokens","href":"/api-reference/agent-connections-v2/upsert-agent-provider-token"}]}]},{"title":"Agent Server changelog","sidebarTitle":"Agent Server changelog","href":"/langsmith/agent-server-changelog"},{"group":"Related","pages":[{"title":"LangGraph Python SDK","sidebarTitle":"LangGraph Python SDK","url":"https://reference.langchain.com/python/langgraph-sdk","href":"/langsmith/langgraph-python-sdk"},{"title":"LangGraph JS/TS SDK","sidebarTitle":"LangGraph JS/TS SDK","url":"https://reference.langchain.com/javascript/langchain-langgraph-sdk","href":"/langsmith/langgraph-js-ts-sdk"}]}]}]},{"tab":"Agent Server","pages":[{"title":"LangSmith Agent Server","sidebarTitle":"Overview","href":"/langsmith/agent-server"},{"group":"Develop your application","pages":[{"title":"Application structure","sidebarTitle":"Application structure","href":"/langsmith/application-structure"},{"group":"Set up dependencies","pages":[{"title":"How to set up an application with requirements.txt","sidebarTitle":"With requirements.txt","href":"/langsmith/setup-app-requirements-txt"},{"title":"How to set up an application with pyproject.toml","sidebarTitle":"With pyproject.toml","href":"/langsmith/setup-pyproject"},{"title":"How to set up a JavaScript application","sidebarTitle":"Set up a JavaScript application","href":"/langsmith/setup-javascript"},{"title":"How to customize the Dockerfile","sidebarTitle":"Customize the Dockerfile","href":"/langsmith/custom-docker"},{"title":"Monorepo support","sidebarTitle":"Monorepo support","href":"/langsmith/monorepo-support"}]},{"group":"Persistence","pages":[{"title":"Configure checkpointer backend","sidebarTitle":"Configure checkpointer backend","href":"/langsmith/configure-checkpointer"},{"title":"How to add TTLs to your application","sidebarTitle":"Add TTLs to your application","href":"/langsmith/configure-ttl"},{"title":"How to add semantic search to your agent deployment","sidebarTitle":"Add semantic search to your agent deployment","href":"/langsmith/semantic-search"}]}]},{"group":"Capabilities","pages":[{"group":"Assistants","pages":[{"title":"Assistants","sidebarTitle":"Overview","href":"/langsmith/assistants"},{"title":"Manage assistants","sidebarTitle":"Manage assistants","href":"/langsmith/configuration-cloud"}]},{"title":"Use threads","sidebarTitle":"Threads","href":"/langsmith/use-threads"},{"group":"Runs","pages":[{"title":"Runs","sidebarTitle":"Overview","href":"/langsmith/runs"},{"title":"How to kick off background runs","sidebarTitle":"Kick off background runs","href":"/langsmith/background-run"},{"title":"How to run multiple assistants on the same thread","sidebarTitle":"Run multiple assistants on the same thread","href":"/langsmith/same-thread"},{"title":"Stateless runs","sidebarTitle":"Stateless runs","href":"/langsmith/stateless-runs"},{"title":"How to cancel a run","sidebarTitle":"Cancel a run","href":"/langsmith/cancel-run"},{"title":"Prioritize runs","sidebarTitle":"Run priority","href":"/langsmith/run-priority"}]},{"title":"How to interact with a deployment using RemoteGraph","sidebarTitle":"Interact with a deployment using RemoteGraph","href":"/langsmith/use-remote-graph"},{"title":"Use cron jobs","sidebarTitle":"Cron jobs","href":"/langsmith/cron-jobs"},{"title":"Streaming API","sidebarTitle":"Streaming API","href":"/langsmith/streaming"},{"title":"Human-in-the-loop using server API","sidebarTitle":"Human-in-the-loop using server API","href":"/langsmith/add-human-in-the-loop"},{"title":"Time travel using the server API","sidebarTitle":"Time travel using the server API","href":"/langsmith/human-in-the-loop-time-travel"},{"group":"Double-texting","pages":[{"title":"Double texting","sidebarTitle":"Overview","href":"/langsmith/double-texting"},{"title":"Interrupt concurrent","sidebarTitle":"Interrupt","href":"/langsmith/interrupt-concurrent"},{"title":"Rollback Concurrent","sidebarTitle":"Rollback","href":"/langsmith/rollback-concurrent"},{"title":"Reject Concurrent","sidebarTitle":"Reject","href":"/langsmith/reject-concurrent"},{"title":"Enqueue concurrent","sidebarTitle":"Enqueue","href":"/langsmith/enqueue-concurrent"}]},{"title":"Use webhooks","sidebarTitle":"Webhooks","href":"/langsmith/use-webhooks"},{"title":"Distributed tracing with Agent Server","sidebarTitle":"Distributed tracing","href":"/langsmith/agent-server-distributed-tracing"},{"title":"MCP endpoint in Agent Server","sidebarTitle":"MCP endpoint in Agent Server","href":"/langsmith/server-mcp"},{"title":"Human-in-the-loop over MCP","sidebarTitle":"Human-in-the-loop over MCP","href":"/langsmith/server-mcp-elicitation"},{"title":"A2A endpoint in Agent Server","sidebarTitle":"A2A endpoint in Agent Server","href":"/langsmith/server-a2a"},{"title":"Agent Server changelog","sidebarTitle":"Changelog","url":"/https/docs.langchain.com/langsmith/agent-server-changelog","href":"/langsmith/agent-server-changelog-link"}]},{"group":"How to build","pages":[{"title":"How to collect user feedback for Agent Server runs","sidebarTitle":"Collect user feedback for Agent Server runs","href":"/langsmith/agent-server-feedback"},{"title":"How to implement generative user interfaces with LangGraph","sidebarTitle":"Implement generative user interfaces with LangGraph","href":"/langsmith/generative-ui-react"},{"title":"Implement a CI/CD pipeline using LangSmith Agent Server and Evaluation","sidebarTitle":"Implement a CI/CD pipeline","href":"/langsmith/cicd-pipeline-example"}]},{"group":"Auth \u0026 access control","pages":[{"title":"Authentication \u0026 access control","sidebarTitle":"Overview","href":"/langsmith/auth"},{"title":"Add custom authentication","sidebarTitle":"Add custom authentication","href":"/langsmith/custom-auth"},{"group":"Custom auth tutorial","icon":"school","pages":[{"title":"Set up custom authentication","sidebarTitle":"Set up custom authentication","href":"/langsmith/set-up-custom-auth"},{"title":"Make conversations private","sidebarTitle":"Make conversations private","href":"/langsmith/resource-auth"},{"title":"Isolate store data per user","sidebarTitle":"Isolate store per user","href":"/langsmith/store-auth"},{"title":"Connect an authentication provider","sidebarTitle":"Connect an authentication provider","href":"/langsmith/add-auth-server"}]},{"title":"Document API authentication in OpenAPI","sidebarTitle":"Document API authentication in OpenAPI","href":"/langsmith/openapi-security"},{"title":"Set up Agent Auth","tag":"Beta","href":"/langsmith/agent-auth"}]},{"group":"Server customization","pages":[{"title":"Use server-side caching","sidebarTitle":"Caching","href":"/langsmith/caching"},{"title":"Configure IAM authentication for data stores","sidebarTitle":"Data store IAM authentication","href":"/langsmith/configure-iam-auth"},{"group":"Encryption at rest","root":{"title":"Encryption at rest","sidebarTitle":"Encryption at rest","href":"/langsmith/encryption"},"pages":[{"title":"Configure AES encryption at rest","sidebarTitle":"AES encryption","href":"/langsmith/aes-encryption"},{"title":"Configure custom encryption at rest","sidebarTitle":"Custom encryption","href":"/langsmith/custom-encryption"}]},{"title":"Rebuild graph at runtime","sidebarTitle":"Rebuild graph at runtime","href":"/langsmith/graph-rebuild"},{"group":"Replace built-in backends","pages":[{"title":"How to use a custom store","sidebarTitle":"Add custom store","tag":"Alpha","href":"/langsmith/custom-store"},{"title":"How to use a custom checkpointer","sidebarTitle":"Add custom checkpointer","tag":"Alpha","href":"/langsmith/custom-checkpointer"}]},{"group":"Extend the HTTP server","pages":[{"title":"How to add custom routes","sidebarTitle":"Add custom routes","href":"/langsmith/custom-routes"},{"title":"How to add custom middleware","sidebarTitle":"Add custom middleware","href":"/langsmith/custom-middleware"},{"title":"How to add custom lifespan events","sidebarTitle":"Add custom lifespan events","href":"/langsmith/custom-lifespan"}]},{"group":"Headers and logging","pages":[{"title":"Use HTTP headers for runtime configuration","sidebarTitle":"Configurable headers","href":"/langsmith/configurable-headers"},{"title":"Include HTTP headers in server logs","sidebarTitle":"Logging Headers","href":"/langsmith/configurable-logs"}]}]}]},{"tab":"Deploy to Cloud","pages":[{"title":"Deploy to Cloud","sidebarTitle":"Cloud overview","icon":"cloud","iconType":"solid","mode":"wide","href":"/langsmith/deploy-to-cloud-overview"},{"title":"Cloud platform features","sidebarTitle":"Platform features","icon":"list-check","href":"/langsmith/cloud-platform-features"},{"group":"Deployment guide","pages":[{"title":"Create an Agent Server","href":"/langsmith/deploy-to-cloud"},{"title":"Agent Server revisions","sidebarTitle":"Revisions","href":"/langsmith/agent-server-revisions"},{"title":"Monitor an Agent Server","href":"/langsmith/monitor-agent-server"},{"title":"Preview builds","href":"/langsmith/preview-builds"},{"title":"Manage an Agent Server","href":"/langsmith/manage-agent-server"}]},{"group":"Reference","pages":[{"title":"Cloud Agent Server environment variables","sidebarTitle":"Environment variables","href":"/langsmith/env-var-cloud"}]}]},{"tab":"Deploy to Self-hosted","pages":[{"title":"Deploy to self-hosted","sidebarTitle":"Self-hosted overview","icon":"buildings","mode":"wide","href":"/langsmith/deploy-to-self-hosted-overview"},{"title":"Deploy with control plane","sidebarTitle":"With control plane","icon":"cloud-upload","href":"/langsmith/deploy-with-control-plane"},{"title":"Hybrid","sidebarTitle":"Hybrid","icon":"cloud","href":"/langsmith/hybrid"},{"title":"Self-host standalone servers","sidebarTitle":"Standalone servers","icon":"server","href":"/langsmith/deploy-standalone-server"},{"group":"Configure","pages":[{"title":"Self-hosted platform features","sidebarTitle":"Platform features","icon":"list-check","href":"/langsmith/self-hosted-platform-features"},{"title":"Agent Server metrics","sidebarTitle":"Agent Server metrics","icon":"chart-line","href":"/langsmith/self-hosted-agent-server-metrics"},{"title":"Configure Agent Server for scale","sidebarTitle":"Agent Server scaling","icon":"box-multiple","href":"/langsmith/agent-server-scale"},{"title":"Set up a build machine on a restricted network","sidebarTitle":"Build on a restricted network","icon":"world-off","href":"/langsmith/self-host-restricted-network-build"},{"title":"Troubleshooting for self-hosted deployments","sidebarTitle":"Troubleshooting","icon":"stethoscope","href":"/langsmith/diagnostics-self-hosted"}]},{"group":"Reference","pages":[{"title":"Self-hosted Agent Server environment variables","sidebarTitle":"Environment variables","href":"/langsmith/env-var-self-hosted"}]}]},{"tab":"Prompt \u0026 Context Hub","pages":[{"title":"Prompt \u0026 Context Hub","sidebarTitle":"Overview","mode":"wide","href":"/langsmith/prompt-context-hub"},{"group":"Prompts","pages":[{"title":"Prompt engineering quickstart","sidebarTitle":"Quickstart","href":"/langsmith/prompt-engineering-quickstart"},{"title":"Prompt engineering concepts","sidebarTitle":"Concepts","href":"/langsmith/prompt-engineering-concepts"},{"title":"LangSmith Chat","sidebarTitle":"Chat","url":"https://docs.langchain.com/langsmith/chat#prompt-engineering","icon":"feather","href":"/langsmith/chat-prompt-engineering"},{"title":"Model providers","sidebarTitle":"Model providers","href":"/langsmith/playground-model-providers"},{"group":"Create and manage prompts","pages":[{"title":"Create a prompt","sidebarTitle":"Create a prompt","href":"/langsmith/create-a-prompt"},{"title":"Manage prompts","sidebarTitle":"Manage prompts","href":"/langsmith/manage-prompts"},{"title":"Manage prompts programmatically","sidebarTitle":"Manage prompts programmatically","href":"/langsmith/manage-prompts-programmatically"},{"title":"Configure prompt settings","sidebarTitle":"Configure prompt settings","href":"/langsmith/managing-model-configurations"},{"title":"Prompt template format guide","sidebarTitle":"Prompt template format","href":"/langsmith/prompt-template-format"},{"title":"Use tools in a prompt","sidebarTitle":"Use tools in a prompt","href":"/langsmith/use-tools"},{"title":"Include multimodal content in a prompt","sidebarTitle":"Include multimodal content in a prompt","href":"/langsmith/multimodal-content"}]},{"title":"Write your prompt with AI","sidebarTitle":"Write your prompt with AI","href":"/langsmith/write-prompt-with-ai"},{"group":"Connect to models","pages":[{"title":"Connect to an OpenAI compliant model provider/proxy","sidebarTitle":"OpenAI-compliant model provider/proxy","href":"/langsmith/custom-openai-compliant-model"},{"title":"Connect to a compatible decision model provider","sidebarTitle":"Compatible decision model provider","href":"/langsmith/compatible-decision-model-provider"},{"title":"Connect to a custom model","sidebarTitle":"Custom model","href":"/langsmith/custom-endpoint"}]}]},{"group":"Context Hub","pages":[{"title":"Context engineering concepts","sidebarTitle":"Concepts","href":"/langsmith/context-engineering-concepts"},{"title":"Use the Context Hub","sidebarTitle":"Use the Context Hub","tag":"UI","href":"/langsmith/use-the-context-hub"},{"title":"Manage contexts with the SDK","sidebarTitle":"Manage contexts","tag":"SDK","href":"/langsmith/manage-contexts-sdk"},{"title":"Configure Context Hub commit webhooks","sidebarTitle":"Commit webhooks","href":"/langsmith/context-hub-webhooks"}]},{"group":"Tutorials","pages":[{"title":"Optimize a classifier","sidebarTitle":"Optimize a classifier","href":"/langsmith/optimize-classifier"},{"title":"How to sync prompts with GitHub","sidebarTitle":"Sync prompts with GitHub","href":"/langsmith/prompt-commit"},{"title":"Test multi-turn conversations","sidebarTitle":"Test multi-turn conversations","href":"/langsmith/multiple-messages"}]}]},{"tab":"Sandboxes","pages":[{"title":"LangSmith Sandboxes","sidebarTitle":"Overview","href":"/langsmith/sandboxes"},{"title":"Sandbox snapshots","sidebarTitle":"Snapshots","href":"/langsmith/sandbox-snapshots"},{"title":"Sandbox service URLs","sidebarTitle":"Service URLs","href":"/langsmith/sandbox-service-urls"},{"title":"Sandbox download links","sidebarTitle":"Download links","href":"/langsmith/sandbox-download-links"},{"title":"Sandbox auth proxy","sidebarTitle":"Auth proxy","href":"/langsmith/sandbox-auth-proxy"},{"title":"Sandbox mounts","sidebarTitle":"Mounts","href":"/langsmith/sandbox-mounts"},{"title":"Sandbox access permissions","sidebarTitle":"Permissions","href":"/langsmith/sandbox-permissions"},{"title":"Sandbox CLI","href":"/langsmith/sandbox-cli"},{"title":"Sandbox SDK usage","sidebarTitle":"SDK usage","href":"/langsmith/sandbox-sdk"},{"title":"Harbor integrations","href":"/langsmith/harbor-integrations"}]}]}]},{"product":"AGENT IMPROVEMENT","menu":[{"item":"Test","icon":"flask","description":"Evaluate and refine agents","tabs":[{"tab":"Get started","pages":[{"title":"Get started","href":"/langsmith/evaluation"}]},{"tab":"Datasets \u0026 Experiments","pages":[{"title":"Datasets \u0026 Experiments","href":"/langsmith/manage-datasets-in-application"}]},{"tab":"Evaluators","pages":[{"title":"Evaluators","href":"/langsmith/evaluation-types"}]},{"tab":"Annotation Queues","pages":[{"title":"Annotation Queues","href":"/langsmith/annotation-queues"}]},{"tab":"Test from Playground","pages":[{"title":"Test from Playground","href":"/langsmith/test-from-playground"}]},{"tab":"Test from Studio","pages":[{"title":"Test from Studio","href":"/langsmith/studio"}]}]},{"item":"Monitor","icon":"chart-line","description":"Trace, debug, and observe agents","tabs":[{"tab":"Overview","pages":[{"title":"Overview","href":"/langsmith/observability"}]},{"tab":"Trace","pages":[{"title":"Trace","href":"/langsmith/observability-quickstart"}]},{"tab":"Debug","pages":[{"title":"Debug","href":"/langsmith/view-traces"}]},{"tab":"Observe","pages":[{"title":"Observe","href":"/langsmith/dashboards"}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/langsmith/reference"}]}]},{"item":"Engine","icon":"https://mintlify.s3.us-west-1.amazonaws.com/langchain-5e9cc07a/images/brand/engine-icon-no-bg-dark.svg","description":"Find and fix agent issues","pages":[{"title":"Engine","href":"/langsmith/engine"}]}],"pages":[{"title":"AGENT IMPROVEMENT","href":"/langsmith/evaluation"}]},{"product":"AGENT GOVERNANCE","menu":[{"item":"LangSmith setup","icon":"server","description":"Hosting and administration","tabs":[{"tab":"Overview","pages":[{"title":"Overview","href":"/langsmith/langsmith-setup-overview"}]},{"tab":"Account","pages":[{"title":"Account","href":"/langsmith/admin"}]},{"tab":"Cloud","pages":[{"title":"Cloud","href":"/langsmith/cloud"}]},{"tab":"BYOC","pages":[{"title":"BYOC","href":"/langsmith/byoc"}]},{"tab":"Self-hosted","pages":[{"title":"Self-hosted","href":"/langsmith/self-hosted"}]},{"tab":"Govern","pages":[{"title":"Govern","href":"/langsmith/govern-overview"}]}]},{"item":"LLM Gateway","icon":"route","description":"Route, control, and observe LLM traffic","pages":[{"title":"LLM Gateway","href":"/langsmith/llm-gateway"}]},{"item":"Tool Gateway","icon":"https://mintlify.s3.us-west-1.amazonaws.com/langchain-5e9cc07a/images/ui/tool-gateway.svg","description":"Govern agent tool calls","pages":[{"title":"Tool Gateway","href":"/langsmith/tool-gateway"}]}],"pages":[{"title":"AGENT GOVERNANCE","href":"/langsmith/langsmith-setup-overview"}]}]},"basePath":"","title":"Build a deep research agent - Docs by LangChain","deploymentId":"dpl_GDNWf1tLGuMA7VZdZjLPVcJLRJgG","buildId":"dpl_GDNWf1tLGuMA7VZdZjLPVcJLRJgG","dynamics":["10e4515597"],"chunks":["BannerMarkdown-BJ4QEiLs.js","dist-B5y0bLg9.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}