Introduction
Mozaik is a TypeScript runtime for interoperable AI agents — concurrent, aware, and adaptive.
Mozaik is a TypeScript runtime for interoperable AI agents. Humans, agents, and observers are all Participants of the same runtime. They share typed RuntimeState, publish SemanticEvents, and react through situation handlers. There is no central scheduler.
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.
Agent interoperability
Mozaik is built around three attributes:
- Concurrency — Agents work independently without blocking one another. 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 free agents from a specific harness so they can work across projects.
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
context_update 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.