6-Layer Structured Memory for AI Systems
Sub-millisecond access. Importance scoring. Dual-write persistence. Your AI remembers what matters.
CASCADE gives your AI a memory system with six specialized layers:
| Layer | Purpose |
|---|---|
| working | Current session context |
| episodic | Event-based memories with timestamps |
| semantic | Facts and knowledge |
| procedural | How-to and process memory |
| meta | Memory about memory (reflection) |
| identity | High-importance persistent storage |
Important memories persist based on the importance score you assign. Higher importance = longer retention when you implement your own retention policies.
- Sub-millisecond access via optional RAM disk acceleration
- Importance scoring - high-value memories persist based on score you assign
- Dual-write - RAM for speed, SQLite for persistence
- MCP server - native integration with Claude and other MCP clients
- Six specialized layers - right memory in the right place
- Temporal decay - memories fade over time unless accessed or marked important. Importance >= 0.9 makes a memory immortal.
| Platform | Architecture | Status |
|---|---|---|
| Windows x64 | Intel/AMD | Supported |
| Windows ARM64 | Snapdragon/Qualcomm | Supported (v2.1.0+) |
| Linux x64 | Intel/AMD | Supported |
| Linux ARM64 | ARM servers, Raspberry Pi | Supported |
| macOS x64 | Intel | Supported |
| macOS ARM64 | Apple Silicon | Supported |
Three paths. Pick what fits.
Requirements: Node.js >= 18, Python >= 3.10, Admin access for RAM disk
# Clone and install
git clone https://github.com/cipscorp/cascade-enterprise-ram.git
cd cascade-enterprise-ram
npm install
pip install .
# Create RAM disk (run as Administrator)
python -m ram_disk_manager init --disk-path ./data --size 512Requirements: Node.js >= 18, Python >= 3.10, sudo access for RAM disk
# Clone and install
git clone https://github.com/cipscorp/cascade-enterprise-ram.git
cd cascade-enterprise-ram
npm install
# Python dependencies (use virtual environment on modern Linux)
python3 -m venv .venv
source .venv/bin/activate
pip install .
# Create RAM disk (requires sudo - use full path to venv python)
sudo $(which python) -m ram_disk_manager init --disk-path ./data --size 512RAM disk paths by platform:
- Windows: Uses ImDisk, mounts to
R:\by default - Linux: Uses tmpfs, mounts to
/mnt/ramdisk/ - macOS: Uses diskutil, mounts to
/Volumes/RAMDisk/
Requirements: Docker, docker-compose
docker-compose up -d --buildData persists in ./data. Container uses tmpfs internally. See README_DOCKER.md for details.
CASCADE is an MCP server. It communicates via stdio, not HTTP.
Add to your claude_desktop_config.json:
Windows:
{
"mcpServers": {
"cascade-memory": {
"command": "node",
"args": ["C:\\path\\to\\cascade-enterprise-ram\\server\\index.js"],
"env": {
"CASCADE_DB_PATH": "C:\\path\\to\\cascade-enterprise-ram\\data",
"CASCADE_RAM_PATH": "R:\\cascade"
}
}
}
}macOS / Linux:
{
"mcpServers": {
"cascade-memory": {
"command": "node",
"args": ["/path/to/cascade-enterprise-ram/server/index.js"],
"env": {
"CASCADE_DB_PATH": "/path/to/cascade-enterprise-ram/data",
"CASCADE_RAM_PATH": "/mnt/ramdisk/cascade"
}
}
}
}Restart your MCP client after config changes.
Run the server directly to test:
node server/index.jsYou should see output beginning with:
{"message":"CASCADE Enterprise Memory MCP Server v2.2.2"}
Copy .env.example to .env and configure:
# Persistent database location (source of truth)
CASCADE_DB_PATH=./data
# RAM disk mount point (sub-millisecond reads)
# Windows: R:\cascade
# Linux: /mnt/ramdisk/cascade
# macOS: /Volumes/RAMDisk/cascade
CASCADE_RAM_PATH=
# Logging
LOG_LEVEL=info
LOG_FORMAT=json
DEBUG=false
# Temporal Decay
DECAY_ENABLED=true # Enable/disable temporal decay
DECAY_BASE_RATE=0.01 # Decay speed per day (higher = faster fade)
DECAY_THRESHOLD=0.1 # Effective importance below this hides memories
DECAY_IMMORTAL_THRESHOLD=0.9 # Importance at or above this never decays
DECAY_SWEEP_INTERVAL=60 # Minutes between decay sweeps
DECAY_SWEEP_BATCH_SIZE=1000 # Max memories processed per layer per sweepCASCADE exposes seven MCP tools:
Store a memory in a specific layer.
{
"tool": "remember",
"arguments": {
"content": "User prefers dark mode interfaces",
"layer": "semantic",
"importance": 0.8,
"metadata": {
"source": "user_preference"
}
}
}Parameters:
content(required): The memory contentlayer(optional): episodic, semantic, procedural, meta, identity, working. Default: auto-determined from content (fallback: working)importance(optional): 0.0-1.0. Higher values indicate higher priority. Default: 0.7metadata(optional): Key-value pairs for additional context
Search memories across all layers or a specific layer.
{
"tool": "recall",
"arguments": {
"query": "user interface preferences",
"layer": "semantic",
"limit": 10
}
}Parameters:
query(required): Search querylayer(optional): Limit search to specific layerlimit(optional): Maximum results. Default: 10include_decayed(optional): If true, include memories that have decayed below threshold. Default: false
Get all memories from a specific layer.
{
"tool": "query_layer",
"arguments": {
"layer": "working",
"options": {
"limit": 50,
"order_by": "timestamp DESC"
}
}
}Parameters:
layer(required): Layer to queryoptions(optional): Object withfilters,limit,order_byinclude_decayed(optional): If true, include decayed memories. Default: false
Results include effective_importance (importance adjusted for decay) on each memory.
Get system status and statistics.
{
"tool": "get_status",
"arguments": {}
}Returns memory counts per layer, health status, version, dual-write configuration, and decay engine status (enabled, sweep interval, thresholds).
Get detailed statistics for all memory layers.
{
"tool": "get_stats",
"arguments": {}
}Returns per-layer statistics including memory count, average importance, average emotional intensity, most recent timestamp, and decay counts (immortal, active, decayed).
Save memory to a specific layer with full control over metadata.
{
"tool": "save_to_layer",
"arguments": {
"layer": "semantic",
"content": "Important fact to remember",
"metadata": {
"importance": 0.9,
"emotional_intensity": 0.3,
"context": "user knowledge base"
}
}
}Parameters:
layer(required): Target layer (episodic, semantic, procedural, meta, identity, working)content(required): The memory content to savemetadata(optional): Full metadata control including importance, emotional_intensity, context
Get CASCADE echo ratio health metrics. Read-only monitoring that shows how much of each layer's content is derived (echoed) versus original.
{
"tool": "get_echo_stats",
"arguments": {}
}Returns per-layer echo ratios, overall statistics, and warnings when any layer exceeds 40% derived content.
The Python package manages RAM disks across platforms.
Windows (run as Administrator):
python -m ram_disk_manager init --disk-path ./data --size 512
python -m ram_disk_manager status
python -m ram_disk_manager sync --disk-path ./data --direction to-disk
python -m ram_disk_manager destroy --disk-path ./dataLinux/macOS (with venv activated):
# Create RAM disk (requires sudo with full python path)
sudo $(which python) -m ram_disk_manager init --disk-path ./data --size 512
# These don't need sudo
python -m ram_disk_manager status
python -m ram_disk_manager sync --disk-path ./data --direction to-disk
python -m ram_disk_manager destroy --disk-path ./dataRAM disk creation requires elevated privileges (Admin on Windows, sudo on Linux/macOS).
Measured on a dedicated development machine. Your results will vary based on hardware, disk type, and system load.
| Operation | RAM Disk | Disk Only | Notes |
|---|---|---|---|
| Single read | <1ms | 2-5ms | RAM path uses tmpfs/ImDisk/diskutil |
| Single write | 3-8ms | 2-5ms | Dual-write: disk first, then RAM |
| Search (100 results) | 5-15ms | 10-30ms | SQLite LIKE query across layer |
| Decay sweep (1000 memories) | 50-150ms | 100-300ms | Batch UPDATE per layer |
| Component | Spec |
|---|---|
| CPU | AMD/Intel x64 (multi-core) |
| RAM | 16GB+ (512MB allocated to RAM disk) |
| Disk | NVMe SSD |
| OS | Ubuntu 22.04 / Windows 11 |
| Node.js | v20 LTS |
Performance numbers were measured using the following approach:
-
Read latency:
console.time/console.timeEndaroundbetter-sqlite3.get()calls on a database with 1,000+ rows. Median of 100 iterations, measured after database is warm (first query excluded). -
Write latency: End-to-end time for a
rememberoperation including dual-write (disk + RAM). Measured from tool handler entry to return, 100 iterations, median reported. -
Search latency:
recalltool withLIKEquery matching ~100 results across a layer with 1,000+ memories. Median of 50 iterations. -
RAM disk vs disk: RAM disk performance assumes tmpfs (Linux), ImDisk (Windows), or diskutil (macOS) is mounted and
CASCADE_RAM_PATHis set. Without RAM disk, all operations use disk path only.
Run the server with DEBUG=true to see per-operation timing in structured logs:
DEBUG=true node server/index.jsEach tool invocation logs its duration in the audit trail. For systematic benchmarking, use the MCP client to issue repeated tool calls and collect the durationMs field from audit log entries.
Check that npm install completed successfully. Missing dependencies cause silent failures.
- Verify server runs standalone:
node server/index.js - Check paths in config are absolute, not relative
- Restart Claude Desktop after config changes
- Check Claude Desktop logs for MCP connection errors
SQLite doesn't handle concurrent writes. Solutions:
- Ensure only one CASCADE instance runs per database
- Kill zombie node processes:
taskkill /F /IM node.exe(Windows) orpkill node(Linux/macOS)
RAM disk contents are lost on reboot. Ensure CASCADE_DB_PATH points to persistent storage. The dual-write system writes to both locations, but you need the disk path configured.
Older versions (< 2.1.0) used the sqlite3 npm package, which required native compilation via node-gyp. This failed on ARM64 Windows due to missing prebuilt binaries.
v2.1.0 replaced sqlite3 with better-sqlite3, which ships prebuilt binaries for ARM64 Windows, x64 Windows, Linux, and macOS. Run npm install on v2.1.0+ and it works.
- Windows: ImDisk driver required. The manager installs it automatically, but you need Admin rights.
- Linux: tmpfs is kernel built-in. Just need sudo.
- macOS: diskutil is built-in. Just need sudo.
- Documentation: cipscorps.io
- Support: support@cipscorps.io
- Bug Reports: Include CASCADE version, OS, and error output
MIT License. See LICENSE for terms.
Made by CIPS Corp
Website | Store | GitHub | glass@cipscorps.io
Enterprise cognitive infrastructure for AI systems: PyTorch Memory, Soul Matrix, CMM, and the full CIPS Stack.
Copyright (c) 2025-2026 C.I.P.S. LLC