Skip to main content

Architecture Overview

SO1 is a distributed automation platform that combines AI agents, workflow automation, and a unified control plane.

High-Level Architecture

Figure 1 — SO1 Platform Architecture. The console provides the user-facing dashboard; requests flow through the Hono BFF control plane to agents, n8n workflows, and PostgreSQL. Redis backs the n8n job queue, and VERITAS supplies the curated prompt library.
Trace IDRequirementRationaleTest Case
SO1-ARCH-001Console shall communicate with the control plane API exclusively through the BFF layerCentralises auth, rate-limiting, and audit loggingTC-SO1-ARCH-001
SO1-ARCH-002All agent outputs shall be validated against defined JSON schemas before persistenceEnsures data integrity and traceability through FORGE gatesTC-SO1-ARCH-002
SO1-ARCH-003VERITAS prompts shall be version-controlled and bidirectionally linked to agent executionsEnables reproducible outputs and prompt regression testingTC-SO1-ARCH-003

Component Details

SO1 Console

Repository: so1-io/so1-console
TechnologyVersionPurpose
Next.js16React framework with App Router
React19UI components
TanStack Query5Data fetching and caching
Tailwind CSS4Styling
TypeScript5.7Type safety

SO1 Control Plane API

Repository: so1-io/so1-control-plane-api
TechnologyVersionPurpose
Hono4Web framework
Drizzle ORM-Database queries
Zod3Schema validation
Better Auth-Authentication
TypeScript5.7Type safety

SO1 Agents

Repository: so1-io/so1-agents 20 specialized AI agents organized into 7 domains:
DomainAgentsPrimary Output
Orchestration2Task coordination
Automation3n8n workflows
Engineering3TypeScript code
DevOps3CI/CD configs
Documentation3MDX/OpenAPI
Prompts3Veritas drafts
Incident3Response plans

Veritas

Repository: so1-io/veritas Curated prompt library with 255 prompts organized by domain and purpose.

n8n

Self-hosted workflow automation platform with 400+ integrations.

Data Flow

Workflow Execution

Figure 2 — Workflow Execution Flow. User requests originate in the console, are routed through the Hono API’s /execute endpoint, and dispatched to n8n. PostgreSQL records an audit trail, while n8n fans out to external integrations.
Trace IDRequirementRationaleTest Case
SO1-WF-001Every workflow execution shall be audit-logged in PostgreSQL with a correlation IDProvides traceability and supports incident forensicsTC-SO1-WF-001
SO1-WF-002Workflow dispatch shall be asynchronous with status polling via the APIPrevents UI blocking for long-running workflowsTC-SO1-WF-002

Agent Workflow

Figure 3 — Agent Workflow with VERITAS. Developers interact via OpenCode, which provides context to a specialised SO1 agent. The agent processes work and produces schema-validated output. All three stages maintain a bidirectional link with VERITAS for prompt lookup and contribution.
Trace IDRequirementRationaleTest Case
SO1-AGT-001Agent output shall conform to a registered JSON schema before acceptancePrevents malformed outputs from propagating downstreamTC-SO1-AGT-001
SO1-AGT-002VERITAS prompts consumed by an agent shall be pinned to a specific versionGuarantees reproducibility across runsTC-SO1-AGT-002

Deployment Architecture

Railway Deployment

Figure 4 — Railway Deployment Topology. All production services run within a single Railway project. The Console, API, and n8n share a private network with PostgreSQL and Redis as managed data stores.
Trace IDRequirementRationaleTest Case
SO1-DEP-001All production services shall run in a single Railway project with private networkingSimplifies secrets management and reduces cross-network latencyTC-SO1-DEP-001
SO1-DEP-002Database and cache services shall use managed Railway add-ons with automated backupsReduces operational burden and improves disaster recovery postureTC-SO1-DEP-002

CI/CD Pipeline

Figure 5 — CI/CD Pipeline. Pushes to GitHub trigger Actions workflows that build, test, and deploy to Railway. Slack notifications are dispatched in parallel with deployment.
Trace IDRequirementRationaleTest Case
SO1-CICD-001Every push to main shall trigger an automated build-test-deploy pipelineEliminates manual deployment steps and ensures consistent releasesTC-SO1-CICD-001
SO1-CICD-002Pipeline failures shall notify the team via Slack within 60 secondsShortens incident detection timeTC-SO1-CICD-002

Security Architecture

Authentication Flow

Figure 6 — Authentication Flow. Users initiate OAuth login through the console. Better Auth manages session creation and delegates to GitHub OAuth. A session cookie is returned for subsequent requests.
Trace IDRequirementRationaleTest Case
SO1-AUTH-001Authentication shall use OAuth 2.0 via Better Auth with GitHub as the identity providerLeverages existing GitHub identities and avoids custom credential managementTC-SO1-AUTH-001
SO1-AUTH-002Sessions shall be stored as secure, HttpOnly cookies with configurable TTLMitigates XSS-based session theftTC-SO1-AUTH-002

API Security

LayerProtection
TransportHTTPS/TLS 1.3
AuthenticationBetter Auth + Sessions
AuthorizationRBAC (org/project/user)
ValidationZod schemas
Rate LimitingPer-org throttling

Monitoring & Observability

ComponentToolPurpose
MetricsRailway MetricsCPU, Memory, Network
LogsRailway LogsApplication logging
ErrorsSentryError tracking
UptimeExternal checksAvailability monitoring

FORGE Stages

Stage-gated execution model

Veritas Integration

Prompt library architecture