Open source · MIT Licensed

Your backend architecture,
readable by machines.

SysMARA is a TypeScript framework where system architecture is a formal, machine-readable graph — not scattered across code, comments, and tribal knowledge. AI agents read your specs, understand constraints, and make safe changes.

Get Started → Why SysMARA GitHub
The Problem

AI agents see files, not architecture.

AI coding agents are powerful, but they operate blind. They can generate code, but they cannot reason about what a change will break, which invariants must hold, or which modules they should not touch.

Traditional frameworks — Express, NestJS, Rails, Django — were designed for human developers who carry the system's architecture in their heads. Decorators, middleware chains, and implicit conventions work when the person writing code already understands the system. AI agents do not have that context.

The result: AI-generated code that compiles but violates business rules, crosses module boundaries, breaks invariants, and requires constant human review to catch architectural mistakes.

The Solution

Explicit system truth.

SysMARA makes your architecture a formal artifact. Every entity, capability, policy, invariant, module boundary, and data flow is declared in YAML specs, validated with Zod schemas, and compiled into a typed system graph. There is nothing to guess. There is nothing hidden.

When an AI agent needs to add a capability, it reads the system graph, checks which entities are involved, which invariants must hold, which policies govern access, and which module boundaries it must respect. Before writing any code, it can generate a change plan with impact analysis and risk classification.

Architecture

Three pillars.

AI System Graph

A formal directed graph of your system: entities, capabilities, modules, policies, invariants, and flows as typed nodes with typed edges. A queryable, traversable graph that AI agents use to understand your system before changing it.

Learn more →

Capability Compiler

Reads your capability specs along with their entity, policy, and invariant bindings, then generates route handler stubs, test scaffolds, and capability metadata with SHA-256 checksums. Generated code is deterministic and regenerable.

Learn more →

Change Protocol

Before mutating code, generate a formal Change Plan: what changes, what's affected, what risk level, which invariants are at stake, and whether human review is required. AI agents plan changes before making them.

Learn more →
Primitives

What you declare.

Entities

Domain objects with typed fields, constraints, and module assignments. The nouns of your system.

Capabilities

Named operations with typed inputs/outputs, entity bindings, policy gates, and invariant checks. The verbs.

Policies

Access control rules with actor conditions, priority ordering, and allow/deny effects.

Invariants

Business rules that must hold. Bound to entities and capabilities. Enforced at compile time, runtime, or both.

Modules

Boundary enforcement. Explicit allowed/forbidden dependencies. Cycle detection. Ownership of entities and capabilities.

Safe Edit Zones

File ownership: generated (don't touch), editable (your code), protected (needs review), human-review-only.

In Practice

What it looks like.

Declare an entity

# system/entities.yaml
- name: subscription
  description: A recurring billing subscription
  module: billing
  fields:
    - name: plan_id
      type: string
      required: true
    - name: status
      type: string
      required: true
      constraints:
        - type: enum
          value: [active, paused, cancelled, past_due]
    - name: current_period_end
      type: datetime
      required: true
  invariants:
    - cannot_downgrade_with_unpaid_invoices

Declare a capability

# system/capabilities.yaml
- name: cancel_subscription
  description: Cancel an active subscription
  module: billing
  entities: [subscription, invoice]
  input:
    - name: subscription_id
      type: string
      required: true
    - name: reason
      type: string
      required: false
  output:
    - name: subscription
      type: object
      required: true
  policies: [billing_admin, owner_transfer]
  invariants: [cannot_downgrade_with_unpaid_invoices]
  sideEffects: [send_cancellation_email, prorate_final_invoice]

Build and inspect

$ sysmara validate
[OK] Parsed 4 entities, 14 capabilities, 5 policies, 8 invariants, 3 modules, 3 flows

$ sysmara impact entity subscription
Target: entity:subscription
Affected modules: billing, workspaces
Affected capabilities: cancel_subscription, upgrade_subscription, downgrade_subscription
Affected invariants: cannot_downgrade_with_unpaid_invoices
Impact radius: 12 nodes

$ sysmara plan create "Add team billing"
[OK] Change plan written to .framework/plans/plan-a1b2c3d4e5f6.yaml
Risk: medium | Affected nodes: 8 | Human review: yes
Examples

Real-world systems.

SaaS Billing

Users, workspaces, subscriptions, invoices. Includes a sample change plan for adding team billing.

3 modules · 14 capabilities · 8 invariants

View example →

Admin Approvals

Multi-step approval workflows with audit trails and human-review-only safe edit zones.

4 modules · approval chains · audit trails

View example →

Content Publishing

Article lifecycle state machine, media assets, moderation policies.

4 modules · 15 capabilities · 10 invariants

View example →

Ship AI-safe backends.

SysMARA is open source, MIT licensed, and designed for teams building with AI agents.

Get Started → Read the Philosophy