Architecture

Understand how MDWR works under the hood and how it integrates with Motia and Mem0.

Overview

MDWR combines workflow orchestration with operational decision memory:

┌─────────────────┐
│  Developer SDK  │
│  (TypeScript/   │
│   Python)       │
└────────┬────────┘


┌─────────────────┐
│  MDWR Control   │
│     Plane       │
│  (Spec Compiler)│
└────────┬────────┘


┌─────────────────┐      ┌──────────────┐
│  Motia Runtime   │      │  Mem0/Redis  │
│  (Event-Driven) │◄────►│  (Memory)     │
└─────────────────┘      └──────────────┘

Core Components

1. Developer SDK

Language-specific SDKs that provide:

Languages: TypeScript, Python

2. MDWR Control Plane

Converts workflows to canonical specification:

3. Motia Runtime

Event-driven backend runtime:

4. Memory Layer

Decision storage and similarity search:

Data Flow

  1. Define: Developer creates workflow using SDK
  2. Deploy: SDK compiles to canonical spec and generates Motia steps
  3. Execute: Workflow runs through Motia event system
  4. Store: Each decision automatically stored in memory
  5. Query: Future executions query similar decisions
  6. Learn: Workflows improve based on historical outcomes

Design Principles

MDWR is built on six core principles:

  1. Workflow-First API - Workflows are the primary abstraction
  2. Explainability by Default - Every decision must be explainable
  3. Memory is Implicit - Memory is always available, no config needed
  4. Identical Behavior - Same workflows, same results across languages
  5. Zero-Config Onboarding - Get started in minutes
  6. Safe Evolution - Test changes with replay modes

Documentation

Architecture Overview

High-level system architecture and component interactions.

Design Principles

Core design principles that guide MDWR development.

Motia Integration

How MDWR integrates with Motia runtime, including:

Integration Points

Motia Integration

Memory Integration

Next Steps