# SleepSweet

> SleepSweet is an open-source memory hygiene and audit layer for AI agents: an offline engine plus local CLI and MCP server that deduplicates, resolves conflicts, flags stale facts, finds broken links and dead file paths, and quarantines suspicious entries in an agent's existing memory (CLAUDE.md, AGENTS.md, ~/.claude auto-memory, Cursor rules, Copilot instructions). It is not a memory store and does not do retrieval.

Quick start: `pip install sleepsweet && sleepsweet run` (or `uvx sleepsweet run`) — zero configuration. Commands: `run` scans (read-only), reports, asks once, then applies fixes with a live log; `report` shows the latest report (`--details`, `--json`); `diff` shows what changed in memory since the previous run; `undo` reverts applied fixes (`--to DATE` rolls back to a date); `asof DATE` shows what the agent knew then. Cleanup is non-destructive: history is marked, never deleted; every decision is journaled. Agents can run it themselves through MCP (`sleepsweet mcp`) and act as the conflict judge via tool round-trip — no API key or model configuration. Local-first: no telemetry, secrets redacted before storage.

- [README](https://github.com/sleepsweet/sleepsweet/blob/main/README.md): definition, quick start, science, safety guarantees
- [How it works](https://github.com/sleepsweet/sleepsweet/blob/main/docs/how-it-works.md): event-sourced journal, analyzers, patch policies, rename proof tiers
- [CLI reference](https://github.com/sleepsweet/sleepsweet/blob/main/docs/cli.md): commands, flags, environment variables, judge specs
- [MCP server](https://github.com/sleepsweet/sleepsweet/blob/main/docs/mcp.md): tools, judge round-trip, registration
- [Report schema](https://github.com/sleepsweet/sleepsweet/blob/main/docs/report-schema.md): stable JSON contract for agents
- [FAQ](https://github.com/sleepsweet/sleepsweet/blob/main/docs/faq.md): common questions, comparisons, privacy
- [Safety](https://github.com/sleepsweet/sleepsweet/blob/main/docs/safety.md): local-first, dry-run default, redaction, reversibility
- [Auditable Memory Record spec](https://github.com/sleepsweet/auditable-memory-record): which fields an auditable agent memory record carries, and why
- [memory-hygiene-bench](https://github.com/sleepsweet/memory-hygiene-bench): benchmark for the cost of degraded agent memory
