Files
memex/notes/org-skill-model-explorer.org
Amr Gharbeia fdb55c616d feat: stabilized org-agent two-way communication and UX
- Fixed kernel-to-Emacs communication bridge.
- Resolved boot-time crashes in multiple skeletal skills.
- Refined Chat skill prompt to eliminate conversational filler.
- Updated Emacs UI to automatically clean up status markers.
- Synchronized all fixes via Literate Org-mode documents.
- Verified physical two-way interaction via simulation.
2026-04-03 17:25:01 -04:00

2.3 KiB

SKILL: Model Explorer Agent (Universal Literate Note)

Overview

The Model Explorer Agent provides dynamic introspection of the system's LLM capabilities. It intercepts specific user commands to list and describe all available models across providers, rendering them as native Org-mode tables.

Phase B: Blueprint (PROTOCOL)

2. Semantic Interfaces

(defun trigger-skill-model-explorer (context)
  "Triggers on '@agent list models' in buffer updates.")

(defun build-org-table-for-models ()
  "Dynamically builds an Org table from registered provider skills.")

(defun execute-skill-model-explorer (action context)
  "Injects the model table into the active Emacs buffer.")

Phase D: Build (Implementation)

Trigger Logic

(defun trigger-skill-model-explorer (context)
  (let* ((payload (getf context :payload))
         (sensor (getf payload :sensor))
         (text (or (getf payload :text) "")))
    (and (eq sensor :chat-message)
         (search "@agent list models" text :test #'string-equal))))

Provider Introspection

(defun build-org-table-for-models ()
  (let ((models (org-agent:openrouter-get-available-models))
        (rows (list "| Provider | Model ID | Context |" "|----------+----------+---------|")))
    (if models
        (progn
          (dolist (m models)
            (push (format nil "| OpenRouter | ~a | ~a |" (getf m :id) (getf m :context)) rows))
          (format nil "~{~a~^~%~}" (nreverse rows)))
        "| Error | No models found or API key missing |")))

Actuation

(defun execute-skill-model-explorer (action context)
  (declare (ignore action))
  (let ((table (build-org-table-for-models)))
    (list :type :REQUEST 
          :target :emacs 
          :payload (list :action :insert-text 
                         :text (format nil "~%~%* Available Models~%~a~%" table)
                         :position :after-trigger))))

Registration

(defskill :skill-model-explorer
  :priority 110
  :trigger #'trigger-skill-model-explorer
  :neuro (lambda (context) nil) ; Deterministic skill
  :symbolic #'execute-skill-model-explorer)