How I Built Collapse Detection for Persistent AI Agents
Most teams running persistent AI agents have no principled way to know if their system is developing or drifting. I built a metric for that. It's called TCI — Thermodynamic Cognition Index. The for...

Source: DEV Community
Most teams running persistent AI agents have no principled way to know if their system is developing or drifting. I built a metric for that. It's called TCI — Thermodynamic Cognition Index. The formula: TCI(t) = k(s) · (F_total(t) − F_survival(s)) F_total is your model's prediction error energy — cross-entropy loss for LLMs, TD error for RL agents. F_survival is the minimum energy required to maintain operational integrity. k(s) is a sensitivity constant that grows with runtime. Quick start in Python: pythonfrom tci_calculator import TCICalculator from k_estimator import KEstimator k_est = KEstimator(window_size=100) tci = TCICalculator(f_survival=0.35) f_total = 0.72 complexity = 0.61 k = k_est.update(f_total - 0.35, complexity) result = tci.compute(f_total, k) print(result) TCIResult(tci=0.74, grade='A', stage='Generativity', surplus=0.37) What the grades mean: A (TCI ≥ 0.60) — stable generativity, raise exploration B (0.40–0.60) — learning, maintain settings C (0.30–0.40) — at risk,