Introduction
Mozaik is a TypeScript framework for multi-agent collaboration — concurrent, aware, and adaptive.
Mozaik is a TypeScript framework for multi-agent collaboration. Humans, agents, and observers are all Participants of the same runtime. They share typed RuntimeState, publish SemanticEvents, and react through situation handlers.
v4 is a new runtime API. You create a session with defineRuntime, join participants built by createHuman / createAgent, and start thinking with runLoop. The older environment-and-handler-override style is gone.
Multi-agent collaboration
Mozaik is built around three attributes:
- Concurrency — Agents work alongside one another without blocking. Each
runLoopis fire-and-forget. - Awareness — Agents understand other participants, events, and their shared
RuntimeState. - Adaptivity — Agents change behavior based on runtime state and emerging needs, through situation handlers and interception.
Together, these let a team of agents and humans work on the same problem in one session.
Get started
Installation
Add @mozaik-ai/core and configure provider credentials.
Quickstart
Initialize a runtime, join a human and an agent, and send a message.
Runtime
defineRuntime and the functions you use for the session.
Situation handlers
When/then reactions to semantic events.
Explore the runtime
Participants
createHuman, createAgent, and observers.
Concurrent agents
Join several participants and let loops run in parallel.
Semantic events
The event bus: type, producerId, occurredAt, payload.
The agent loop
message_received through idle, including tools.
Interception
Rewrite a loop transition before it runs.
Guides
Tools
FunctionTool definitions and MCP servers.
Streaming
inference.stream chunks for live UIs.
Structured output
JSON Schema on InferenceInput.
Model context
ContextItem taxonomy and persistence.
Models
Bundled providers and custom inference runners.
Resources
Examples
mozaik-examples and projects built with Mozaik.
Mozaik on GitHub
Source, issues, and releases.
@mozaik-ai/core on npm
Published package and versions.
License
Mozaik is released under the MIT License by the JigJoy team.