<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/smMoefadv" -->

---
title: GitHub - jigjoy-ai/mozaik-rule-engine: Rule engine for...
description: Mozaik is a TypeScript rule engine that decides what a program should execute at runtime. Developers define conditions, commands and input resolvers with...
canonical: https://daily.dev/posts/smmoefadv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: GitHub - jigjoy-ai/mozaik-rule-engine: Rule engine for changing program behavior at runtime. | daily.dev
og:description: Mozaik is a TypeScript rule engine that decides what a program should execute at runtime. Developers define conditions, commands and input resolvers with...
og:url: https://daily.dev/posts/smmoefadv
og:image: https://api.daily.dev/og/posts/smMoefadv.png
og:image:alt: Post cover image
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub - jigjoy-ai/mozaik-rule-engine: Rule engine for changing program behavior at runtime.

**[JigJoy](https://daily.dev/sources/jigjoy)** · [@mijura](https://daily.dev/mijura) · 2 upvotes · 1 comments

## Summary

Mozaik is a TypeScript rule engine that decides what a program should execute at runtime. Developers define conditions, commands and input resolvers with decorators, then combine them into rules with a priority. A smaller priority number wins, an omitted priority defaults to 0, and ties go to the earlier rule. The engine uses standard JavaScript decorators, so `experimentalDecorators` must stay off. The authors built it to change an AI agent's behavior mid-loop, such as pausing a file edit if another agent changed the file since it was read.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://github.com/jigjoy-ai/mozaik-rule-engine>

## Community discussion

Top comments from developers on daily.dev.

**@mijura** · 0 upvotes

> While building Mozaik, I wanted an abstraction that would let agents change their behavior at runtime based on the situation.
>
> Today I extracted it into a standalone rule engine - useful for any program, not just agents.

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#typescript](https://daily.dev/tags/typescript)

[View this post on daily.dev](https://daily.dev/posts/smmoefadv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/smmoefadv","headline":"GitHub - jigjoy-ai/mozaik-rule-engine: Rule engine for changing program behavior at runtime.","text":"Shared: GitHub - jigjoy-ai/mozaik-rule-engine: Rule engine for changing program behavior at runtime.","url":"https://daily.dev/posts/smmoefadv","datePublished":"2026-11-19T18:25:25.173Z","dateModified":"2026-11-20T18:25:18.957Z","author":{"@type":"Person","name":"Miodrag Vilotijević","url":"https://daily.dev/mijura","image":"https://media.daily.dev/image/upload/s--uIBF-6uj--/f_auto/v1781707716/avatars/avatar_O2oTonSAf?_a=BAMAMiWQ0","description":"Building a communication network for AI agents","worksFor":{"@type":"Organization","name":"JigJoy","logo":"https://media.daily.dev/image/upload/s--Q3hImfch--/c_limit,w_256/f_auto,q_auto/v1782805765/logos/jigjoy?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":6880}},"image":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/KLcOUIgV5"},"comment":[{"@type":"Comment","text":"While building Mozaik, I wanted an abstraction that would let agents change their behavior at runtime based on the situation.\nToday I extracted it into a standalone rule engine - useful for any program, not just agents.","datePublished":"2026-11-19T18:26:53.234Z","url":"https://daily.dev/posts/smMoefadv#c-Dw4Dj1jtS","author":{"@type":"Person","name":"Miodrag Vilotijević","url":"https://daily.dev/mijura","image":"https://media.daily.dev/image/upload/s--uIBF-6uj--/f_auto/v1781707716/avatars/avatar_O2oTonSAf?_a=BAMAMiWQ0"}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/jigjoy","name":"JigJoy"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"JigJoy","item":"https://daily.dev/squads/jigjoy"},{"@type":"ListItem","position":3,"name":"GitHub - jigjoy-ai/mozaik-rule-engine: Rule engine for changing program behavior at runtime."}]}
```

