Skip to content

Data Model: Amelia Agentic Orchestrator

This document describes the core data structures used throughout the Amelia orchestrator.

Type Aliases

TypeDefinitionDescription
DriverType"claude" | "codex" | "api"LLM driver type.
TrackerType"jira" | "github" | "noop"Issue tracker type.
AgenticStatus"running" | "awaiting_approval" | "completed" | "failed" | "cancelled"Agentic execution status.
Severity"critical" | "major" | "minor" | "none"Review issue severity.

Configuration Entities

RetryConfig

Retry configuration for transient failures.

FieldTypeDefaultDescription
max_retriesint3Maximum number of retry attempts (range: 0-10).
base_delayfloat1.0Base delay in seconds for exponential backoff (range: 0.1-30.0).
max_delayfloat60.0Maximum delay cap in seconds (range: 1.0-300.0).

Location: amelia/core/types.py

SandboxMode

Sandbox execution mode (enum).

ValueString ValueDescription
NONE"none"Direct execution on host (no sandbox).
CONTAINER"container"Docker container sandbox.
DAYTONA"daytona"Daytona cloud sandbox.

Location: amelia/core/types.py

DaytonaResources

Resource configuration for Daytona sandbox instances. Frozen (immutable).

FieldTypeDefaultDescription
cpuint2Number of CPU cores (gt: 0).
memoryint4Memory in GB (gt: 0).
diskint10Disk space in GB (gt: 0).

Location: amelia/core/types.py

SandboxConfig

Sandbox execution configuration for a profile. Frozen (immutable).

FieldTypeDefaultDescription
modeSandboxMode"none"Sandbox mode (none, container, or daytona).
imagestr"amelia-sandbox:latest"Docker image for container sandbox.
network_allowlist_enabledboolFalseWhether to restrict outbound network.
network_allowed_hoststuple[str, ...]DEFAULT_NETWORK_ALLOWED_HOSTSHosts allowed when network allowlist is enabled.
repo_urlstr | NoneNoneGit remote URL to clone into the sandbox.
daytona_api_urlstr"https://app.daytona.io/api"Daytona API endpoint URL.
daytona_targetstr"us"Daytona target region.
daytona_resourcesDaytonaResources | NoneNoneOptional CPU/memory/disk resource configuration.
daytona_imagestr"python:3.12-slim"Docker image for Daytona sandbox.
daytona_snapshotstr | NoneNoneOptional Daytona snapshot ID for faster startup.
daytona_timeoutfloat120.0Timeout in seconds for Daytona operations (gt: 0).

Validation: When mode='daytona', repo_url is required and network_allowlist_enabled must be False.

Location: amelia/core/types.py

AgentConfig

Per-agent driver and model configuration. Frozen (immutable).

FieldTypeDefaultDescription
driverDriverTypeLLM driver type.
modelstrModel identifier.
optionsdict[str, Any]{}Driver-specific options.
sandboxSandboxConfigSandboxConfig()Sandbox configuration (overridden by profile-level sandbox).
profile_namestr"default"Profile name (injected by Profile.get_agent_config()).

Location: amelia/core/types.py

Profile

Defines the runtime environment and constraints. Frozen (immutable).

FieldTypeDefaultDescription
namestrProfile name (e.g., "work", "personal").
trackerTrackerType"noop"Issue tracker type.
repo_rootstrRoot directory of the repository this profile targets.
plan_output_dirstr"docs/plans"Directory for saving implementation plans.
plan_path_patternstr"docs/plans/{date}-{issue_key}.md"Path pattern for plan files with {date} and {issue_key} placeholders.
retryRetryConfigRetryConfig()Retry configuration for transient failures.
agentsdict[str, AgentConfig]{}Per-agent driver and model configuration.
sandboxSandboxConfigSandboxConfig()Sandbox execution configuration.

Location: amelia/core/types.py

Settings

Root configuration object.

FieldTypeDescription
active_profilestrName of the currently active profile.
profilesdict[str, Profile]Dictionary mapping profile names to Profile objects.

Location: amelia/core/types.py

Domain Entities

Issue

Issue or ticket to be worked on.

FieldTypeDefaultDescription
idstrUnique issue identifier (e.g., "JIRA-123", "GH-456").
titlestrIssue title or summary.
descriptionstrDetailed issue description.
statusstr"open"Current issue status.

Location: amelia/core/types.py

Design

Design document for implementation. Can be user-provided via import or generated by a Brainstorming pipeline.

FieldTypeDefaultDescription
contentstrRaw design content (markdown).
sourcestr"import"Origin of the design ("import", "file", etc.).

Location: amelia/core/types.py

PlanValidationResult

Result from plan structure validation. Mirrors ReviewResult but for plan quality checks. Frozen (immutable).

FieldTypeDefaultDescription
validboolWhether the plan passed validation.
issueslist[str]List of validation issues found.
severitySeveritySeverity level of validation issues.

Location: amelia/core/types.py

OracleConsultation

Record of an Oracle consultation for persistence and analytics.

FieldTypeDefaultDescription
timestampdatetimeWhen the consultation occurred.
problemstrThe problem presented to the Oracle.
advicestr | NoneNoneAdvice returned by the Oracle.
modelstrLLM model used.
session_idUUIDPer-consultation session identifier.
workflow_idUUID | NoneNoneAssociated workflow (if any).
tokensdict[str, int]{}Token usage breakdown.
cost_usdfloat | NoneNoneCost in USD.
files_consultedlist[str][]Files the Oracle examined.
outcome"success" | "error""success"Consultation outcome.
error_messagestr | NoneNoneError message if outcome is "error".

Location: amelia/core/types.py

Agentic Execution Entities

ToolCall

A tool call made by the LLM during agentic execution. Frozen (immutable).

FieldTypeDefaultDescription
idstrUnique identifier for this call.
tool_namestrName of the tool being called.
tool_inputdict[str, Any]Input parameters for the tool.
timestampstr | NoneNoneWhen the call was made (ISO format).

Location: amelia/core/agentic_state.py

ToolResult

Result from a tool execution. Frozen (immutable).

FieldTypeDefaultDescription
call_idstrID of the ToolCall this result is for.
tool_namestrName of the tool that was called.
outputstrOutput from the tool (stdout, file content, etc.).
successboolWhether the tool executed successfully.
errorstr | NoneNoneError message if success is False.
duration_msint | NoneNoneExecution time in milliseconds.

Location: amelia/core/agentic_state.py

AgenticState

State for standalone agentic workflow execution. Frozen (immutable).

FieldTypeDefaultDescription
workflow_idUUIDUnique workflow identifier.
issue_keystrIssue being worked on.
goalstrHigh-level goal or task description.
system_promptstr | NoneNoneSystem prompt for the agent.
tool_callstuple[ToolCall, ...]()History of tool calls made.
tool_resultstuple[ToolResult, ...]()History of tool results received.
final_responsestr | NoneNoneFinal response from the agent when complete.
statusAgenticStatus"running"Current execution status.
errorstr | NoneNoneError message if status is 'failed'.
session_idUUID | NoneNoneSession ID for driver continuity.

Location: amelia/core/agentic_state.py

ReviewResult

Result from a code review. Frozen (immutable).

FieldTypeDescription
reviewer_personastrThe persona or role of the reviewer (e.g., "Security", "Performance").
approvedboolWhether the review approved the changes.
commentslist[str]List of review comments or feedback.
severitySeveritySeverity level of issues found.

Location: amelia/core/types.py

Driver Entities

DriverUsage

Token usage data returned by drivers. All fields optional — drivers populate what they can.

FieldTypeDefaultDescription
input_tokensint | NoneNoneTotal input tokens consumed.
output_tokensint | NoneNoneOutput tokens generated.
cache_read_tokensint | NoneNoneTokens served from cache.
cache_creation_tokensint | NoneNoneTokens written to cache.
cost_usdfloat | NoneNoneNet cost in USD.
duration_msint | NoneNoneExecution time in milliseconds.
num_turnsint | NoneNoneNumber of agentic turns.
modelstr | NoneNoneModel identifier used.

Location: amelia/drivers/base.py

AgenticMessageType

Types of messages yielded during agentic execution (enum).

ValueString ValueDescription
THINKING"thinking"Agent is analyzing and planning.
TOOL_CALL"tool_call"Agent is invoking a tool.
TOOL_RESULT"tool_result"Result returned from tool execution.
RESULT"result"Final output when agent completes.
USAGE"usage"Token usage summary message.

Location: amelia/drivers/base.py

AgenticMessage

Unified message type for agentic execution across all drivers. Provides a common abstraction over driver-specific message types (e.g., claude_agent_sdk.types.Message, langchain_core.messages.BaseMessage).

FieldTypeDefaultDescription
typeAgenticMessageTypeType of agentic message.
contentstr | NoneNoneText content for thinking or result messages.
tool_namestr | NoneNoneName of the tool being called or returning.
tool_inputdict[str, Any] | NoneNoneInput parameters for tool calls.
tool_outputstr | NoneNoneOutput from tool execution.
tool_call_idstr | NoneNoneUnique identifier for the tool call.
session_idstr | NoneNoneSession identifier for conversation continuity.
is_errorboolFalseWhether this message represents an error.
modelstr | NoneNoneLLM model name.
usageDriverUsage | NoneNoneToken usage data (for USAGE messages).

Location: amelia/drivers/base.py

Evaluator Entities

Disposition

Disposition for evaluated feedback items (enum).

ValueString ValueDescription
IMPLEMENT"implement"Correct and in scope — will fix.
REJECT"reject"Technically incorrect — won't fix.
DEFER"defer"Out of scope — backlog.
CLARIFY"clarify"Ambiguous — needs clarification.

Location: amelia/agents/schemas/evaluator.py

EvaluatedItem

Single evaluated feedback item from code review. Frozen (immutable).

FieldTypeDescription
numberintOriginal issue number from review.
titlestrBrief title describing the issue.
file_pathstrPath to the file containing the issue.
lineintLine number where the issue occurs.
dispositionDispositionThe evaluation decision for this item.
reasonstrEvidence supporting the disposition decision.
original_issuestrThe issue description from review.
suggested_fixstrThe suggested fix from review.

Location: amelia/agents/schemas/evaluator.py

EvaluationResult

Result of evaluating review feedback, partitioned by disposition. Frozen (immutable).

FieldTypeDefaultDescription
items_to_implementlist[EvaluatedItem][]Items marked for implementation.
items_rejectedlist[EvaluatedItem][]Items rejected as technically incorrect.
items_deferredlist[EvaluatedItem][]Items deferred as out of scope.
items_needing_clarificationlist[EvaluatedItem][]Items requiring clarification.
summarystrBrief summary of evaluation decisions.

Location: amelia/agents/schemas/evaluator.py

Pipeline State

BasePipelineState

Common state for all pipelines. Frozen (immutable) to support the stateless reducer pattern.

FieldTypeDefaultDescription
workflow_idUUIDUnique identifier for this workflow instance.
pipeline_typestrType of pipeline (e.g., "implementation").
profile_idstrID of the active profile.
created_atdatetimeWhen the workflow was created.
statusLiteral["pending", "running", "paused", "completed", "failed"]Current workflow status.
historyAnnotated[list[HistoryEntry], operator.add][]Append-only list of agent actions (reducer).
pending_user_inputboolFalseWhether waiting for user input.
user_messagestr | NoneNoneMessage from user (e.g., approval feedback).
driver_session_idstr | NoneNoneSession ID for driver continuity.
final_responsestr | NoneNoneFinal response when workflow completes.
errorstr | NoneNoneError message if status is "failed".
oracle_consultationsAnnotated[list[OracleConsultation], operator.add][]Append-only Oracle consultation records (reducer).

Location: amelia/pipelines/base.py

ImplementationState

State for the implementation pipeline. Extends BasePipelineState with implementation-specific fields. Frozen (immutable).

FieldTypeDefaultDescription
pipeline_typeLiteral["implementation"]"implementation"Pipeline type discriminator.
tool_callsAnnotated[list[ToolCall], operator.add][]History of tool calls (reducer).
tool_resultsAnnotated[list[ToolResult], operator.add][]History of tool results (reducer).
agentic_statusAgenticStatus"running"Current agentic execution status.
issueIssue | NoneNoneThe issue being worked on.
designDesign | NoneNoneOptional design context from brainstorming.
goalstr | NoneNoneHigh-level goal for agentic execution.
base_commitstr | NoneNoneGit commit SHA captured at workflow start for accurate diffing.
plan_markdownstr | NoneNoneMarkdown plan content generated by the Architect.
raw_architect_outputstr | NoneNoneRaw output from Architect before plan extraction.
architect_errorstr | NoneNoneError from Architect agent (if any).
plan_pathPath | NoneNonePath where the markdown plan was saved.
key_fileslist[str][]Key files identified during planning.
human_approvedbool | NoneNoneWhether human approval was granted for the plan.
human_feedbackstr | NoneNoneOptional feedback from human during approval.
last_reviewReviewResult | NoneNoneMost recent review result.
code_changes_for_reviewstr | NoneNoneStaged code changes for review.
review_iterationint0Current iteration in review-fix loop.
plan_validation_resultPlanValidationResult | NoneNoneResult from plan structure validation.
plan_revision_countint0Number of plan revision iterations.
total_tasksint1Number of tasks parsed from plan.
current_task_indexint00-indexed task being executed, increments after each task passes review.
task_review_iterationint0Review iteration counter that resets to 0 when moving to next task.
evaluation_resultEvaluationResult | NoneNoneOutput from the evaluator agent.
approved_itemslist[int][]Item numbers approved for fixing by human or auto-approve.
review_passint0Current review iteration in auto mode.
max_review_passesint3Maximum iterations allowed in auto mode.
external_planboolFalseTrue if plan was imported externally (bypasses Architect).

Location: amelia/pipelines/implementation/state.py

Streaming Entities

StreamEventType

Unified streaming event types from agent execution (enum). This is the common event type across all drivers, enabling consistent UI rendering regardless of the underlying LLM driver.

ValueString ValueDescription
CLAUDE_THINKING"claude_thinking"Agent is analyzing the situation and planning.
CLAUDE_TOOL_CALL"claude_tool_call"Agent is invoking a tool.
CLAUDE_TOOL_RESULT"claude_tool_result"Result returned from tool execution.
AGENT_OUTPUT"agent_output"Final output when agent completes execution.

Location: amelia/core/types.py

python
class StreamEventType(StrEnum):
    CLAUDE_THINKING = "claude_thinking"
    CLAUDE_TOOL_CALL = "claude_tool_call"
    CLAUDE_TOOL_RESULT = "claude_tool_result"
    AGENT_OUTPUT = "agent_output"

StreamEvent

Unified real-time streaming event from agent execution. This is the common message format across all drivers (CLI and API), enabling consistent UI rendering and logging regardless of the underlying LLM driver.

Drivers convert their native message types to StreamEvent using conversion functions:

  • Claude CLI driver: convert_to_stream_event() in amelia/drivers/cli/claude.py
  • Codex CLI driver: Conversion in amelia/drivers/cli/codex.py
  • API driver: Similar conversion in the API driver implementation
FieldTypeDefaultDescription
idstruuid4()Unique identifier for this event.
typeStreamEventTypeType of streaming event (see StreamEventType enum).
contentstr | NoneNoneEvent content (text, result output, etc.).
timestampdatetimeWhen the event occurred.
agentstrAgent name (architect, developer, reviewer).
workflow_idstrLinks this event to its parent workflow.
tool_namestr | NoneNoneName of tool being called (for TOOL_CALL/TOOL_RESULT events).
tool_inputdict[str, Any] | NoneNoneInput parameters for tool call (for TOOL_CALL events).

Location: amelia/core/types.py

python
class StreamEvent(BaseModel, frozen=True):
    id: str = Field(default_factory=lambda: str(uuid4()))
    type: StreamEventType
    content: str | None = None
    timestamp: datetime
    agent: str
    workflow_id: str
    tool_name: str | None = None
    tool_input: dict[str, Any] | None = None

Server Models

ServerConfig

Server configuration with environment variable support.

FieldTypeDefaultDescription
hoststr"127.0.0.1"Host to bind the server to.
portint8420Port to bind the server to (range: 1-65535).
database_pathPath~/.amelia/amelia.dbPath to SQLite database file.
log_retention_daysint30Days to retain event logs (min: 1).
log_retention_max_eventsint100000Maximum events per workflow (min: 1000).
websocket_idle_timeout_secondsfloat300.0WebSocket idle timeout in seconds (5 min default).
workflow_start_timeout_secondsfloat60.0Max time to start a workflow in seconds.
max_concurrentint5Maximum number of concurrent workflows (min: 1).

Location: amelia/server/config.py

EventDomain

Domain of event origin (enum).

ValueString ValueDescription
WORKFLOW"workflow"Standard workflow events.
BRAINSTORM"brainstorm"Brainstorming session events.
ORACLE"oracle"Oracle consultation events.
KNOWLEDGE"knowledge"Knowledge ingestion events.

Location: amelia/server/models/events.py

EventLevel

Event severity level for filtering and retention (enum).

ValueString ValueDescription
INFO"info"Informational events.
WARNING"warning"Warning events.
DEBUG"debug"Debug/trace-level events.
ERROR"error"Error events.

Location: amelia/server/models/events.py

EventType

Exhaustive list of workflow event types (enum).

ValueCategoryDescription
WORKFLOW_CREATEDLifecycleWorkflow created and queued.
WORKFLOW_STARTEDLifecycleWorkflow execution started.
WORKFLOW_COMPLETEDLifecycleWorkflow execution completed successfully.
WORKFLOW_FAILEDLifecycleWorkflow execution failed.
WORKFLOW_CANCELLEDLifecycleWorkflow execution cancelled.
STAGE_STARTEDStagesWorkflow stage started.
STAGE_COMPLETEDStagesWorkflow stage completed.
APPROVAL_REQUIREDApprovalHuman approval required for plan.
APPROVAL_GRANTEDApprovalHuman approval granted.
APPROVAL_REJECTEDApprovalHuman approval rejected.
FILE_CREATEDArtifactsFile created during execution.
FILE_MODIFIEDArtifactsFile modified during execution.
FILE_DELETEDArtifactsFile deleted during execution.
REVIEW_REQUESTEDReviewCode review requested.
REVIEW_COMPLETEDReviewCode review completed.
REVISION_REQUESTEDReviewRevision requested after review.
AGENT_MESSAGEAgentAgent message (replaces in-state message accumulation).
TASK_STARTEDTasksTask execution started.
TASK_COMPLETEDTasksTask execution completed.
TASK_FAILEDTasksTask execution failed.
SYSTEM_ERRORSystemSystem error occurred.
SYSTEM_WARNINGSystemSystem warning issued.
STREAMStreamingEphemeral stream event (not persisted).
CLAUDE_THINKINGStreamingAgent is analyzing and planning (trace).
CLAUDE_TOOL_CALLStreamingAgent is invoking a tool (trace).
CLAUDE_TOOL_RESULTStreamingResult returned from tool execution (trace).
AGENT_OUTPUTStreamingFinal output when agent completes (trace).
BRAINSTORM_SESSION_CREATEDBrainstormBrainstorming session created.
BRAINSTORM_REASONINGBrainstormBrainstorming agent reasoning/thinking.
BRAINSTORM_TOOL_CALLBrainstormBrainstorming agent invoking a tool.
BRAINSTORM_TOOL_RESULTBrainstormBrainstorming tool execution result.
BRAINSTORM_TEXTBrainstormBrainstorming text output.
BRAINSTORM_ASK_USERBrainstormBrainstorming agent asking user a question.
BRAINSTORM_MESSAGE_COMPLETEBrainstormBrainstorming message completed.
BRAINSTORM_ARTIFACT_CREATEDBrainstormBrainstorming artifact (design doc) created.
BRAINSTORM_SESSION_COMPLETEDBrainstormBrainstorming session completed.
BRAINSTORM_MESSAGE_FAILEDBrainstormBrainstorming message failed.
ORACLE_CONSULTATION_STARTEDOracleOracle consultation started.
ORACLE_CONSULTATION_THINKINGOracleOracle is reasoning/thinking.
ORACLE_TOOL_CALLOracleOracle invoking a tool.
ORACLE_TOOL_RESULTOracleOracle tool execution result.
ORACLE_CONSULTATION_COMPLETEDOracleOracle consultation completed.
ORACLE_CONSULTATION_FAILEDOracleOracle consultation failed.
DOCUMENT_INGESTION_STARTEDKnowledgeDocument ingestion started.
DOCUMENT_INGESTION_PROGRESSKnowledgeDocument ingestion progress update.
DOCUMENT_INGESTION_COMPLETEDKnowledgeDocument ingestion completed.
DOCUMENT_INGESTION_FAILEDKnowledgeDocument ingestion failed.
PLAN_VALIDATEDPlanPlan structure validation passed.
PLAN_VALIDATION_FAILEDPlanPlan structure validation failed.

Location: amelia/server/models/events.py

WorkflowEvent

Event for activity log and real-time updates. Events are immutable and append-only.

FieldTypeDefaultDescription
idUUIDUnique event identifier.
domainEventDomain"workflow"Event domain (workflow, brainstorm, oracle, knowledge).
workflow_idUUIDWorkflow this event belongs to.
sequenceintMonotonic sequence number per workflow (0 for trace-only events, ge: 0).
timestampdatetimeWhen event occurred.
agentstrEvent source agent (architect, developer, reviewer, system).
event_typeEventTypeTyped event category.
levelEventLevel | NoneNoneEvent severity level (auto-derived from event_type if not set).
messagestrHuman-readable summary.
datadict[str, Any] | NoneNoneOptional structured payload (file paths, error details, etc.).
session_idUUID | NoneNonePer-consultation session ID (independent from workflow_id).
correlation_idUUID | NoneNoneLinks related events for tracing (e.g., approval request -> granted).
tool_namestr | NoneNoneTool name for trace events.
tool_inputdict[str, Any] | NoneNoneTool input parameters for trace events.
is_errorboolFalseWhether trace event represents an error.
modelstr | NoneNoneLLM model name for trace events.
trace_idUUID | NoneNoneDistributed trace ID (OTel-compatible, flows through all events in a workflow).
parent_idUUID | NoneNoneParent event ID for causal chain (e.g., tool_call -> tool_result).

Location: amelia/server/models/events.py

TokenUsage

Token consumption tracking per agent with cache-aware cost calculation.

FieldTypeDefaultDescription
idstruuid4()Unique identifier.
workflow_idstrWorkflow this usage belongs to.
agentstrAgent that consumed tokens.
modelstr"claude-sonnet-4-20250514"Model used for cost calculation.
input_tokensintTotal input tokens (includes cache reads, min: 0).
output_tokensintOutput tokens generated (min: 0).
cache_read_tokensint0Subset of input tokens served from cache (discounted, min: 0).
cache_creation_tokensint0Tokens written to cache (premium rate, min: 0).
cost_usdfloat | NoneNoneNet cost in USD after cache adjustments.
timestampdatetimeWhen tokens were consumed.

Notes:

  • input_tokens includes cache_read_tokens (not additive)
  • Cost formula: (base_input × input_rate) + (cache_read × cache_read_rate) + (cache_write × cache_write_rate) + (output × output_rate)
  • Where base_input = input_tokens - cache_read_tokens

Location: amelia/server/models/tokens.py

Entity Relationships

Settings
└── profiles: Dict[str, Profile]
    ├── retry: RetryConfig
    ├── sandbox: SandboxConfig
    │   └── daytona_resources: DaytonaResources (optional)
    └── agents: Dict[str, AgentConfig]
        └── sandbox: SandboxConfig (overridden by profile-level)

ImplementationState (extends BasePipelineState)
├── workflow_id: UUID
├── pipeline_type: "implementation"
├── profile_id: str (references Profile)
├── issue: Issue
├── design: Design (optional)
├── goal: str (from Architect)
├── plan_markdown: str (from Architect)
├── plan_path: Path
├── plan_validation_result: PlanValidationResult (optional)
├── plan_revision_count: int
├── tool_calls: List[ToolCall] (with reducer)
├── tool_results: List[ToolResult] (with reducer)
├── last_review: ReviewResult
├── evaluation_result: EvaluationResult (optional)
│   ├── items_to_implement: List[EvaluatedItem]
│   ├── items_rejected: List[EvaluatedItem]
│   ├── items_deferred: List[EvaluatedItem]
│   └── items_needing_clarification: List[EvaluatedItem]
├── approved_items: List[int]
├── history: List[HistoryEntry] (with reducer)
├── oracle_consultations: List[OracleConsultation] (with reducer)
├── total_tasks: int
├── current_task_index: int
├── task_review_iteration: int
├── review_pass: int
├── max_review_passes: int
└── external_plan: bool

AgenticState (standalone agentic execution)
├── workflow_id: UUID
├── issue_key: str
├── goal: str
├── tool_calls: Tuple[ToolCall, ...]
└── tool_results: Tuple[ToolResult, ...]

AgenticMessage (driver → pipeline streaming)
├── type: AgenticMessageType
├── usage: DriverUsage (optional)
└── to_workflow_event() → WorkflowEvent

ServerConfig (singleton)

WorkflowEvent (append-only log)
├── workflow_id → ImplementationState
├── domain: EventDomain
├── event_type: EventType (enum)
├── level: EventLevel
├── correlation_id (links related events)
├── trace_id (distributed tracing)
└── parent_id (causal chain)

TokenUsage (per-agent tracking)
└── workflow_id → ImplementationState