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:
- Workflow definition API
- Step handlers
- Memory interface
- Execution management
Languages: TypeScript, Python
2. MDWR Control Plane
Converts workflows to canonical specification:
- Workflow compilation
- Step generation
- Deployment orchestration
3. Motia Runtime
Event-driven backend runtime:
- Step execution
- State management
- Event system
- Observability
4. Memory Layer
Decision storage and similarity search:
- Mem0 (production) - Cloud-based memory
- Redis (local development) - Local storage
- Automatic decision storage
- Similarity queries
Data Flow
- Define: Developer creates workflow using SDK
- Deploy: SDK compiles to canonical spec and generates Motia steps
- Execute: Workflow runs through Motia event system
- Store: Each decision automatically stored in memory
- Query: Future executions query similar decisions
- Learn: Workflows improve based on historical outcomes
Design Principles
MDWR is built on six core principles:
- Workflow-First API - Workflows are the primary abstraction
- Explainability by Default - Every decision must be explainable
- Memory is Implicit - Memory is always available, no config needed
- Identical Behavior - Same workflows, same results across languages
- Zero-Config Onboarding - Get started in minutes
- 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:
- Step generation
- State management
- Event flow
- Deployment process
Integration Points
Motia Integration
- Workflows converted to Motia Steps
- Steps placed in
motia-atlas/src/{workflow}/ - Uses Motia’s state management
- Leverages Motia’s event system
Memory Integration
- Automatic decision storage
- Similarity search via Mem0
- Outcome linking
- Cross-workflow learning
Next Steps
- Getting Started - Build your first workflow
- Guides - Learn advanced patterns
- API Reference - Complete API documentation