Files
memex/notes/skill-environment-config.org

1.5 KiB

Environment Configuration Skill

This skill provides a centralized API for retrieving configuration from Org-mode properties stored in the Memex. It follows the "Homoiconic Configuration" pattern, ensuring that the user's environment is defined entirely within their notes.

Logic

(defun get-config-attribute (property-key &optional default)
  "Searches the global *object-store* for any headline containing PROPERTY-KEY."
  (let ((store org-agent:*object-store*))
    (maphash (lambda (id obj)
               (declare (ignore id))
               (when (eq (org-agent:org-object-type obj) :HEADLINE)
                 (let ((val (getf (org-agent:org-object-attributes obj) property-key)))
                   (when val
                     (return-from get-config-attribute val)))))
             store)
    default))

(defun get-tiered-model (tier default-model)
  "Retrieves a model ID based on a tier keyword (:POWERFUL, :FAST, :FREE)."
  (let ((prop (case tier
                (:powerful :LLM_MODEL_POWERFUL)
                (:fast     :LLM_MODEL_FAST)
                (:free     :LLM_MODEL_FREE)
                (t         :LLM_MODEL_TEXT))))
    (get-config-attribute prop default-model)))

Registration

(defskill :skill-environment-config
  :priority 100 ; Foundational skill
  :trigger (lambda (context) nil) ; No cognitive trigger
  :neuro (lambda (context) nil)
  :symbolic (lambda (action context) action))