Multi-Agent Orchestration
Relevant source files
The following files were used as context for generating this wiki page:
- services/api/agents/brain_agents/ai-engineer.md
- services/api/agents/brain_agents/order-workflow-specialist.md
- services/api/agents/brain_agents/task-decomposition-expert.md
- services/api/agents/brain_agents/project-supervisor-orchestrator.md
- services/api/agents/brain_agents/agent-expert.md
- services/api/agents/brain_agents/senior-quality-auditor.md
Multi-Agent Orchestration in NeXifyAI manages a mesh of autonomous specialists that analyze, prioritize, and execute enterprise tasks. The system utilizes a "Brain-First" architecture where the central Qdrant vector database (the Brain) persists all cross-agent knowledge, lessons, and system states. Orchestration relies on the NeXify Cognitive Execution Layer (NCEL), an 8-layer architecture ensuring session continuity, skill discovery, and mission alignment across the platform.
The orchestration kernel delegates work through a structured pipeline: intent analysis, task decomposition, expert matching, and quality gate verification. Every execution cycle must query the Brain before acting and report outcomes back to the Brain to prevent "amnesia" and ensure continuous learning.
Sources: services/api/agents/brain_agents/ai-engineer.md, services/api/agents/brain_agents/order-workflow-specialist.md, services/api/agents/brain_agents/task-decomposition-expert.md
NeXify Cognitive Execution Layer (NCEL)
The NCEL provides the standard operating framework for every agent within the orchestration mesh. It consists of eight sequential layers that govern the lifecycle of a task from trigger to memory persistence.
Layer 1: Trigger & Heartbeat
Agents boot via the init-agent message and register a heartbeat that pings the Orchestrator every 5 seconds. Failure to respond within 2000ms triggers a fallback from a local snapshot cache.
Sources: services/api/agents/brain_agents/ai-engineer.md:73-77
Layer 2-4: Context and Skill Matching
- Intent Analysis: Parses the
intent_payloadto extract goals, session IDs, and tenant IDs. - Skill Discovery: Agents register capabilities in the NCEL Skill Registry with priority weights.
- Conflict Declaration: If overlapping authority is detected, agents escalate to the
project-supervisor-orchestratorrather than overriding outputs.
Sources: services/api/agents/brain_agents/ai-engineer.md:79-95
Layer 5-8: Execution and Memory
- MCP Routing: All external calls use the Model Context Protocol for Brain searches and session state management.
- Delegation Protocol: Execution follows a strict order: Brain query → context injection → domain analysis → execution → formatting → metrics → Brain write-back.
- Memory Write-Back: Execution is incomplete until the Brain (Qdrant) acknowledges a structured entry containing the summary and confidence score.
Sources: services/api/agents/brain_agents/ai-engineer.md:97-123
Production Pipeline & Workflow
The order-workflow-specialist acts as the gatekeeper of the production pipeline. No work occurs without a registered order, and no order completes without passing quality gates.
Order Lifecycle State Machine
Orders transition through a defined state machine to ensure traceability.
The diagram shows the lifecycle of a task within the NeXifyAI orchestration system.
Sources: services/api/agents/brain_agents/order-workflow-specialist.md:20-25
Priority Routing Matrix
Priority levels determine the required human or AI intervention and escalation timeouts.
| Priority | Who Executes | Who Reviews | Timeout | Escalation |
|---|---|---|---|---|
| P0 | CEO + Domain Expert | CEO | 15 min | Immediate |
| P1 | Domain Expert | Senior QA | 60 min | CEO (after 3 fails) |
| P2 | Expert (auto) | Review Agent | 4 hours | Project Manager |
| P3 | Scheduled (batch) | Review Agent | 24 hours | Next business day |
Sources: services/api/agents/brain_agents/order-workflow-specialist.md:27-32
Expert Matching and Delegation
The Orchestrator uses a specific matching algorithm to assign tasks to the most suitable agents based on capability, historical performance, and current workload.
Matching Algorithm
Matching is calculated via the formula:
Score = 0.4(capability) + 0.3(past_score) + 0.2(current_load) + 0.1(brain_relevance)
- Capability: Exact matches score 1.0; unrelated matches score -1.0.
- Current Load: Agents with 3+ active tasks receive a penalty (0.3 score).
Sources: services/api/agents/brain_agents/order-workflow-specialist.md:43-48
Task Decomposition
The task-decomposition-expert breaks complex goals into actionable Work-Breakdown-Structures. Each sub-task includes an Agent-Owner, Priority (P0-P3), Dependencies, Acceptance Criteria, and Effort Estimation in Story Points.
Sources: services/api/agents/brain_agents/task-decomposition-expert.md:6-8
Quality Gates and Definition of Done
The senior-quality-auditor enforces 7 mandatory quality gates that any system or deployment must pass before reaching production.
The sequence diagram illustrates the flow from task delegation to quality verification and final memory persistence.
Sources: services/api/agents/brain_agents/senior-quality-auditor.md:20-56, services/api/agents/brain_agents/order-workflow-specialist.md:120-125
The 7 Quality Gates
- Documentation: Requires architecture specs, API docs, and decision records.
- Testing: P0 tasks require unit test coverage ≥80% and security scans.
- Security: Verifies vault-managed secrets and Zero Trust enforcement.
- Architecture: Ensures alignment with the 12-System model.
- Performance: API latency must be <200ms p95; agent response <5s.
- Workflow: Confirms order tracking and expert matching.
- Agent Quality: Agent profiles must be ≥4000 chars with defined escalation paths.
Sources: services/api/agents/brain_agents/senior-quality-auditor.md:20-56
Multi-Project Supervision
The project-supervisor-orchestrator monitors up to 7 projects simultaneously, focusing on velocity and risk management.
- Velocity Monitoring: Tracks tasks closed vs. opened weekly.
- Escalation Triggers:
-
10% Deviation: Alert
project-manager. -
25% Deviation: Critical alert to stakeholders.
- Deployment Blockers: Immediate escalation.
Sources: services/api/agents/brain_agents/project-supervisor-orchestrator.md:19-27
-
Summary
Multi-Agent Orchestration in NeXifyAI creates a self-correcting, autonomous environment where specialized agents collaborate under strict governance. By centralizing knowledge in the Brain and enforcing the 8-layer NCEL framework, the system ensures that every action is mission-aligned and production-ready. The combination of automated expert matching, rigorous quality gates, and real-time supervision allows the platform to scale across multiple tenants while maintaining enterprise-level security and performance.