Skip to content

Cortex

Cortex — the Nexus router and orchestrator. Receives user input, classifies intent via semantic signals, routes to the appropriate cognitive module, enforces trust/permissions through Aegis, logs to Chronicle, and stores interactions in Engram.

  • Version: 0.1.0
  • Class: Cortex
FieldTypeDefault
namestr—
modulestr—
scorefloat—
signalslist[str]field(default_factory=list)
FieldTypeDefault
namestr—
modulestr—
descriptionstr—
patternslist[re.Pattern]—
semantic_signalslist[str]—

set_workspace_config(self, config: 'WorkspaceConfig | None') -> None

Section titled “set_workspace_config(self, config: 'WorkspaceConfig | None') -> None”

Load (or clear) routing pins from the active workspace config.

Called by the workspace switcher when a workspace is activated or deactivated. Passing None clears all pins.

The pins are consulted in :meth:_select_module before the semantic scoring engine, so a pin bypasses Cortex’s intent classifier for the specified intents / categories.

Set the LLM inference function used by modules and fallback classification.

register_module(self, module: NexusModule) -> None

Section titled “register_module(self, module: NexusModule) -> None”

Register every built-in module’s manifest with Aegis.

Called once at kernel boot. Idempotent — registering the same manifest twice overwrites the dict entry but does not duplicate any DB rows (Aegis seeds trust only if the row is at 0.0).

async unregister_module(self, name: str) -> None

Section titled “async unregister_module(self, name: str) -> None”

get_module(self, name: str) -> NexusModule | None

Section titled “get_module(self, name: str) -> NexusModule | None”

Public module lookup (used by Sigil to read Sentry state).

Call on_load for all registered modules with kernel context.

Give EMERGENCY-priority Pulse messages a routing bypass.

Emergency broadcasts (Sigil detections) skip intent classification and the trust floor entirely: they are logged to Chronicle and, when the payload requests it and the kill switch allows, dispatched straight to Specter for an adversarial read. Idempotent.

Route a user message to the appropriate module and return the response.