Skip to main content

Research Agent Tool

AI-powered research agent that searches and scrapes the internet to gather structured information

Quick Start

import { ResearchAgentTool } from '@bubblelab/bubble-core';
import { CredentialType } from '@bubblelab/shared-schemas';
const result = await new ResearchAgentTool({

task: 'example', // The research task that requires searching the internet and gathering information
expectedResultSchema: null, // Zod schema or JSON schema string that defines the expected structure of the research result. Example: z.object({ trends: z.array(z.string()).describe("An array of trends"), summary: z.string().describe("A summary of the trends") }) or JSON.stringify({ type: "object", properties: { trends: { type: "array", items: { type: "string" } }, summary: { type: "string" } } })
credentials: {
[CredentialType.FIRECRAWL_API_KEY]: process.env.FIRECRAWL_API_KEY as string,
},
}).action();

Operation Details

execute

task string required
The research task that requires searching the internet and gathering information
expectedResultSchema unknown required
Zod schema or JSON schema string that defines the expected structure of the research result. Example: z.object({ trends: z.array(z.string()).describe("An array of trends"), summary: z.string().describe("A summary of the trends") }) or JSON.stringify({ type: "object", properties: { trends: { type: "array", items: { type: "string" } }, summary: { type: "string" } } })
model 'openai/gpt-5' | 'openai/gpt-5-mini' | 'openai/gpt-5.1' | 'google/gemini-2.5-pro' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-image-preview' | 'google/gemini-3-pro-preview' | 'anthropic/claude-sonnet-4-5' | 'anthropic/claude-haiku-4-5' | 'openrouter/x-ai/grok-code-fast-1' | 'openrouter/z-ai/glm-4.6' | 'openrouter/anthropic/claude-sonnet-4.5' | 'openrouter/google/gemini-3-pro-preview' | 'openrouter/morph/morph-v3-large' | 'openrouter/x-ai/grok-4.1-fast' | 'openrouter/openai/gpt-oss-120b' | 'openrouter/deepseek/deepseek-chat-v3.1'
Model to use for the research agent (default: google/gemini-3-pro-preview)
maxTokens number
Maximum number of tokens for the research agent (default: 40000)
maxIterations number
Maximum number of iterations for the research agent (default: 100)
credentials Record<CredentialType,string>
Required credentials