stop hardcoding agent collaboration

Mozaik is a TypeScript framework for building autonomous teams of AI agents that are aware of each other, communicate through tools, and coordinate work in parallel.

Read on GitHub
Mozaik environment · scripted demo run

from workflows to autonomous teams

Replace predefined agent workflows with autonomous teams that collaborate, adapt, and work together.

Agent awareness

Give agents awareness of each other and the shared environment so they can react to what others are doing.

agent.ts
const agent = new Agent({
// know exactly who is in the room
onParticipantJoin(peer) {
greet(peer)
},
// react the moment a teammate leaves
onParticipantLeft(peer) {
reassign(peer.openTasks)
},
})

Intelligent communication

Let agents decide when to communicate, who to involve, and what context to share.

route message2 picked
Researcher+ context
Writerskip
Critic+ context
Auditorskip

Parallel by default

Enable multiple agents to work at the same time while staying coordinated through shared context.

agent.searchrunning
agent.draftrunning
agent.reviewrunning
agent.shiprunning

Adaptive runtime coordination

Let collaboration paths emerge at runtime instead of predicting every handoff upfront.

task

event-driven AI agents

Mozaik is built on a reactive, event-driven core: every message, tool call, reasoning step, and error is just an event on the bus. Agents subscribe to the events they care about and react in real time.

fire and forget

Run inference and move on — no waiting, no blocking. Results come back as events, and your agent reacts to the ones it cares about while everything else keeps running.

agent.ts
const agent = new Agent({
// the model wants to call a tool
async onFunctionCall(call) {
const result = await runTool(call.name, call.args)
// fire the result back as an event no blocking
agent.send({
type: "functionCallOutput",
callId: call.id,
result,
})
},
})

intelligent recovery

Agents capture every event — including system errors. With onError and onParticipantError, a participant catches failures and resolves them in real time, retrying intelligently instead of crashing the run.

agent.ts
const agent = new Agent({
// a tool threw or a participant crashed
async onError(error, ctx) {
if (ctx.attempt < 3) {
// back off and retry the run keeps going
await wait(backoff(ctx.attempt))
return ctx.retry()
}
// escalate to a teammate instead of crashing
agent.send({
type: "message",
to: "supervisor",
text: `failed: ${error.message}`,
})
},
})

collaboration layer for agents

Mozaik provides the missing collaboration layer for multi-agent systems. It gives autonomous agents the infrastructure to communicate, coordinate, and work together as a real team.

built on mozaik

Mozaik powers products that turn agent collaboration into shipped software.

baro is a Claude agent orchestrator. Ten specialized participants work fully concurrently on the same goal over a single Mozaik bus.

build agents that don’t wait on each other

Install Mozaik, join the environment, start streaming context items.