Skip to main content

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

message string required
The message or question to send to the AI agent
images unknown[]
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"}]
systemPrompt string
System prompt that defines the AI agents behavior and personality
name string
A friendly name for the AI agent
model object
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.
tools object[]
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 []
customTools object[]
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) => {...} }]
maxIterations number
Maximum number of iterations for the agent workflow, 2 iterations per turn of conversation
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)
streaming boolean
Enable real-time streaming of tokens, tool calls, and iteration progress