MentatLab docs
High-Level Components
Architecture
MentatLab separates workflow design, orchestration, and execution into clear service boundaries.
High-Level Components
- Frontend (
services/frontend)- React + ReactFlow Mission Control canvas
- Panels for console, timeline, and issues
- Interacts with Gateway over HTTP/SSE/WebSocket
- Gateway (
services/gateway-go)- API proxy to Orchestrator
- WebSocket/SSE fanout and middleware (auth, rate limits, headers)
- Orchestrator (
services/orchestrator-go)- DAG scheduler and run lifecycle
- Agent registry, flow store, run store
- Execution backends (memory/redis/k8s)
- Redis
- Shared run state and messaging backend (when configured)
- Agents (
agents/)- External processes or workloads following stdin/stdout NDJSON contract
Request/Run Lifecycle
- User creates or updates a flow in Mission Control.
- Frontend calls Gateway (
/api/v1/flows,/api/v1/runs). - Gateway forwards to Orchestrator and streams events back.
- Orchestrator schedules nodes according to DAG dependencies.
- Node execution emits events; run status is persisted in runstore.
- Frontend updates timeline/console with live run events.
Orchestrator Internal Packages
internal/api- HTTP handlers and routinginternal/scheduler- DAG scheduling/executioninternal/registry- agent registration and lookupinternal/flowstore- flow persistenceinternal/runstore- run state persistenceinternal/k8s- Kubernetes job driver
Execution Modes
memory- in-memory state for local devredis- Redis-backed run state for durable dev/prodk8s- Kubernetes Jobs for agent execution in cluster
Key Design Goals
- Deterministic DAG execution for repeatable runs
- Observable run lifecycle (events + metrics)
- Pluggable execution backends and storage
- Agent-language agnostic integration via NDJSON