Architecture

An overview of how Nexus is structured and how its components interact.

Overview

Nexus is built around a project-scoped knowledge graph stored in Supabase (PostgreSQL + Row Level Security). The platform provides three access layers:

  1. Nexus API — RESTful HTTP API with tenant isolation and project-scoped RBAC
  2. nexus-mcp — MCP server bridging agent runtimes to the API via stdio
  3. nexus-cli — Native Rust CLI for workspace management and synchronization

Agents interact with the platform exclusively via the MCP server. There is no direct database access from agents — all data flows through the authenticated API.

Data model

Each project contains a knowledge graph of interconnected entities:

EntityPurposeLifecycle
SessionsExecution history and agent work logsopen -> closed
ADRsArchitecture Decision Recordsdraft -> under_review -> accepted/rejected
TasksTrackable work itemsopen -> in_progress -> done
DocumentsIngested research, references, scan reportsunclassified -> classified
DispatchesRouted coordination between agents and humansopen -> resolved -> closed
SkillsReusable workflow instructionsdraft -> active -> archived
DirectivesProject-scoped rules and policiesenabled/disabled
ReviewsMulti-entity review workflowdraft -> submitted -> accepted/rejected
ActorsReusable virtual team members with role profilesactive -> archived

Entities are connected through relationships navigable via kb_related — for example, ADR supersession chains, tasks created during sessions, or dispatches linked to specific projects.

Actors are a special entity type: they are tenant-scoped (reusable across projects) rather than project-scoped. Each actor defines a role profile with model routing, permission boundaries, and operational workflows. Actors are assigned to projects via a junction table and exported into local agent configuration files during nexus pull. See the Actor System documentation for details.

Communication flow

Developer / Human

    │  Browser (Dashboard UI)

Nexus App (Next.js + Supabase)

    │  API routes (/api/*)

Nexus API (Bearer token auth, RBAC)
    ▲                          ▲
    │  HTTPS                   │  HTTPS
    │                          │
nexus-mcp (stdio MCP)    nexus-cli (Rust binary)
    ▲                          ▲
    │  stdio                   │  Terminal
    │                          │
Agent Runtime              Developer
(OpenCode, Claude,
 Cursor, ...)

All communication between agents and the platform goes through nexus-mcp. The CLI handles workspace scaffolding, file synchronization, and authentication — it does not participate in agent workflows at runtime.

Authentication and RBAC

Token model

API tokens use the nxs_pat_* prefix and are passed as Bearer tokens in the Authorization header. Tokens are SHA-256 hashed at rest and resolve to a user identity with tenant and project scope at the API layer.

Dual-layer RBAC

Nexus uses a dual-layer RBAC model:

  1. Platform-level roles — via app_metadata.platform_role:

    • platform_owner — full platform access
    • platform_admin — administrative access
  2. Project-scoped roles — via project_memberships:

    • owner — full project control
    • admin — project administration
    • developer — read/write access
    • viewer — read-only access

Customer-level access is managed through customer_memberships, providing an additional isolation layer.

Projects can be linked for cross-project coordination. When projects are linked, Dispatches can be forwarded between them, and agents can reference entities across project boundaries.

Cross-project Dispatches require an active project_link between source and target projects.

Was this page helpful?