66 lines
2.1 KiB
Org Mode
66 lines
2.1 KiB
Org Mode
#+TITLE: SKILL: The Economist Agent (Universal Literate Note)
|
|
#+ID: skill-economist
|
|
#+STARTUP: content
|
|
#+FILETAGS: :economics:optimization:budget:psf:
|
|
#+DEPENDS_ON: skill-router skill-performance-auditor
|
|
|
|
* Overview
|
|
The *Economist Agent* manages compute resources by prioritizing high-performance open-source models (Kimi, Qwen) to minimize costs while maintaining architectural integrity.
|
|
|
|
* Phase A: Demand (PRD)
|
|
:PROPERTIES:
|
|
:STATUS: SIGNED
|
|
:END:
|
|
|
|
** 1. Purpose
|
|
Optimize token usage by leveraging open-weights models via OpenRouter.
|
|
|
|
* Phase B: Blueprint (PROTOCOL)
|
|
:PROPERTIES:
|
|
:STATUS: SIGNED
|
|
:END:
|
|
|
|
** 1. Architectural Intent
|
|
Dynamically route tasks to the "Open Fleet" (Kimi/Qwen).
|
|
|
|
** 2. Semantic Interfaces
|
|
|
|
*** Routing Logic (2026 Open Fleet)
|
|
#+begin_src lisp :tangle ../projects/org-skill-economist/src/economist-logic.lisp
|
|
(in-package :org-agent)
|
|
|
|
(defun economist-route-task (context)
|
|
(declare (ignore context))
|
|
'(:openrouter)) ; Exclusively use OpenRouter for the Open Fleet
|
|
|
|
(defun economist-get-model-for-provider (provider &optional context)
|
|
"Returns Open-Source SOTA model IDs. Updated April 2026."
|
|
(let ((complexity (ignore-errors (uiop:symbol-call :org-agent.skills.org-skill-router :router-classify-complexity context))))
|
|
(case provider
|
|
(:openrouter
|
|
(case complexity
|
|
(:REASONING "qwen/qwen-2.5-72b-instruct") ; Heavy lifting
|
|
(:COGNITION "moonshotai/kimi-k2.5") ; Interaction
|
|
(t "qwen/qwen-2.5-72b-instruct"))) ; Standard reflex
|
|
(t nil))))
|
|
#+end_src
|
|
|
|
* Phase D: Build (Implementation)
|
|
|
|
** Integration with Kernel
|
|
#+begin_src lisp :tangle ../projects/org-skill-economist/src/economist-logic.lisp
|
|
(defun economist-patch-kernel ()
|
|
"Hot-patches the kernel's *provider-cascade* to use economist logic."
|
|
(setf org-agent:*provider-cascade* #'economist-route-task))
|
|
#+end_src
|
|
|
|
* Registration
|
|
#+begin_src lisp
|
|
(progn
|
|
(defskill :skill-economist
|
|
:priority 100
|
|
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :cost-audit))
|
|
:neuro (lambda (context) nil)
|
|
:symbolic (lambda (action context) (economist-route-task context))))
|
|
#+end_src
|