File size: 655 Bytes
63dd1f4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | from ..dream_engine.helix_memory import HelixMemory
import numpy as np
class ReasoningEngine:
MODE_MAP = {
"question": "EXECUTION",
"instruction": "RECOVERY",
"explanation": "ANALYTICAL",
"unknown": "EXPLORATORY",
}
def __init__(self, helix_path):
self.helix = HelixMemory(helix_path)
def select_mode(self, hv: np.ndarray) -> str:
prototypes = self.helix.retrieve(hv, top_k=1)
if not prototypes:
return "EXPLORATORY"
proto, meta = prototypes[0]
label = meta.get("label", "unknown")
return self.MODE_MAP.get(label, "EXPLORATORY")
|