# 记忆梦境引擎 · AI 的睡眠系统

Simulates sleep cycles for agents: extracts facts without LLM calls, scores signals, and trims outdated entries via an Ebbinghaus decay curve.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 1
- Author: savantcat
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/savantcat/memory-dream-engine
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/savantcat-ai

## What it does

The server introduces a biological sleep cycle into persistent agent memory. Running every 180 minutes, it executes a five-stage pipeline: signal collection, scoring, writing, optimization, and idea sprouting. Fact extraction relies entirely on standard regular expressions across English and Chinese text without consuming model tokens. Retention follows an Ebbinghaus decay model with a 30-day half-life, letting unused notes fade into archives while repeated lookups reinforce memory weight.

The underlying logic in `server.py` exposes six MCP tools. Clients can trigger regex extraction with `extract_facts`, evaluate relevance via `score_signal`, inspect decay dynamics in `decay_report`, or run cycle tests using `simulate_dream`. Connections operate over standard input/output or streamable HTTP on port 8770.

The setup requires Python 3.9+ and the `mcp>=2.1` package. In cron jobs, agent sub-processes often run without memory write privileges, silently skipping stages three and four for items scored 70 or higher. That constraint requires scheduling periodic interactive sessions to flush the accumulated backlog.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- extract dialogue facts using regex without LLM token expenses
- trim obsolete agent memories along an Ebbinghaus decay curve
- score decision and correction signals before persistent storage
- detect clustered memory notes ready for article drafts

## Example prompts
- Run `extract_facts` on our recent chat to pull out confirmed decisions
- Check memory retention with `decay_report` to see what is ready for archival
- Use `score_signal` to determine whether this correction belongs in long-term memory

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
