Architecture Overview
MDWR combines workflow orchestration with operational decision memory.
High-Level Architecture
┌─────────────────┐
│ Developer SDK │
│ (TypeScript/ │
│ Python) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ MDWR Control │
│ Plane │
│ (Spec Compiler)│
└────────┬────────┘
│
▼
┌─────────────────┐ ┌──────────────┐
│ Motia Runtime │ │ Mem0/Redis │
│ (Event-Driven) │◄────►│ (Memory) │
└─────────────────┘ └──────────────┘
Components
1. Developer SDK
Language-specific SDKs (TypeScript, Python) that provide:
- Workflow definition API
- Step handlers
- Memory interface
- Execution management
2. MDWR Control Plane
Converts workflows to canonical specification and deploys to Motia:
- 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)
- Redis (local development)
- Automatic decision storage
- Similarity queries
Data Flow
- Define Workflow: Developer creates workflow using SDK
- Deploy: SDK compiles to canonical spec and generates Motia steps
- Execute: Workflow runs through Motia event system
- Store Decisions: Each decision automatically stored in memory
- Query Memory: Future executions query similar decisions
- Learn: Workflows improve based on historical outcomes
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
- Design Principles - Core principles
- Motia Integration - Integration details