Architecture

Orchestra is a distributed application orchestrated by .NET Aspire 9. It consists of five services, two infrastructure dependencies, and communicates with external third-party platforms via REST and MCP protocols.

System Diagram

The following diagram shows how all Orchestra services and dependencies connect at runtime:

┌─────────────────────────── .NET Aspire Orchestrator ─────────────────────────────┐ │ │ │ ┌──────────────────┐ ┌─────────────────────┐ ┌──────────────────────────┐ │ │ │ React 19 UI │ │ CopilotKit Runtime │ │ ADF Generator │ │ │ │ (Port 3002) │ │ (Port 3001) │ │ (Port 3300) │ │ │ └────────┬─────────┘ └──────────┬──────────┘ └────────────┬─────────────┘ │ │ │ │ │ │ │ └────────────────────────┴────────────────────────────┘ │ │ │ │ │ ┌──────────────────────────────────────▼───────────────────────────────────────┐ │ │ │ .NET 10 API Service (Port 3000) │ │ │ │ REST Controllers · Clean Architecture · SignalR Hubs │ │ │ └──────────────────────────────────────┬───────────────────────────────────────┘ │ │ │ │ │ ┌──────────────────────────────────────▼───────────────────────────────────────┐ │ │ │ .NET Worker Service (Background) │ │ │ │ Agent Execution · DB Migrations · Job Resume · Session Recovery │ │ │ └──────────┬──────────────────────────────────────────────────┬───────────────┘ │ │ │ │ │ │ ┌──────────▼──────────┐ ┌─────────────▼──────────────┐ │ │ │ PostgreSQL │ │ Redis │ │ │ │ (Primary Database) │ │ (SignalR Backplane) │ │ │ └─────────────────────┘ └────────────────────────────┘ │ │ │ │ External: Jira · GitHub · GitLab · Azure OpenAI · Ollama · MCP Servers │ │ GitHub Copilot CLI │ └────────────────────────────────────────────────────────────────────────────────────┘

Service Breakdown

Each service has a distinct responsibility and communicates over well-defined boundaries:

ServicePortResponsibility
React 19 UI 3002 Conductor's dashboard — agents, tickets, workflows, jobs, MCP, CLI integrations, and skills management
CopilotKit Runtime 3001 Node.js agentic UI communication layer powering the embedded AI assistant widget
ADF Generator 3300 Node.js microservice for bidirectional Atlassian Document Format (ADF) conversion
.NET 10 API 3000 Core business logic via Clean Architecture — REST controllers, SignalR hubs, JWT auth, encryption
.NET Worker Background agent execution, DB migrations on startup, job orchestration, session recovery after restarts
PostgreSQL 5432 Primary relational store via Entity Framework Core — all workspace, agent, ticket, and integration data
Redis 6379 SignalR scale-out backplane enabling real-time pub/sub between API and Worker services

Key Data Flows

Agent Execution Flow

1
Ticket assigned to agent

User assigns a ticket to an agent in the UI. The API creates a background Job record in PostgreSQL.

2
Worker picks up the job

The .NET Worker service polls for pending jobs and begins executing the agent with its configured tools and instructions.

3
Real-time status updates

As the agent works, the Worker publishes events to Redis. The API relays these via SignalR WebSocket to the connected UI.

4
Tool invocation

Agents call tools based on their authorized ToolAction list — either native integrations (via reflection) or MCP servers (via HTTP/stdio).

5
Job completion

The Worker marks the job complete. Sub-agent interactions and execution logs are persisted. The UI updates in real time.

MCP Tool Registration Flow

1
User adds MCP server

User submits an MCP server form with transport type (HTTP or stdio), endpoint, and auth credentials.

2
Connection validated

API calls POST /v1/integrations/mcp/discover to test the connection and list available tools.

3
Tools seeded to catalog

On success, McpToolSeedingService creates ToolCategory and ToolAction records — one per discovered tool.

4
Tools available to agents

Agents can now authorize these MCP tools via the agent form's tool authorization panel, referencing tools by ID.

Tech Stack

CategoryTechnologies
Backend.NET 10, .NET Aspire 9, Entity Framework Core
FrontendReact 19, Vite, TypeScript, Tailwind CSS, React Flow, Recharts
DatabasePostgreSQL (EF Core migrations)
Cache / Real-TimeRedis, SignalR (WebSockets)
AI RuntimeMicrosoft Agents Framework, Azure OpenAI, Ollama
AuthenticationJWT Bearer, bcrypt password hashing
Integration ProtocolModel Context Protocol (MCP) — stdio & HTTP transports
Node.js ServicesCopilotKit Runtime, ADF Generator (Express)
Orchestration.NET Aspire AppHost with service discovery

Clean Architecture Layers

The Orchestra.ApiService and Orchestra.Worker follow Clean Architecture with strict dependency rules:

Domain
Orchestra.Domain

Entities, enums, interfaces, value objects, validators. Zero external dependencies — the pure business model.

Key entities: Agent, Integration, Ticket, Workspace, ToolCategory, ToolAction

Application
Orchestra.Application

Use cases and services — AgentService, IntegrationService, McpIntegrationService, ToolService, AI agent execution logic.

Infrastructure
Orchestra.Infrastructure

EF Core DbContext, data access implementations, MCP client factory (HTTP + stdio), encryption service.

Presentation
Orchestra.ApiService

REST controllers, SignalR hubs, JWT middleware, request/response models. Depends only on Application interfaces.

Database Schema Overview

Key entities and their relationships stored in PostgreSQL:

EntityKey FieldsRelationships
Workspace Id, Name, AI provider config Has many Agents, Integrations, Tickets, Tools, Skills
Agent Id, WorkspaceId, Name, Role, Model, TemplateIdentifier Has many ToolActions (via AgentToolAction join table)
Integration Id, WorkspaceId, Provider, IsMcpBacked, McpEndpointUrl Has many ToolCategories (when MCP-backed)
ToolCategory Id, Name, ProviderType, IntegrationId? Has many ToolActions. IntegrationId = null for native tools
ToolAction Id, ToolCategoryId, Name, DangerLevel, IsMcpTool Referenced by AgentToolAction join records
Ticket Id, WorkspaceId, ExternalId, Status, Priority Sourced from Integration, optionally assigned to an Agent
Job Id, AgentId, TicketId, Status Created per agent execution, has many SubAgentInteractions
ℹ️

Migrations: EF Core database migrations are applied automatically by the Orchestra.Worker service on startup — no manual dotnet ef database update is required.