Skip to content

C4 Model – Level 2: Container Diagram

Document ID: ARCH-003 Version: 1.0.1 Status: Draft — Day-1 target-state container diagram, unrevised since project inception; not reconciled with ADR-0010 (Path A, 2026-07-06). Corrected 2026-07-07 — none of §3’s independently-deployable/-scalable containers exist as separate processes. The real topology is one Rust binary (wovyr-server) containing Agent Runtime, Workflow Engine, Memory Engine, LLM Gateway, Tool Runtime, and Plugin Engine as in-process crates — none is horizontally scaled independently (§8’s per-container scaling strategy is aspirational). Specific corrections to §4/§5/§6/§11: API Gateway interface is REST + SSE only, no gRPC/WebSocket. Dashboard Backend is NestJS in name only — it was never built; the Angular SPA talks directly to wovyr-server (dashboard overview). Event Bus is not NATS JetStream — no message broker exists; wovyr-events is a custom in-process event/webhook system (current-status note on ADR-0005). PostgreSQL, Redis, and Qdrant are real but optional, feature-gated backends, not always-on shared infrastructure — the default is file-based storage under ~/.wovyr. Object Storage does not exist at all — plugin packages are local content-addressed files. mTLS between containers is moot since there are no separate containers; the real security floor is wovyr-server’s own JWT/API-key auth (RM-GA-P1). Gaps with no implementation and no tracked future work (NATS, gRPC, object storage) are now tracked — see prd.md §25. Owner: Architecture Team Last Updated: 2026-07-07


This document describes the major deployable containers that make up the Wovyr AI Platform.

A container in the C4 Model represents a deployable application or data store—not necessarily a Docker container.

This document defines:

  • Deployable services
  • Primary responsibilities
  • Technology stack
  • Communication protocols
  • Deployment strategy
  • Container boundaries

The container architecture aims to:

  • Support modular development
  • Enable independent scaling
  • Preserve domain boundaries
  • Simplify deployment
  • Support cloud-native operations
  • Minimize coupling

Users
Browser / CLI / SDK / External APIs
+----------------+
| API Gateway |
+----------------+
┌─────────────────────┼─────────────────────┐
▼ ▼ ▼
+-------------+ +----------------+ +----------------+
|Agent Runtime| |Workflow Engine | |Platform Services|
+-------------+ +----------------+ +----------------+
│ │ │
├────────────┬───────┴─────────────┬──────┤
▼ ▼ ▼ ▼
+-----------+ +-------------+ +----------------+ +-------------+
|LLM Gateway| |Memory Engine| |Tool Runtime | |Plugin Engine|
+-----------+ +-------------+ +----------------+ +-------------+
│ │ │ │
└──────────────┴─────────────────┴───────────────┘
Event Bus / Scheduler
PostgreSQL • Redis • Qdrant • Object Storage

  • Request routing
  • Authentication
  • Authorization
  • Rate limiting
  • API versioning
  • Request validation
  • REST
  • gRPC
  • WebSocket
  • Rust (Axum)
  • Tower middleware

  • Goal execution
  • Planning
  • Reasoning
  • Reflection
  • Context management
  • Multi-agent coordination
  • Workflow Engine
  • Memory Engine
  • Tool Runtime
  • LLM Gateway

  • Durable execution
  • Scheduling
  • DAG processing
  • State machine
  • Retry
  • Compensation
  • Checkpointing
  • Scheduler
  • Event Bus
  • PostgreSQL

  • Context retrieval
  • Semantic search
  • Episodic memory
  • Embedding management
  • Knowledge graph integration
  • PostgreSQL
  • Qdrant
  • Redis

  • Provider abstraction
  • Routing
  • Failover
  • Streaming
  • Token accounting
  • Cost tracking
  • OpenAI
  • Anthropic
  • Gemini
  • Ollama
  • Azure OpenAI
  • Local models

  • Tool discovery
  • Registration
  • Execution
  • Permission enforcement
  • Sandboxing
  • Resource limits

  • Plugin lifecycle
  • Dependency resolution
  • Version compatibility
  • Marketplace integration
  • Capability registration

  • Users
  • Organizations
  • Projects
  • Authentication
  • Authorization
  • Configuration
  • Audit logging
  • Licensing (optional)

  • UI APIs
  • Monitoring APIs
  • Workflow management
  • Administration

  • Local workflow execution
  • Project scaffolding
  • Deployment commands
  • Diagnostics

Stores:

  • Users
  • Projects
  • Workflow definitions
  • Execution metadata
  • Configuration

Stores:

  • Session cache
  • Distributed locks
  • Temporary execution state
  • Rate limiting counters

Stores:

  • Vector embeddings
  • Semantic memory
  • Retrieval indexes

Stores:

  • Workflow artifacts
  • Plugin packages
  • Logs
  • Attachments
  • Snapshots

Responsibilities:

  • Asynchronous communication
  • Workflow events
  • Notifications
  • Scheduling events

Preferred implementation:

  • NATS JetStream

SourceDestinationProtocol
ClientAPI GatewayHTTPS
API GatewayRuntimeInternal API
RuntimeWorkflow EngineRust Interface / gRPC
RuntimeMemory EngineInternal API
RuntimeLLM GatewayInternal API
RuntimeTool RuntimeInternal API
ServicesEvent BusNATS
ServicesDatabaseSQL
ServicesRedisRESP
ServicesQdrantHTTP/gRPC

Single executable composed of all Rust crates.

Advantages:

  • Fast startup
  • Simple debugging
  • Minimal infrastructure

Modular monolith with external databases.


Independent containers:

  • API Gateway
  • Runtime
  • Workflow Engine
  • Memory Engine
  • LLM Gateway
  • Dashboard Backend

Scaled independently.


Each container deployed independently with:

  • Horizontal Pod Autoscaler
  • Health probes
  • Rolling updates
  • Service discovery

ContainerScaling Method
API GatewayHorizontal
Agent RuntimeHorizontal
Workflow EngineHorizontal
Memory EngineRead-heavy scaling
LLM GatewayHorizontal
DashboardHorizontal
Event BusClustered
PostgreSQLPrimary/Replica
RedisCluster
QdrantDistributed

All inter-container communication should use:

  • Mutual TLS (mTLS)
  • Service authentication
  • Authorization policies
  • Structured audit logging

Tool Runtime and Plugin Engine should execute untrusted code within isolated sandboxes.


Every container exposes:

  • /health
  • /ready
  • /metrics

All services emit:

  • Structured logs
  • OpenTelemetry traces
  • Prometheus metrics

ContainerPrimary Technology
API GatewayRust + Axum
Agent RuntimeRust
Workflow EngineRust
Memory EngineRust
LLM GatewayRust
Tool RuntimeRust
Plugin EngineRust
Dashboard BackendNestJS
Dashboard UIAngular
CLIRust
PostgreSQLPostgreSQL
RedisRedis
QdrantQdrant
Event BusNATS JetStream

The architecture allows additional containers without disrupting existing deployments:

  • MCP Gateway
  • Model Registry
  • Workflow Marketplace
  • Prompt Registry
  • Policy Engine
  • Billing Service
  • AI Evaluation Service
  • Distributed Worker Pool

  • System Overview
  • C4 System Context
  • C4 Component Diagram
  • Domain-Driven Design
  • Clean Architecture
  • Deployment Architecture
  • ADRs

VersionDateDescription
1.0.12026-07-07Added a header note correcting the container/technology mapping against reality: no separate containers, no NestJS BFF, no NATS event bus, no gRPC, no object storage; Postgres/Redis/Qdrant are optional feature-gated backends. Found during a project-wide doc review; no content changed
1.0.02026-06-26Initial C4 Level 2 – Container Diagram