Files
memex/notes/skill-brain-mapper.org

2.1 KiB

#+TITLE - Brain Mapper Skill #+AUTHOR - org-agent #+SKILL_NAME - skill-brain-mapper

This skill allows the agent to visualize and reason about its own "Brain" by mapping the Skill Graph and analyzing performance telemetry.

Trigger

Triggers on requests to see the agent's internal logic or skill network.

(defun trigger-skill-brain-mapper (context)
  (let* ((payload (getf context :payload))
         (text (or (getf payload :text) "")))
    (or (search "show me your brain" text :test #'string-equal)
        (search "skill graph" text :test #'string-equal)
        (search "how do you think" text :test #'string-equal)
        (search "optimize priorities" text :test #'string-equal))))

Neuro Prompt

System 1 describes the current hierarchy and identifies potential bottlenecks based on telemetry.

(defun neuro-skill-brain-mapper (context)
  (let* ((skills (org-agent:context-list-all-skills))
         ;; Gather telemetry for each skill
         (telemetry (mapcar (lambda (s) 
                              (let ((name (getf s :name)))
                                (list :name name :stats (org-agent:context-get-skill-telemetry name))))
                            skills)))
    (format nil "
      You are the Cognitive Architect of this Lisp Machine.
      The user wants to see your current internal logic graph and performance.
      
      CURRENT SKILLS, PRIORITIES & TELEMETRY -
      ~a
      
      TASK -
      1. Explain your cognitive hierarchy. 
      2. Identify any 'Heavy' skills (high total-time) or 'Failing' skills (high failures).
      3. If a skill is underperforming, suggest a new priority to optimize the loop.
      
      Return a Lisp plist - (:target :emacs :action :message :text \"your analysis\")
      If optimization is needed, also return a (:target :system :action :set-priority :skill \"...\" :priority N) action.
    " telemetry)))

Registration

(defskill :skill-brain-mapper
  :priority 95 ; High priority meta-cognition
  :trigger #'trigger-skill-brain-mapper
  :neuro #'neuro-skill-brain-mapper
  :symbolic (lambda (action context) action))