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
- Input Schema
- Output Schema
taskstring required- The research task that requires searching the internet and gathering information
expectedResultSchemaunknown 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)
maxTokensnumber- Maximum number of tokens for the research agent (default: 40000)
maxIterationsnumber- Maximum number of iterations for the research agent (default: 100)
credentialsRecord<CredentialType,string>- Required credentials
resultunknown required- The research result matching the expected JSON schema structure, parsed to object
summarystring required- 1-2 sentence summary of what research was conducted and completed
sourcesUsedstring[] required- Array of URLs and sources that were searched and scraped during research
iterationsUsednumber required- Number of AI agent iterations used to complete the research
successboolean required- Whether the research task was completed successfully
errorstring required- Error message if research failed