Mozaik Agent Runtime
Build TypeScript agents that collaborate concurrently through a shared, event-driven runtime.
- Source repo
- jigjoy-ai/mozaik
- Stars
- ★ 163
- Last updated
- 4d ago
- License
- MIT
- Primary language
- TypeScript
- FA score
- 54/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI API · Claude API
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Engineers building TypeScript multi-agent applications can have several agents work concurrently toward a shared goal and coordinate through runtime events.
- Not a fit if
- Users seeking a ready-made chat app or hosted service
- Teams needing built-in persistence for messages, tools, and runtime state
- Source review
- 54/100 · Major gaps
What does this agent do, and when should you use it?
Mozaik is a TypeScript runtime and framework for building interoperable AI agents in a shared space. Create a runtime with defineRuntime and keep shared data in a RuntimeState subclass; create participants with createAgent and createHuman. Once joined, participants receive SpaceEvent events, match them with SituationSpecification, and react through SituationProcessor. runLoop drives an agent state machine without blocking its caller, supporting inference, tool calls, and optional streaming; model results and lifecycle events are published to all joined participants. Mozaik is an npm package imported into application code, not a hosted product; the consuming application owns deployment, persistence, and UI.
Install @mozaik-ai/core and call defineRuntime in a TypeScript application, then initialize a RuntimeState with initializeRuntime. Define agents with createAgent, including their instructions, tools, capabilities, and handlers; define human participants with createHuman, and manage membership through join and leave. Participants publish events with sendMessage or sendEvent; handlers use SituationSpecification to decide whether to react and SituationProcessor.apply to start a runLoop, update shared state, or perform other application logic. The agent loop calls a model and runs matching tools, publishing events such as inference, tool-call, and model.answer events. The application supplies model credentials and decides how to persist outputs and deploy the resulting app.
- Engineers building TypeScript multi-agent applications can have several agents work concurrently toward a shared goal and coordinate through runtime events.
- Framework teams can compose event conditions and reactions separately with
SituationSpecificationandSituationProcessor. - Developers who need to audit or display agent activity can add an observer participant to record events such as
model.answer. - Teams that want to review or rewrite agent actions before execution can inspect loop transitions with an
InterceptionHandler. - Application developers who need agents to adapt to shared runtime data can extend
RuntimeStateand read or write it from handlers.
How do you install or deploy this agent?
Install the package in a TypeScript project that uses Node.js, then configure credentials for the model providers you use. The README does not specify a Node.js version, build command, or deployment method.
How do you use this agent?
Set credentials for the providers you use in .env. DeepSeek uses an OpenAI-compatible chat-completions endpoint, so point OPENAI_API_KEY and OPENAI_BASE_URL at DeepSeek. This example creates a runtime, joins an agent and a human participant, and starts an agent loop; replace gpt-5.5 with the model name you intend to use and that the runtime supports.
What are this agent's strengths and limitations?
- Each
runLoopgets its ownloopId, allowing different agents or multiple loops for one agent to run concurrently. SpaceEventevents fan out to all joined participants, and the runtime does not wait for processors to finish, so a slow processor does not block producers.- The README lists credentials for OpenAI, Anthropic, and Gemini, and documents DeepSeek through an OpenAI-compatible endpoint.
InterceptionHandlercan inspect and rewrite a transition before it executes, enabling human oversight of loop actions.
- It must be integrated into a TypeScript application; the README documents no standalone chat app or hosted service.
- Model calls require credentials for the provider in use; DeepSeek also requires an OpenAI-compatible base URL configuration.
- The README does not document a database or persistence layer; shared data lives in
RuntimeState, so the application must handle persistence. - Processor calls to
runLoopandsendMessageare fire-and-forget; the README cautions against awaiting them inside a processor.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Mozaik Agent Runtime This agent | 54 · Major gaps | Library / SDKFree + model costs | ★ 163 | 4d ago | TypeScript | OpenAI API · Claude API |
| Pi Agent Harness | 42 · Major gaps | CLIFree + model costs | ★ 117k | today | TypeScript | OpenAI API · Claude API |
| MiniCode | 50 · Major gaps | CLIFree + model costs | ★ 1.2k | 14d ago | TypeScript | Claude API |
| Remnic Agent Memory | 85 · Good | CLIFree + model costs | ★ 227 | today | TypeScript | ChatGPT · Codex · Claude Code · OpenAI API |
How does FollowAgents rate this agent?
Why each dimension lost points
The README makes data flow relatively visible by explaining that RuntimeState is shared mutable state, events fan out to every joined participant, and there is no internal/external event split, earning 2 for transparency. Tools can run through runLoop and an interceptor can rewrite tool-call input, but the materials do not show permission isolation, per-action user approval, sensitive-data safeguards, external-effect controls, or rollback, so least privilege, confirmation, sensitive-data handling, external effects, and rollback each score 1. The README names environment variables for provider keys but gives no storage or leakage protections; dependency security has no audit evidence, so both score 1. An author and team are named, but publisher identity is unverified and maintenance responsibility is unclear, so source attribution scores 1.
The README gives concrete behavior for initialization, repeated initialization, asynchronous event delivery, and fire-and-forget loops, and these descriptions are broadly consistent, earning 2 for self-consistency. No dependency locking or availability assurances are shown, so dependency availability scores 1. Clear error text is documented for calls before initialization and repeated initialization, earning 2; failure propagation or recovery for asynchronous processors is only lightly covered.
The README describes collaborative, multi-agent, observer, and event-reaction scenarios and includes TypeScript API examples, earning 2 for audience and scenarios. It states boundaries such as having no built-in situation specifications, broadcasting events to all participants, and running loops in the background, earning 2. Handler matching is explicitly driven by event type and producerId predicates, though users must define those predicates, earning 2 for trigger precision. Installation, package entry points, and provider environment variables are documented, but the runtime support matrix is incomplete, so environment fit scores 2.
The README is organized into clear sections with API tables and diagrams, earning 3 for information architecture. It provides npm, yarn, and pnpm installation commands and credential setup, but not complete prerequisites, earning 2 for install notes. Package and API names and a version field are clear, but migration guidance is absent, so naming stability scores 2. Examples cover core patterns and link to an external examples repository, but there is no FAQ, earning 2. Limitations including no built-in specifications, shared mutable state, non-awaited delivery, and fire-and-forget loops are documented, earning 2. LICENSE and package.json both identify MIT, earning 3. package.json shows a beta version but no changelog, earning 1 for versioning and changelog. The README points to contribution guidelines and package.json names an author, but neither makes maintenance responsibility or update commitments clear, earning 1.
The README supplies usable API snippets, event tables, and loop-state descriptions that support an initial implementation, earning 2 for output usability. Concurrency, shared events, and interception provide a concrete framework value proposition, but no quantified comparisons or operating results are supplied, earning 2 for marginal value. Provider credentials and multiple SDK dependencies are required, while the materials do not weigh benefits against integration costs, so cost-benefit scores 1.
Most API and behavior claims are tied to named functions, events, or code snippets, earning 2 for claim traceability. The supplied materials are README, LICENSE, and package.json; a test script is listed but no test contents are provided for cross-checking, so cross-source corroboration scores 1. The README presents goals as project claims and explains specific behavior with API/code examples, but offers no independent validation, earning 2 for fact/inference separation.
- Shared RuntimeState and events broadcast to all participants may expose conversation or state; integrators need to define access boundaries and sensitive-data handling.
- runLoop can execute tools, and interceptors can rewrite call input; the documentation does not establish default per-action confirmation, permission limits, or side-effect rollback.
- The materials include no dependency audit, test contents, or changelog; do not treat the test script in package.json as evidence of verified test results.
FAQ
Is Mozaik a ready-to-use chat application?
Which model credentials do I need?
OPENAI_API_KEY, ANTHROPIC_API_KEY, and GEMINI_API_KEY. DeepSeek uses OPENAI_API_KEY and an OPENAI_BASE_URL pointed at DeepSeek.Do agents run concurrently?
runLoop starts an independent loop and returns immediately, so multiple loops can run at the same time.Does Mozaik persist conversations and runtime state automatically?
RuntimeState as the shared state object but does not document a built-in database or persistence mechanism. The application must handle persistence.Can I intercept a tool call before it runs?
InterceptionHandler to runLoop to inspect a pending transition and return a rewritten transition before execution.