Introduction
Mozaik is a TypeScript framework for building reactive agents that collaborate in an event-driven agentic environment.
Humans, agents, observers, and tools are all Participants of the same AgenticEnvironment. Each participant emits events — plain-text messages, typed ContextItems for model internals (function calls, outputs, reasoning, model messages), and SemanticEvent<T> stream chunks when inference is streaming — and every other participant sees those events as they arrive and decides whether to react, intercept, or stay silent. No central scheduler.
Get started
Installation
Add @mozaik-ai/core and configure your API key.
Quickstart
Spin up an environment with a human and an agent participant.
Reactive Agent
What a reactive agent is and how to build one with Mozaik.
Architecture
How environment, participants, capabilities, and generators fit together.
Why Mozaik
- Reactive agents — Agents react to events in the environment instead of following a hard-coded pipeline. Drop in a new participant and behavior emerges from how it reacts to what others emit.
- Event-driven agentic environment —
AgenticEnvironmentis a broadcast bus. Participantsjoin()and listen for the specific events they care about:onMessage,onFunctionCall,onReasoning,onModelMessage, and theironExternal*counterparts. - Collaborative by default — Multiple agents share one environment and adapt to each other in real time. Add a critic, a planner, or an observer without rewiring the existing ones.
- Reaction over orchestration — Every handler defaults to a no-op. Override only the ones you care about. Compose behaviors by joining participants, not by editing a central controller.
- Non-blocking under the hood — Capability methods stream items as they are produced, so a slow inference or tool call never holds up other participants.
- OpenResponses-aligned types —
ContextItemmirrors the OpenResponses vocabulary, so your domain types stay stable across providers.
Explore the framework
Agentic environment
The event bus that fans every message and item out to every participant.
Participants
BaseParticipant, roles as patterns, and reactive agents.
Capabilities & Tools
runInference, executeFunctionCall, sendMessage, and Tool definitions.
Streaming
Semantic events and live UIs with model streaming.
Core concepts
ModelContext, ContextItem taxonomy, and persistence.
Advanced
Resources
Mozaik on GitHub
Source, issues, and releases.
@mozaik-ai/core on npm
Published package and versions.
OpenResponses
Provider-agnostic LLM interface spec.
License
Mozaik is released under the MIT License by the JigJoy team.