System Overview

NEXUS is an enterprise multi-agent orchestration system that operates as a complete autonomous software engineering organization. Instead of a single AI assistant, NEXUS deploys 56 specialized agents organized into a streamlined hierarchy — from executive leadership to specialized engineers.

How It Works

Human Input (Slack, CLI, API, Neovim)
         |
         v
Authentication & Rate Limiting
         |
         v
Haiku LLM Intake (natural language -> intent classification)
         |
         +---> Tool Execution (simple queries: status, org, cost)
         |
         +---> Directive Workflow (build/change requests)
                  |
                  v
Strategic Planning Gate (Chief of Staff, CPO, CFO, CRO)
                  |
                  v
Technical Design (VP Engineering + Tech Lead)
                  |
                  v
ML Intelligence Briefing (cost prediction, risk, similar work)
                  |
                  v
Task Decomposition & Parallel Assignment
                  |
                  v
Parallel Execution (multiple agents, multiple workstreams)
                  |
                  v
Quality Gates (zero-tolerance: warnings = errors)
                  |
                  v
Code Review (senior engineers)
                  |
                  v
Completion & Learning (feedback loop, ML retraining)

The Organization

NEXUS operates with 56 active agents organized into a flat, efficient hierarchy:

TeamCountRolesModels
Leadership3Chief of Staff, VP Engineering, VP ProductOpus/Sonnet
Engineering25Senior Engineers (8), Engineers (12), DevOps (4)Sonnet
Product5Product Managers (3), Designers (2)Sonnet
Quality7QA Lead (1), QA Engineers (6)Sonnet
Security4Security Engineers — auth, scanning, complianceSonnet
Knowledge1Knowledge Manager — RAG, documentation, learningSonnet

Dynamic Org Management: Hire, fire, promote, reassign — all through natural language.

Orchestration Engine

The LangGraph orchestration engine manages a 56-agent execution orchestration that handles:

  • Strategic Planning: Executive approval gates before any work begins
  • Technical Design: Architecture design documents and API contracts
  • Task Decomposition: Automatic identification of parallel workstreams
  • ML Agent Routing: Learned task-to-agent matching based on historical success
  • Parallel Execution: Independent workstreams execute simultaneously
  • TDD Workflow: Test-first development enforcement
  • Quality Gates: Zero-tolerance policy — warnings equal errors
  • Code Review: Senior engineer validation before completion

Machine Learning System

NEXUS learns from every execution. Five ML models continuously improve:

ModelAlgorithmPurpose
Agent RouterTF-IDF + RandomForestRoutes tasks to the best agent based on history
Cost PredictorTF-IDF + RandomForest RegressorEstimates cost before execution with confidence intervals
Quality PredictorTF-IDF + GradientBoostingPredicts first-pass approval probability
Escalation PredictorTF-IDF + GradientBoostingFlags agents at risk of needing escalation
Directive SimilaritySentence-TransformersFinds semantically similar past work

Cold-Start Design

Every ML feature degrades gracefully when training data is insufficient:

FeatureCold StartAfter Training
Agent routingKeyword matchingML routing (after 20+ samples)
Cost predictionNo estimatePrediction + confidence interval (after 15+ samples)
Directive similarityNo matchesSemantic search across all past directives

Auto-Retraining

After every 10 new task outcomes, all models retrain automatically (throttled to once per hour).

RAG Knowledge Base

CLI subprocesses run in one-shot pipe mode with no persistent memory. The RAG system provides cross-session memory by storing knowledge from every interaction:

Chunk TypeWeightSource
error_resolution1.3xPast debugging sessions and fixes
task_outcome1.1xTask results with agent and cost data
conversation1.0xSlack Q&A exchanges
code_change0.9xFile modifications and their context
directive_summary0.8xHigh-level project outcomes

Retrieval Pipeline

  1. Encode query via sentence-transformers (384-dim vectors)
  2. SQL pre-filter by chunk type, domain tag, and age
  3. Cosine similarity against filtered candidates
  4. Weight by chunk type importance
  5. Apply recency boost (up to 10% for recent chunks)
  6. Return top-8 results within character budget

Data Persistence

Seven encrypted SQLite databases store all system state:

DatabasePurpose
registry.dbAgent configurations, org structure, circuit breakers
memory.dbDirectives, tasks, events, peer decisions
cost.dbPer-API-call token usage and costs
kpi.dbProductivity and quality metrics
ml.dbTask outcomes, embeddings, model artifacts
knowledge.dbRAG knowledge chunks (dedicated for cosine similarity)
sessions.dbCLI session state, thread mapping, async history

All databases are encrypted with AES-256-CBC using SQLCipher with PBKDF2 key derivation (256,000 iterations).

Interfaces

NEXUS supports multiple input interfaces:

Slack (Primary)

Send natural language messages in your configured channel. NEXUS handles everything from "Build me a landing page" to "What's our burn rate?"

Neovim Plugin

:Nexus, :NexusTalk, :NexusOrg, :NexusStatus, :NexusKpi — direct IDE integration.

REST API

Full API at localhost:4200 with endpoints for messaging, ML status, agent stats, org management, and more.

CLI (buildwithnexus)

Interactive shell with real-time agent streaming. Type natural language or use slash commands:

  • /brainstorm — Trigger discovery-first questioning for domain-specific topics
  • /switch or /mode — Change between PLAN, BUILD, and BRAINSTORM modes See the CLI page for complete documentation.

Tech Stack

CategoryTechnology
CLITypeScript + Node.js
Backend ServerNode.js HTTP API
PersistenceSQLite with SQLCipher encryption
Agent IntegrationClaude Opus/Sonnet/Haiku, Gemini, OpenAI
Communication ProtocolServer-Sent Events (SSE)
SecurityAES-256 encryption, JWT auth, secure key storage

Quality Standards

NEXUS enforces a zero-tolerance policy for all warnings:

  • Linter warnings = build failure
  • Test warnings = build failure
  • Security warnings = critical blocker
  • Type violations = build failure

Zero acceptable warnings. Fix it or don't ship it.

This policy is enforced at the quality gate in the orchestration pipeline. Only when ALL checks pass can code proceed to review and deployment.