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

1.8 KiB

SKILL: The Economist Agent (Universal Literate Note)

Overview

The Economist Agent manages the PSF's compute resources. It predicts the "Cost of Thought" for a task and autonomously selects the most cost-effective LLM provider or local model based on complexity and remaining budget.

Phase A: Demand (PRD)

1. Purpose

Optimize token usage and compute overhead without sacrificing architectural integrity.

2. User Needs

  • Predictive Budgeting: Estimate token cost before triggering SOTA models.
  • Provider Switching: Dynamically route tasks between local (Ollama) and cloud (Gemini) models.
  • Audit Reports: Provide transparency on compute consumption.

Phase D: Build (Implementation)

Resource Allocation

(defun economist-route-task (complexity)
  "Selects the optimal model backend based on task complexity (1-10)."
  (let ((budget (get-current-token-budget)))
    (cond
      ((> complexity 8) :gemini-1.5-pro) ; SOTA for architectural decisions
      ((and (> complexity 5) (> budget 100)) :gemini-flash)
      (t :ollama-local)))) ; Default to zero-cost local thought

(defun get-current-token-budget ()
  "Reads the remaining budget from org-agent telemetry."
  ;; Placeholder for actual telemetry lookup
  1000)

Registration

(defskill :skill-economist
  :priority 95
  :trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :budget-audit))
  :neuro (lambda (context) "Analyze current compute efficiency and propose routing updates.")
  :symbolic (lambda (action context) action))