Ai Agent Bubble
AI agent with LangGraph for tool-enabled conversations, multimodal support, and JSON mode
Quick Start
import { AIAgentBubble } from '@bubblelab/bubble-core';
import { CredentialType } from '@bubblelab/shared-schemas';
const result = await new AIAgentBubble({
message: 'example', // The message or question to send to the AI agent
credentials: {
[CredentialType.OPENAI_CRED]: process.env.OPENAI_CRED as string,
},
}).action();
Operation Details
execute
- Input Schema
- Output Schema
messagestring required- The message or question to send to the AI agent
imagesunknown[]- Array of base64 encoded images to include with the message (for multimodal AI models). Example: [{type: "base64", data: "base64...", mimeType: "image/png", description: "A beautiful image of a cat"}] or [{type: "url", url: "https://example.com/image.png", description: "A beautiful image of a cat"}]
systemPromptstring- System prompt that defines the AI agents behavior and personality
namestring- A friendly name for the AI agent
modelobject- AI model configuration including provider, temperature, and tokens. For model unless otherwise specified, use google/gemini-2.5-flash as default. Use google/gemini-2.5-flash-image-preview to edit and generate images.
toolsobject[]- Array of pre-registered tools the AI agent can use. Can be tool types (web-search-tool, web-scrape-tool, web-crawl-tool, web-extract-tool, instagram-tool). If using image models, set the tools to []
customToolsobject[]- Array of custom runtime-defined tools with their own schemas and functions. Use this to add domain-specific tools without pre-registration. Example: [{ name: "calculate-tax", description: "Calculates sales tax", schema: { amount: z.number() }, func: async (input) => {...} }]
maxIterationsnumber- Maximum number of iterations for the agent workflow, 2 iterations per turn of conversation
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
streamingboolean- Enable real-time streaming of tokens, tool calls, and iteration progress
responsestring required- The AI agents final response to the user message. For text responses, returns plain text or JSON string. For image generation models (like gemini-2.5-flash-image-preview), returns base64-encoded image data with data URI format (data:image/png;base64,...)
toolCallsobject[] required- Array of tool calls made during the conversation
iterationsnumber required- Number of back-and-forth iterations in the agent workflow
errorstring required- Error message of the run, undefined if successful
successboolean required- Whether the agent execution completed successfully