Skip to main content

Compose AI like you
compose code.

A composition layer on the Vercel AI SDK. Type-safe, stateless processors — define a goal, define an output schema, call .process(). Chain them into pipelines.

import { Baleybot, pipeline, parallel } from '@baleybots/core';

const researcher = Baleybot.create({
name: 'researcher',
goal: 'Research a topic and gather key facts',
});

const writer = Baleybot.create({
name: 'writer',
goal: 'Write a clear summary from research notes',
});

const critic = Baleybot.create({
name: 'critic',
goal: 'Review for accuracy and clarity',
});

// Compose processors into a pipeline
const article = pipeline(researcher, writer, critic);

const result = await article.process('AI agents in 2025');

One interface. Infinite compositions.

Every agent exposes .process(input) — the same interface as a pipeline, a parallel group, or a tool. Build them small. Compose them large.

An agent

const researcher = Baleybot.create({
name: 'researcher',
goal: 'Research a topic',
});

const result = await researcher.process(
'AI agents'
);

A pipeline

import { pipeline } from '@baleybots/core';

const workflow = pipeline(
researcher,
writer,
editor,
);

const article = await workflow.process(
'AI agents'
);

A parallel

import { parallel } from '@baleybots/core';

const analysis = parallel({
sentiment: sentimentBot,
topics: topicsBot,
summary: summaryBot,
});

const results = await analysis.process(
text
);

What each layer gives you

Baleybots builds on AI SDK v7 for providers, streaming, structured output, and tool loops. It adds composition for multi-processor workflows.

CapabilityAI SDK (v7)Baleybots + AI SDK
Provider & model callsstreamText, generateObject, multi-providerSame AI SDK providers, composed through Processable
Structured outputOutput.object(), Zod schemasZod on Baleybot; validated across composed pipelines
Tool loopsstopWhen, maxStepsstopWhen on Baleybot with sensible defaults
StreamingstreamText(), UI message streamsSegment reducers; typed events for nested processors
Processor compositionPer-request primitivespipeline(), parallel(), graph, agents-as-tools
Tool approvalneedsApproval, approval flowsIntegrated into Baleybot and useChat Processable loop
Multi-agent orchestrationTeam dispatch, Crew coordinator, ticket workers
Host surfaces@baleybots/react, CLI, BAL