Files
memex/notes/org-skill-router.org

2.4 KiB

SKILL: Cognitive Router Agent (Universal Literate Note)

Overview

The Cognitive Router is the kernel's traffic controller. it classifies incoming stimuli into complexity tiers, enabling the Economist to make sovereign compute-allocation decisions.

Phase A: Demand (PRD)

1. Purpose

Classify tasks by complexity to optimize neural resource allocation.

2. User Needs

  • Tier Identification: Differentiate between routine grooming and deep architectural work.
  • Dynamic Dispatch: Route complex requests to high-fidelity backends.

Phase B: Blueprint (PROTOCOL)

1. Architectural Intent

Implement a deterministic classifier for known sensors and a neural fallback for ambiguous user commands.

2. Semantic Interfaces

Complexity Tiers

  • :REFLEX: System maintenance (heartbeats, persistence, cleanup).
  • :COGNITION: Conversational tasks (chat, summarization, metadata extraction).
  • :REASONING: Generative tasks (coding, blueprinting, debugging).

Routing Logic

(in-package :org-agent)

(defun router-classify-complexity (context)
  "Returns the complexity tier for a given stimulus context."
  (let* ((payload (getf context :payload))
         (sensor (getf payload :sensor))
         (skill (find-triggered-skill context))
         (skill-name (when skill (skill-name skill))))
    (cond
      ;; reasoning: generative or architectural
      ((member skill-name '("skill-architect" "skill-tech-analyst" "skill-scientist" "skill-self-fix") :test #'string-equal) :REASONING)
      ((member sensor '(:user-command)) :REASONING)
      
      ;; cognition: human interaction or semantic data
      ((member sensor '(:chat-message :delegation)) :COGNITION)
      ((member skill-name '("skill-scribe" "skill-web-research") :test #'string-equal) :COGNITION)
      
      ;; reflex: system infrastructure
      (t :REFLEX))))

Registration

(defskill :skill-router
  :priority 110
  :trigger (lambda (context) nil) ; Passive classifier
  :neuro (lambda (context) nil)
  :symbolic (lambda (action context) (router-classify-complexity context)))