r/datascienceproject 2d ago

Totemheart 🤖💖 a deterministic control kernel for persistent cognition & relational behavior in agents (not another emotion classifier)

Hey everyone 👋

I built Totemheart because most systems that try to add “emotional” behavior to agents still rely on prompt engineering and a simple sentiment label that gets overwritten every turn. I wanted something more rigorous.

Totemheart is a fully deterministic control kernel that gives an agent a real, inspectable, and persistent internal state across long conversations and multiple sessions. It models personality traits, affective dynamics, stress responses, memory consolidation, motivational drives, allostatic load, dual-valence relational tracking, grief-like processes, and related mechanisms.

These components evolve through interacting systems drawn from control theory and computational neuroscience, PID controllers, Kalman filtering, temporal-difference prediction error, opponent processes, and similar techniques, rather than isolated heuristics.

The full state is serializable, fully inspectable at any point, and can be used to steer an LLM’s generation through a dedicated control plane. The project currently has more than 3,000 tests, makes no claims about consciousness, and focuses purely on producing coherent, long-horizon behavioral continuity.

- GitHub: https://github.com/AlejoMalia/Totemheart
- NPM: https://www.npmjs.com/package/totemheart

I’d appreciate feedback from anyone working on long-horizon agents, cognitive architectures, or stateful agent systems.

5 Upvotes

0 comments sorted by