{"id":44418502,"url":"https://github.com/jigjoy-ai/mozaik","last_synced_at":"2026-02-12T09:06:50.112Z","repository":{"id":299372016,"uuid":"994958298","full_name":"jigjoy-ai/mozaik","owner":"jigjoy-ai","description":"Mosaic is a TypeScript library for composing and orchestrating autonomous AI agents.","archived":false,"fork":false,"pushed_at":"2026-02-09T20:20:32.000Z","size":340,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"development","last_synced_at":"2026-02-10T16:42:54.001Z","etag":null,"topics":["agentic-ai","agentic-framework","agentic-workflow","ai-orchestration","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jigjoy-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-02T18:42:33.000Z","updated_at":"2026-02-09T20:20:36.000Z","dependencies_parsed_at":"2025-06-16T08:09:19.988Z","dependency_job_id":"586a3dbc-97d2-4aa2-8457-d6f1aecf778e","html_url":"https://github.com/jigjoy-ai/mozaik","commit_stats":null,"previous_names":["honeycomb-app/hexacore","jigjoy-io/mosaic","jigjoy-ai/mozaik"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/jigjoy-ai/mozaik","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jigjoy-ai%2Fmozaik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jigjoy-ai%2Fmozaik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jigjoy-ai%2Fmozaik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jigjoy-ai%2Fmozaik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jigjoy-ai","download_url":"https://codeload.github.com/jigjoy-ai/mozaik/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jigjoy-ai%2Fmozaik/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29361810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","agentic-framework","agentic-workflow","ai-orchestration","typescript"],"created_at":"2026-02-12T09:06:49.403Z","updated_at":"2026-02-12T09:06:50.106Z","avatar_url":"https://github.com/jigjoy-ai.png","language":"TypeScript","funding_links":[],"categories":["AI Orchestration \u0026 Deployment"],"sub_categories":["Workflow Orchestration for AI"],"readme":"# Mozaik\n\nMozaik is a TypeScript library for orchestrating AI agents, supporting both manually defined and AI-generated workflows.\n\n![Mosaic](https://www.rockform.co.uk/wp-content/uploads/2018/06/Picture6-1.jpg)\n\n---\n\n## 📦 Installation\n\n```bash\nyarn add @mozaik-ai/core\n```\n\n## API Key Configuration\n\nMake sure to set your API keys in a `.env` file at the root of your project:\n\n```env\n# For OpenAI\nOPENAI_API_KEY=your-openai-key-here\n\n# For Anthropic Claude\nANTHROPIC_API_KEY=your-anthropic-key-here\n```\n\n## Supported Models\n\nThe system supports OpenAI models (gpt-5, gpt-5-mini, gpt-5-nano, gpt-5.1) and Anthropic Claude models (Claude Sonnet, Haiku, and Opus 4.5) out of the box.\n\n---\n\n## Features\n\n### AI Agents\n\nThis feature lets developers create AI agents through a single unified request definition, making it easy to compose tasks and leverage multiple models. You can mix providers, choose the best model for each task, and build agents that work across different capabilities.\n\n```typescript\nimport \"dotenv/config\"\nimport { Agent, Command } from \"@mozaik-ai/core\"\n\nconst command: Command = {\n\tmodel: \"claude-sonnet-4.5\",\n}\n\nconst agent = new Agent(command)\nconst codingResponse = await agent.act(\"Write a React component for a todo list\")\n```\n\n### Structured Output\n\nStructured output lets you enforce exact response formats—using schemas like Zod—so AI returns predictable, validated data every time.\n\n```typescript\nimport { z } from \"zod\"\nimport { Agent, Command } from \"@mozaik-ai/core\"\n\nconst mealPlanSchema = z.object({\n\tcalories: z.number(),\n\tmeals: z\n\t\t.array(\n\t\t\tz.object({\n\t\t\t\tname: z.string(),\n\t\t\t\tdescription: z.string(),\n\t\t\t\tingredients: z.array(z.string()).min(3),\n\t\t\t}),\n\t\t)\n\t\t.length(3),\n\tshoppingList: z.array(z.string()),\n})\n\nconst command: Command = {\n\tmodel: \"gpt-5-mini\",\n\ttask: \"Create a 1-day vegetarian meal plan with breakfast, lunch, and dinner.\",\n\tstructuredOutput: mealPlanSchema,\n}\n\nconst agent = new Agent(command)\nconst response = await agent.act()\n```\n\n### Multi-turn Conversation\n\nMulti-turn conversation allows developers to provide chat history so the AI agent can maintain context and generate more relevant, continuous responses.\n\n```typescript\nimport { Agent, Command } from \"@mozaik-ai/core\"\n\nconst command: Command = {\n\tmessages: [\n\t\t{ role: \"system\", content: \"You are a coding assistant\" },\n\t\t{ role: \"user\", content: \"How do I sort an array in TypeScript?\" },\n\t\t{ role: \"assistant\", content: \"You can use the .sort() method...\" },\n\t],\n\tmodel: \"claude-haiku-4.5\",\n}\n\nconst agent = new Agent(command)\nconst response = await agent.act(\"Can you show me an example?\")\n```\n\n### Tool Calling\n\nTool calling allows the agent to invoke real functions in your environment—letting it perform actual actions (like writing files, calling APIs, or modifying state) instead of merely generating text.\n\n```typescript\nimport { promises as fs } from \"fs\"\nimport { Agent, Command, Tool } from \"@mozaik-ai/core\"\n\nconst tools: Tool[] = [\n\t{\n\t\tname: \"write_file\",\n\t\tdescription: \"Write text to a file.\",\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tfilename: { type: \"string\" },\n\t\t\t\tcontent: { type: \"string\" },\n\t\t\t},\n\t\t\trequired: [\"filename\", \"content\"],\n\t\t},\n\t\tasync invoke({ filename, content }) {\n\t\t\tawait fs.writeFile(filename, content, \"utf8\")\n\t\t\treturn { ok: true }\n\t\t},\n\t},\n]\n\nconst command: Command = {\n\tmodel: \"gpt-5.1\",\n\ttools,\n\tmessages: [\n\t\t{\n\t\t\trole: \"system\",\n\t\t\tcontent: \"Save notes to disk using the tool, then confirm where the file was written.\",\n\t\t},\n\t],\n\ttask: \"Create a two-bullet trip prep checklist for Belgrade and save it as trip-checklist.txt.\",\n}\n\nconst agent = new Agent(command)\nawait agent.act()\n```\n\n### Vision\n\nVision support allows AI agents to interpret images alongside text, enabling richer understanding and multimodal interactions.\n\n```typescript\nimport { Agent, Command } from \"@mozaik-ai/core\"\n\nconst command: Command = {\n\tmessages: [\n\t\t{\n\t\t\trole: \"user\",\n\t\t\tcontent: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"image_url\",\n\t\t\t\t\turl: \"data:image/jpeg;base64,/9j/4AAQSkZJRg...\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext: \"What is in this image?\",\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n\tmodel: \"claude-opus-4.5\",\n}\n\nconst agent = new Agent(command)\nconst response = await agent.act()\n```\n\n### Parallel Task Execution\n\nThis example demonstrates how to use standard JavaScript/TypeScript concurrency (Promise.all) to run multiple AI agents in parallel and compare or combine their responses.\n\n```typescript\nimport \"dotenv/config\"\nimport { Agent, Command } from \"@mozaik-ai/core\"\n\nconst openaiCommand: Command = {\n\tmodel: \"gpt-5\",\n}\n\nconst anthropicCommand: Command = {\n\tmodel: \"claude-sonnet-4.5\",\n}\n\nconst openaiAgent = new Agent(openaiCommand)\nconst anthropicAgent = new Agent(anthropicCommand)\n\nconst task = \"What are the key differences between TypeScript and JavaScript?\"\n\n// Execute both agents in parallel using Promise.all()\nconst [openaiResponse, anthropicResponse] = await Promise.all([openaiAgent.act(task), anthropicAgent.act(task)])\n```\n\n### Workflow\n\nA workflow defines how tasks are executed together, either sequentially (one after another) or in parallel. Each task or workflow is a `WorkUnit`, which allows workflows to be composed and nested to build more complex execution pipelines.\n\n```typescript\nconst workflow = new Workflow(\"sequential\", [\n\tnew Task(\"Analyze requirements\", \"gpt-5\"),\n\tnew Workflow(\"parallel\", [\n\t\tnew Task(\"Generate API schema\", \"gpt-5-mini\"),\n\t\tnew Task(\"Draft documentation\", \"gpt-5-nano\"),\n\t]),\n\tnew Task(\"Review and finalize\", \"gpt-5\"),\n])\n\nawait workflow.execute()\n```\n\n### AI Autonomy\n\nDevelopers can create autonomous agents using an AI planner agent. The planner works as a meta-agent: it breaks a high-level goal into smaller tasks, assigns each task to a specialized agent, and coordinates their execution through a workflow.\n\nFor example, given the goal `\"Implement login functionality\"`, the planner can generate the following workflow:\n\n```typescript\nWorkflow(sequential, [\n\tTask(\"Design login form UI\", \"gpt-5\"),\n\tTask(\"Implement authentication logic\", \"claude-sonnet-4.5\"),\n\tWorkflow(parallel, [Task(\"Add input validation\", \"gpt-5-mini\"), Task(\"Style the login form\", \"gpt-5-nano\")]),\n\tTask(\"Write unit tests\", \"gpt-5\"),\n])\n```\n\n### Autonomy Slider\n\nBy combining manually created workflows with the AI Planner, you can build hybrid workflows and control the level of autonomy, deciding which steps are fixed and which are planned automatically.\n\n---\n\nWorking examples are available on the [GitHub repo](https://github.com/jigjoy-ai/mosaic-examples).\n\n---\n\n### Execution Hooks\n\nExecution hooks allow you to attach custom behavior to workflow and task execution without changing the workflow logic itself. Hooks are invoked at key lifecycle moments (before/after task or workflow execution) and are passed into `execute()`.\n\nA default hook cluster is provided out of the box, but you can extend or replace it to add logging, metrics, tracing, or other instrumentation.\n\n#### Extending the default hooks\n\nYou can add your own hooks by creating a new cluster or extending the default one:\n\n```ts\nimport { ClusterHook } from \"@core/workflow/hooks/cluster\"\nimport { DEFAULT_CLUSTER_HOOK } from \"@core/workflow/hooks\"\nimport { MetricsHook } from \"./metrics-hook\"\n\nconst extendedHook = new ClusterHook([DEFAULT_CLUSTER_HOOK, new MetricsHook()])\n\nawait workflow.execute(extendedHook)\n```\n\nIf you’re building agentic systems and want to learn or connect with like-minded developers, join [our Discord](https://discord.gg/33uMhcerDU) where we share ideas and knowledge.\n\n---\n\n## Author \u0026 License\n\nCreated by [JigJoy](https://jigjoy.io) team  \nLicensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjigjoy-ai%2Fmozaik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjigjoy-ai%2Fmozaik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjigjoy-ai%2Fmozaik/lists"}