Version: 4.0 | Last Updated: April 2026 | Status: Production Ready
- System Overview
- Architecture
- Core Components
- Subsystem Guides
- Frontend Integration
- Security & Permissions
- Documentation Index
The Powernode AI Orchestration System provides enterprise-grade AI agent execution, governance, and multi-provider integration. As of April 2026, the platform encompasses:
- 132 AI models in
app/models/ai/(pluscode_factory/subdirectory) - 88 controllers in
app/controllers/api/v1/ai/(includessecurity/subdirectory) - 376 services in
app/services/ai/across 52 subdirectories - 10 supported providers (Anthropic, OpenAI, Ollama, Azure, Google, Groq, Grok, Mistral, Cohere, plus custom)
| Feature | Description |
|---|---|
| Missions | End-to-end development pipeline with approval gates |
| Ralph Loops | Recursive agentic task execution from PRDs |
| Code Factory | Risk-aware code review with evidence-based merge gating |
| Model Router | Intelligent provider selection with 7 routing strategies |
| Agent Autonomy | Trust tiers (supervised → autonomous) with execution gates, goals, observations, proposals, escalations |
| Memory System | 4-tier memory: working (Redis), STM, LTM (pgvector), shared pools |
| RAG Pipeline | Hybrid search with vector, keyword, graph, and agentic retrieval |
| Skill Graph | Skills registry with versioning, conflicts, and gap detection |
| Codebase Intelligence | AST indexing, semantic navigation, blast-radius analysis, static analysis |
| Data Sources | Managed external data API integration (NOAA, Open-Meteo, etc.) with quota and credential tracking |
| Content Linking | Wikilink extraction from Pages → KG edges, backlinks, page embeddings |
| Security Guardrails | Input/output rails, PII detection, prompt injection protection |
| A2A / ACP / AGUI | Agent-to-agent, Agent Communication Protocol, Agent GUI state sync |
| Real-time Updates | WebSocket channels for mission/team/ralph-loop/code-factory events |
┌─────────────────────────────────────────────────────────────┐
│ Frontend Layer │
│ React Components → API Services │
│ (agents, teams, missions, providers, autonomy, ...) │
└──────────────────────────┬──────────────────────────────────┘
│ RESTful JSON API + WebSocket
┌──────────────────────────▼──────────────────────────────────┐
│ Backend API Layer │
│ 88 Controllers (Api::V1::Ai + Admin + Internal) │
│ Agents, Teams, Missions, Ralph, Code Factory, Providers, │
│ Model Router, Memory, RAG, Skills, Security, A2A, ACP, │
│ AGUI, Autonomy, Analytics, Monitoring, Data Sources, ... │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ Service Layer (376 services / 52 subdirs) │
│ Orchestration │ Autonomy │ Security │ Memory │ RAG │
│ Ralph │ Missions │ Code Factory │ Model Router │
│ Skill Graph │ Analytics │ Teams │ Codebase │ Data Sources│
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────▼──────────────────────────────────┐
│ Worker Service (Sidekiq) │
│ Mission phase jobs, Ralph iterations, trust decay, │
│ memory consolidation, skill lifecycle, knowledge sync, │
│ observation pipeline, daily summaries, data source sync │
└─────────────────────────────────────────────────────────────┘
Root services (orchestration entry points):
AiAgentOrchestrationService— agent execution orchestratorAi::Missions::OrchestratorService— mission lifecycleAi::Ralph::ExecutionService— Ralph loop executionAi::CodeFactory::OrchestratorService— code review pipelineAi::ModelRouterService— intelligent provider routing
Domain services (52 subdirectories — notable ones):
ai/autonomy/— trust, execution gates, kill switch, goals, observation sensors, escalations, proposals, duty cycle, shadow modeai/missions/— PRD generation, repo analysis, deployment, PR managementai/security/— security gates, anomaly detection, PII filteringai/memory/— working memory, storage, routing, embeddings, consolidationai/rag/— hybrid search, graph RAG, agentic RAGai/skill_graph/— lifecycle, conflicts, coverage, mutation, evolutionai/code_factory/— risk classification, remediation, merge gatingai/ralph/— agentic loop, task execution, git toolsai/codebase/— AST parsing, semantic search, blast-radius, static analysisai/teams/— CRUD, execution, configuration, A2Aai/analytics/— cost, performance, dashboardsai/tools/— MCP tool registry + per-subsystem tool classes (50+ classes, 305 actions)
132 models covering agents, teams, missions, memory, security, skills, autonomy, knowledge graph, goals, observations, and more.
Agent model hierarchy:
Ai::Agent # Core agent configuration
├── Ai::AgentExecution # Execution records
├── Ai::AgentTrustScore # Trust scoring (5 dimensions)
├── Ai::AgentSkill # Skill assignments
├── Ai::AgentBudget # Budget management
├── Ai::AgentShortTermMemory # Short-term memory entries
├── Ai::BehavioralFingerprint # Anomaly baselines
├── Ai::DelegationPolicy # Delegation rules
├── Ai::AgentIdentity # Identity verification
├── Ai::AgentGoal # Self-directed goals
├── Ai::AgentObservation # Environmental observations
├── Ai::AgentProposal # Proposals for human review
├── Ai::AgentEscalation # Structured escalations
└── Ai::AgentFeedback # Human-to-agent feedback
Multi-agent collaboration with configurable execution strategies.
Execution strategies: hierarchical, sequential, parallel, mesh
Team models: AgentTeam, AgentTeamMember, TeamRole, TeamExecution, TeamTask, TeamChannel, TeamMessage
End-to-end development pipeline with approval gates. See MISSIONS_GUIDE.md.
Phases: analyzing → awaiting_feature_approval → planning → awaiting_prd_approval → executing → testing → reviewing → awaiting_code_approval → deploying → previewing → merging → completed
Approval gates: feature_selection, prd_review, code_review, merge_approval
Multi-provider support with automatic model sync, rate limiting, and circuit-breaker-backed health checks.
Provider sync adapters: Anthropic, OpenAI, Ollama, Azure, Google, Groq, Grok, Mistral, Cohere, generic
Unified LLM client with provider-specific adapters.
# Adapters: AnthropicAdapter, OpenAIAdapter, OllamaAdapter
client = Ai::Llm::Client.new(provider: provider, credential: credential)
response = client.send_message(messages, options)AST-indexed knowledge graph of the codebase exposed via 14 MCP tools (code_context_tree, code_semantic_search, code_blast_radius, etc.). See the Codebase Intelligence section in the MCP Tool Catalog.
Managed integration of external data APIs (NOAA, Open-Meteo, etc.) with quota tracking, credential management, and test-connection probes. See DATA_SOURCES.md.
Wikilink extraction from Page content ([[Title]] / [[Title|Display]]) feeds the knowledge graph with references edges and supports backlink panels plus page embeddings. See CONTENT_LINKING.md.
| Subsystem | Guide | Description |
|---|---|---|
| Missions | MISSIONS_GUIDE.md | End-to-end dev pipeline with approval gates |
| Ralph Loops | RALPH_LOOPS_GUIDE.md | Recursive agentic task execution |
| Code Factory | CODE_FACTORY_GUIDE.md | Risk-aware code review pipeline |
| Model Router | MODEL_ROUTER_GUIDE.md | Intelligent provider routing |
| Agent Autonomy | AGENT_AUTONOMY_GUIDE.md | Trust tiers, goals, observations, proposals, escalations |
| Memory System | MEMORY_SYSTEM_ARCHITECTURE.md | Multi-tier memory architecture |
| Security | AI_SECURITY_GUARDRAILS.md | Guardrails & security gates |
| RAG System | RAG_SYSTEM_GUIDE.md | Document retrieval pipeline |
| Skill Graph | SKILL_GRAPH_REFERENCE.md | Skills registry & lifecycle |
| Provider Routing | AI_PROVIDER_ROUTING.md | Load balancing & circuit breakers |
| Cost Attribution | COST_ATTRIBUTION_SYSTEM.md | Cost tracking & optimization |
| Content Linking | CONTENT_LINKING.md | Wikilink extraction + backlinks |
| Data Sources | DATA_SOURCES.md | External data API management |
| Daily Summaries | DAILY_SUMMARIES.md | Auto-generated operational summaries |
import {
agentsApi, teamsApi, missionsApi,
providersApi, monitoringApi, analyticsApi
} from '@/shared/services/ai';
// Or use the convenience object
import { aiApi } from '@/shared/services/ai';| Channel | Purpose |
|---|---|
MissionChannel |
Mission status, phase, and approval events |
CodeFactoryChannel |
Code review pipeline events |
AiOrchestrationChannel |
Unified stream for agent executions, Ralph Loops, worktree sessions, circuit breakers, monitoring alerts, system health |
TeamChannel |
Team execution events |
AiAgentExecutionChannel |
Per-agent execution lifecycle |
AiConversationChannel |
Conversation message broadcasts |
AiStreamingChannel |
LLM token streaming |
The AiOrchestrationChannel accepts subscription types: account, agent, monitoring, system, circuit_breaker, ralph_loop, worktree_session.
CRITICAL: Frontend uses permission-based access control ONLY — never role-based.
// CORRECT
currentUser?.permissions?.includes('ai.missions.manage');
// FORBIDDEN
currentUser?.roles?.includes('admin');| Permission | Description |
|---|---|
ai.agents.create/execute/read/manage |
Agent management and execution |
ai.teams.create/execute/read/manage |
Team operations |
ai.missions.read/manage |
Mission operations |
ai.providers.manage |
Provider management |
ai.routing.read/manage/optimize |
Model router |
ai.code_factory.read/manage |
Code Factory |
ai.monitoring.read |
Monitoring dashboard |
ai.analytics.read |
Analytics |
ai.autonomy.manage |
Kill switch, intervention policies, duty cycles |
ai.knowledge.read/manage |
Knowledge base, learnings, shared knowledge |
ai_orchestration.read |
Read access to orchestration streams (WebSocket) |
admin.access |
Admin endpoints (daily summaries, maintenance, etc.) |
| Document | Purpose | Audience |
|---|---|---|
| This Guide | System overview & architecture | Everyone |
| API Reference | API endpoints & examples | Developers |
| Operations | Testing & monitoring | QA/DevOps |
| Quick Start | Getting started with AI features | Developers |
| Missions Guide | Mission pipeline | Developers |
| Ralph Loops Guide | Agentic execution | Developers |
| Code Factory Guide | Code review pipeline | Developers |
| Model Router Guide | Provider routing | Developers/DevOps |
| Agent Autonomy Guide | Trust & governance | Security/DevOps |
| Memory Architecture | Memory tiers | Developers |
| Security Guardrails | AI security | Security |
| RAG System Guide | Document retrieval | Developers |
| Skill Graph Reference | Skills registry | Developers |
| Provider Routing | Load balancing | DevOps |
| Cost Attribution | Cost tracking | FinOps |
| Data Sources | External data API integration | Developers/Ops |
| Content Linking | Wikilinks & backlinks | Content/Developers |
| Daily Summaries | Operational summaries | Admins |
| MCP Tool Catalog | All 305 MCP tool actions | Everyone |
server/app/models/ai/— 132 models (+code_factory/subdirectory)server/app/controllers/api/v1/ai/— 88 controllers (+security/subdirectory)server/app/services/ai/— 376 services across 52 subdirectoriesserver/app/channels/— WebSocket channels (Mission, CodeFactory, AiOrchestration, AiAgentExecution, AiConversation, AiStreaming, Team, Analytics)
# Backend tests
cd server && bundle exec rspec spec/
# Frontend type check
cd frontend && npx tsc --noEmit
# Start all services
sudo systemctl start powernode.target
# Database migrations
cd server && rails db:migrate
# Regenerate MCP tool catalog (305 actions)
cd server && rails mcp:generate_tool_catalogDocument Status: Production Ready