Skip to content

C4 Model – Level 3: Component Diagram

Document ID: ARCH-004 Version: 1.0.1 Status: Draft — Day-1 target-state component diagram, unrevised since project inception. Corrected 2026-07-07: the components below are real (as in-process Rust modules within one wovyr-server binary — see the README’s architecture section and each crate’s own doc comments for the kept-current, per-crate description), but the “Cross-container” communication row using gRPC does not exist (no gRPC anywhere in the codebase) and “Event notification” is not NATS JetStream (no message broker exists — wovyr-events is a custom in-process system; see ADR-0005’s current-status note). This is consistent with ADR-0010’s Path A single-node decision. Owner: Architecture Team Last Updated: 2026-07-07


This document describes the internal component architecture of the Wovyr AI Platform.

Where the Container Diagram defines deployable applications, this document defines the major software components inside those containers.

These components map directly to Rust workspace crates and domain boundaries.


This document defines:

  • Internal components
  • Component responsibilities
  • Dependency rules
  • Communication patterns
  • Public interfaces
  • Crate mappings
  • Extension points

Implementation details are intentionally deferred to crate-specific documentation.


Components should satisfy the following principles:

  • Single Responsibility
  • High Cohesion
  • Low Coupling
  • Interface Segregation
  • Dependency Inversion
  • Replaceable Implementations
  • Testability
  • Stable Public Contracts

Wovyr AI Platform
┌──────────────────────────┼──────────────────────────┐
│ │ │
Platform Runtime Infrastructure
│ │ │
├──────────────┬───────────┴──────────────┬───────────┤
▼ ▼ ▼
Identity Workflow Engine Agent Runtime
Projects Scheduler Planner
Users State Machine Executor
Config DAG Engine Reflection
Audit Retry Engine Context Manager
Checkpoint Goal Manager
├─────────────────────────────────────────────────────┐
▼ ▼
Memory Engine LLM Gateway
Vector Search Provider Registry
Episodic Memory Router
Knowledge Graph Streaming
Embeddings Token Manager
│ │
└──────────────────────────┬──────────────────────────┘
Tool Runtime
Plugin Framework
Event Bus

Responsibilities:

  • Authentication
  • Authorization
  • Token validation
  • Session management
  • RBAC

Public Interfaces:

  • Auth Service
  • User Context
  • Permission Resolver

Responsibilities:

  • Organizations
  • Teams
  • Membership
  • Tenant isolation

Responsibilities:

  • Project lifecycle
  • Environment configuration
  • Secrets references
  • Project metadata

Responsibilities:

  • Global settings
  • Environment settings
  • Feature flags
  • Runtime configuration

Responsibilities:

  • Audit events
  • Compliance records
  • Security logs

Responsibilities:

  • Parse workflow DSL
  • Validate definitions
  • Version workflows
  • Compile execution plans

Responsibilities:

  • Timers
  • Delayed execution
  • Cron schedules
  • Queue management

Responsibilities:

  • Execute workflow graph
  • Parallel branches
  • Conditional execution
  • Synchronization

Responsibilities:

  • Lifecycle transitions
  • Durable state
  • Recovery
  • Replay

Responsibilities:

  • Save progress
  • Restore execution
  • Snapshot generation

Responsibilities:

  • Retry policies
  • Backoff strategies
  • Failure handling

Responsibilities:

  • Rollback execution
  • Saga orchestration
  • Recovery actions

Creates execution plans from user goals.


Coordinates interaction with LLM providers and applies reasoning strategies.


Executes workflow steps and tool calls.


Evaluates previous outputs and determines whether additional reasoning or correction is required.


Tracks objectives, progress, priorities, and completion status.


Aggregates runtime state, workflow context, memory retrievals, and tool outputs.


Maintains execution-specific context.


Stores persistent knowledge and historical interactions.


Indexes and retrieves embeddings.


Maintains structured relationships between entities.


Generates, stores, and updates embeddings.


Ranks, filters, and returns relevant context.


Maintains available model providers and capabilities.


Selects the appropriate provider based on policy.


Supports incremental response delivery.


Tracks token usage, quotas, and estimated cost.


Redirects requests when providers are unavailable or exceed policy thresholds.


Registers available tools and their metadata.


Evaluates tool execution permissions.


Executes tools within isolated environments.


Coordinates tool execution, validation, and result handling.


Discovers and indexes installed plugins.


Handles installation, activation, upgrade, and removal.


Validates version compatibility and dependency constraints.


Publishes plugin-provided services to the platform.


These cross-cutting components are available across the platform:

  • Event Bus
  • Metrics
  • Logging
  • Distributed Tracing
  • Configuration
  • Secrets
  • Cache
  • Serialization
  • Error Handling
  • Health Monitoring

The following dependency rules are mandatory:

  1. Components depend only on published interfaces.
  2. Domain components do not access infrastructure directly.
  3. Infrastructure implementations are replaceable.
  4. Components communicate through explicit contracts.
  5. Circular dependencies are prohibited.

Preferred communication mechanisms:

InteractionPattern
Same processRust trait interfaces
Cross-containergRPC
Event notificationNATS JetStream
Client accessREST / WebSocket
Long-running workAsynchronous messaging

Each major component corresponds to one or more Rust crates.

Illustrative mapping:

ComponentWorkspace Crate
Workflow Engineengine-workflow
Agent Runtimeengine-runtime
Memory Engineengine-memory
LLM Gatewayengine-llm
Tool Runtimeengine-tools
Plugin Frameworkengine-plugin
Identityplatform-identity
Projectsplatform-projects
Configurationplatform-config
Auditplatform-audit
Common abstractionsengine-core

Additional crate organization is defined in the Rust workspace architecture.


Supported extension mechanisms include:

  • Custom LLM providers
  • Workflow activities
  • Memory providers
  • Storage backends
  • Authentication providers
  • Scheduling strategies
  • Plugins
  • Dashboard modules

Extension points must be documented with stable public interfaces.


Components should:

  • Remain independently testable.
  • Avoid implementation leakage.
  • Expose minimal public APIs.
  • Maintain backward compatibility.
  • Minimize compile-time dependencies.

  • System Overview
  • C4 Context
  • C4 Container
  • Domain-Driven Design
  • Clean Architecture
  • Rust Workspace Design
  • Architecture Decision Records (ADRs)

VersionDateDescription
1.0.12026-07-07Added a header note: no gRPC or NATS exist anywhere in the codebase, contradicting the communication-pattern table. Found during a project-wide doc review; no content changed
1.0.02026-06-26Initial C4 Level 3 – Component Diagram