cass-memory tackles a common challenge in AI coding agents: how to maintain a reliable, evolving knowledge base from multiple sessions and agents without letting stale or harmful rules pollute the system. It implements a three-layer cognitive architecture that unifies raw session logs into a persistent memory with confidence tracking and automatic anti-pattern learning.
What cass-memory is and its architecture
At its core, cass-memory is a TypeScript CLI tool that implements a three-layer cognitive architecture inspired by human memory systems: episodic, working, and procedural memory. It ingests raw session logs from various AI coding agents such as Claude Code, Cursor, Codex, and Aider, transforming them into a unified, persistent knowledge base that tracks the confidence of each rule or pattern.
The architecture is designed to handle memory decay and validation rigorously. The episodic memory layer stores raw session events, the working memory holds transient context, and the procedural memory contains established rules and patterns derived from past interactions. This layered approach allows cass-memory to manage knowledge evolution systematically, reflecting real-world agent learning.
The system is built with TypeScript and operates primarily as a CLI tool. It integrates with multiple AI agents via the Model Context Protocol (MCP) and optionally uses large language model APIs (Anthropic, OpenAI, or Google Generative AI) for AI-powered reflection and validation. This modular design ensures that even if some components like the cass CLI, LLM API, or playbook are missing, the system degrades gracefully, maintaining core functionality.
The confidence decay system and anti-pattern learning
One of cass-memory’s standout features is its confidence decay mechanism. Each rule or pattern in the procedural memory has an associated confidence score that halves every 90 days if not revalidated—a 90-day half-life. This prevents the accumulation of stale rules that no longer apply or are outdated.
Moreover, the system assigns a 4x multiplier to harmful marks, meaning a single mistake weighs four times as heavily as a single success. This aggressive weighting helps the system quickly identify and downgrade harmful or erroneous rules.
The maturity progression of rules—from candidate to established to proven—provides a clear lifecycle for knowledge, allowing developers to see how rules evolve with ongoing validation. This progression is gated by evidence from historical sessions, ensuring that only well-supported rules persist.
Another interesting mechanism is the automatic generation of anti-patterns from harmful marks. If a rule repeatedly causes problems, cass-memory converts it into an anti-pattern, effectively a warning that prevents agents from repeating the same mistakes. This feature not only protects the system from recurring errors but also helps agents learn safer coding behaviors over time.
Under the hood, this design trades off some complexity in rule management and dependency on accurate session logging for a more reliable, self-correcting knowledge base. The code quality is notably clean, with clear separation between memory layers and robust handling of edge cases like missing components or API keys.
Quick start with cass-memory
Always use --json in agent contexts. stdout outputs data, stderr outputs diagnostics, and exit code 0 signals success.
Installation
Recommended: Homebrew (macOS/Linux)
brew install dicklesworthstone/tap/cm
This method handles automatic updates, dependency management, and easy uninstallation.
Windows: Scoop
scoop bucket add dicklesworthstone https://github.com/Dicklesworthstone/scoop-bucket
scoop install dicklesworthstone/cm
Alternative: Install script (Linux/macOS)
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/cass_memory_system/main/install.sh?$(date +%s)" \
| bash -s -- --easy-mode --verify
You can also download direct binaries for various platforms including Linux x64, macOS Apple Silicon, macOS Intel, and Windows x64.
Verification
To verify installation:
cm --version
cm doctor --json
Setup & diagnostics
Install safety hooks for Claude Code pre-tool hooks:
cm guard --install
cm guard --git
Prerequisites
- cass CLI (episodic memory layer) must be installed separately
- LLM API keys (Anthropic, OpenAI, or Google Generative AI) are optional but recommended for AI-powered reflection
verdict
cass-memory is a specialized tool for AI researchers and developers working with multi-agent coding systems who need a persistent, evolving memory architecture. Its confidence decay system and anti-pattern learning mechanisms provide a disciplined approach to managing knowledge validity over time.
The tradeoff is the added complexity in setup and dependency on accurate session logs and LLM API keys for full functionality. It’s not a general-purpose memory system but shines in environments where multiple AI agents collaborate and learn from shared history.
For practitioners building or maintaining AI coding agents, cass-memory offers a pragmatic and well-engineered solution to prevent stale knowledge buildup and automate error correction in agent playbooks. The codebase is approachable, and the installer robustness ensures it can be integrated reliably into existing workflows.
If you’re managing AI agents at scale and want a memory system that evolves with confidence and caution, cass-memory is worth exploring.
Related Articles
- A-MEM: dynamic semantic memory management for LLM agents inspired by Zettelkasten — A-MEM is a Python agentic memory system that dynamically organizes LLM agent memories using semantic embeddings and auto
- mem0: optimizing AI agent memory with a new single-pass additive algorithm — mem0 enhances AI agent memory with a new single-pass ADD-only extraction algorithm and multi-signal retrieval, boosting
- Mercury Agent: A TypeScript AI assistant with persistent “Second Brain” memory and permission-hardened safety — Mercury Agent is a TypeScript AI assistant with a persistent SQLite-based memory system, permission-hardened tools, and
→ GitHub Repo: Dicklesworthstone/cass_memory_system ⭐ 352 · TypeScript