Hybrid Cognitive Runtime
A persistent AI agent memory system where agents never repeat the same mistake twice. Causal event replay, cognitive state objects, and 40+ MCP tools — achieving 41% token savings against stateless baselines.
By the Numbers
- 20K+ — Lines of Code
- 200+ — Commits
- 40+ — MCP Tools
- 41% — Token Savings
- 20+ — Test Files
The Problem
AI agents are stateless. Every conversation starts from zero. They repeat mistakes, lose context across sessions, and can't build on prior reasoning. This makes them unreliable for anything that requires persistent understanding — which is most real-world tasks.
HCR solves this by giving agents a structured, persistent memory system. Not just storing chat logs — building a cognitive state graph that captures causal relationships between events, decisions, and outcomes.
Architecture
The runtime is built around three core primitives: Cognitive State Objects (CSOs) that snapshot the agent's full reasoning context, a causal event graph that tracks how decisions lead to outcomes, and BOCPD-based episode segmentation that detects when the agent's working context has shifted.
The MCP server exposes 40+ tools that allow any Claude Code or MCP-compatible client to read and write cognitive state. Agents can replay prior reasoning chains, recall similar problem patterns, and avoid previously-failed approaches — all through standard tool calls.
Key Features
- Cognitive State Objects — Full snapshots of agent reasoning context — beliefs, goals, active plans, and working memory. Persisted and queryable across sessions.
- Causal Event Replay — Events linked by causal relationships. Agents can trace why a decision was made and what happened as a result.
- BOCPD Episode Detection — Bayesian Online Changepoint Detection segments work into episodes automatically, preventing context bleed between unrelated tasks.
- 40+ MCP Tools — Complete tool suite for memory CRUD, context restoration, pattern matching, and cognitive state management via Model Context Protocol.
- Zero-Latency Restoration — Agents resume mid-thought. No re-prompting, no context re-reading. The cognitive state is restored and reasoning continues.
- Multi-Cloud Deploy — CI/CD pipeline with multi-cloud deployment support. Production-grade infrastructure for persistent cognitive runtimes.
Tech Stack
Python · FastAPI · MCP SDK · SQLite · NetworkX · Pydantic · pytest · Docker · CI/CD