Skip to content

jigjoy-ai/mozaik-examples

Repository files navigation

Mozaik Examples

This repository contains small, runnable TypeScript examples built with @mozaik-ai/core.

Each example is a self-contained mini project with its own package.json and tsconfig.json. Install and run them independently.

The examples:

  • terminal-agent/ — a terminal-capable agent that can run shell commands and use the results to complete tasks
  • inference-interception/ — two streaming agents plus an observer; a safety reviewer intercepts the planner's stream in real time
  • history-simulation/ — multiple historical-figure agents debating in a shared environment with a transcript observer
  • wrong-asnwer/ — a reactive agent with a tool, logging the transcript while answering a simple question

Prerequisites

  • Node.js 18+
  • An OpenAI API key for examples that use inference

Running an example

Each example follows the same workflow. From inside the example's folder:

cd terminal-agent      # or any other example folder
npm install

Create a .env file in that same folder:

OPENAI_API_KEY=your_api_key_here

Then run it:

npm start

Each project also exposes:

npm run build   # compile TypeScript to ./dist
npm run watch   # compile in watch mode
npm run clean   # remove ./dist

Repository structure

.
├── terminal-agent/
│   ├── package.json
│   ├── tsconfig.json
│   └── ...
├── inference-interception/
│   ├── package.json
│   ├── tsconfig.json
│   └── ...
├── history-simulation/
│   ├── package.json
│   ├── tsconfig.json
│   └── ...
├── wrong-asnwer/
│   ├── package.json
│   ├── tsconfig.json
│   └── ...
├── purpose.md
└── README.md

Notes

  • This repository is primarily an examples and experimentation workspace.
  • Each example installs its own dependencies, so there is no shared root package.json.
  • The terminal agent can run arbitrary shell commands, so use it carefully in trusted environments.

About

This example project showcases how to use @mozaik-ai/core for building collaborative agents

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages