# Repository Briefing: Dataojitori/nocturne_memory
> Source: https://repoforai.com/repo/Dataojitori/nocturne_memory (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/Dataojitori/nocturne_memory
- **Official Docs / Website**: https://misaligned.top/memory
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A (85/100 · Maintenance 31/35 · Adoption 17/25 · Releases 17/20 · License 20/20)
- **Latest Release**: 2.5.6 (2026-08-09) — https://github.com/Dataojitori/nocturne_memory/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, Self-Hosted, MCP, API
- **Momentum**: 1,442 ★ total (+0 24h / +8 7d) · 177 forks
- **Topics**: `agentic-ai`, `ai-identity`, `ai-memory`, `artificial-intelligence`, `claude`, `claude-code`, `digital-soul`, `gemini-cli`, `llm`, `long-term-memory`, `mcp`, `mcp-server`
- **When to Use**: Best for: Self-hosted MCP agents that need to carry project decisions, preferences, or workflow notes across sessions and clients, with explicit addresses and human review of writes. Skip if: Your main requirement is semantic search over a large document corpus, hands-off memory extraction, or a feature roadmap that goes beyond maintenance.

## Overview
```text
### Architecture & Core Mechanics
Nocturne Memory separates the database, the agent interface, and the operator interface. A Python/FastAPI backend provides storage, a REST API, and snapshots using SQLite or PostgreSQL. Agents write through MCP over stdio, SSE, or Streamable HTTP; operators browse and edit a tree in a React/Vite/Tailwind CSS dashboard. The remote entrypoint, `backend/run_sse.py`, serves MCP, REST, and the dashboard in one process.

The tree is a view of a four-entity relational graph. A Node provides a stable UUID, Memory holds versioned content, a directed Edge carries priority and disclosure metadata, and a Path maps a `domain://path` address to an Edge. Aliases let different routes reach the same node without copying the body, and each route can carry different metadata. Namespaces separate agent memory spaces in a shared database; namespace-specific boot settings fall back to the global list if unset.

### Key Capabilities & Differentiators
Seven MCP tools cover reads, creation, updates, path deletion, aliases, trigger management, and keyword search across content and paths. `system://boot` returns configured startup memories; indexes, recent changes, and diagnostics are available through separate system URIs. Disclosure is a human-readable recall cue, not an access-control rule. Glossary triggers use Aho–Corasick matching to turn known terms in memory text into cross-links.

Updates use patch or append operations rather than whole-document replacement. Agent writes produce snapshots that an operator can inspect as diffs and accept or roll back. Path deletion removes an address, not the underlying text; old versions and orphaned memories have a separate, human-confirmed cleanup workflow. The store is not tied to a model provider: different MCP clients can reuse it, but their models need not interpret or use the same entries consistently.

### Trade-offs & Limitations
Compared with embedding-backed RAG, explicit URIs make reads predictable when the agent knows the address, and snapshots make writes easier to review. Keyword search is less suitable for fuzzy recall, paraphrases, or discovery across an unstructured corpus. There is no background summarizer to keep the store tidy: naming, granularity, and recall quality depend on how agents write and navigate memories, plus periodic human review. A short boot list limits initial context, not the size of later reads.

For a shared deployment, verify credential scope and namespace isolation before treating namespaces as a security boundary for mutually untrusted tenants. Long-lived, agent-writable content also warrants review before being reused as instructions. The project is MIT-licensed and now on a maintenance-only track, with feature development moving to Horon. Existing users have a memory migration path; greenfield deployments should weigh the cost of adopting a maintenance branch.

### Hardware & Deployment Guide
For a local install, use Python 3.10+, install `backend/requirements.txt`, and point the MCP client at `backend/mcp_server.py` for stdio. Node.js is needed to build the dashboard on first launch. For native remote hosting, `python backend/run_sse.py` defaults to port 8233 and serves `/sse`, `/mcp`, and the dashboard at `/`. Configure a bearer token before binding beyond loopback; for public access, put TLS in front of the service.

For Docker 24+ and Compose v2+, run `python scripts/setup_docker.py` to generate `.env` credentials before starting Compose. The stack uses PostgreSQL 16 Alpine with a readiness check and persistent database and snapshot volumes. Size storage for version and snapshot retention, and test restores rather than assuming a persistent volume is a backup. Release 2.5.4 added boot presets; 2.5.6 added MCP 2.0 Python SDK compatibility while retaining older SDK support, oversized-memory diagnostics, and ellipsis-based patch targeting.
```

## Key Capabilities
```text
- Addressing: `domain://path` resolves to a graph relationship, while a stable Node UUID survives content revisions.
- Write semantics: Patch and append edits preserve history; deleting a path unlinks it without erasing the memory body.
- Recall: Startup presets select what `system://boot` returns; keyword search and glossary links support on-demand lookup without embeddings.
- Review: The dashboard exposes snapshot diffs, rollback, and human-confirmed cleanup of old versions and orphaned entries.
- Integration: MCP supports stdio, SSE at `/sse`, and Streamable HTTP at `/mcp`; remote clients use bearer authentication.
- Storage: SQLite supports local use; Docker Compose pairs the backend with PostgreSQL 16 Alpine and persistent database and snapshot volumes.
```

## Quick Start / Clone
```bash
git clone https://github.com/Dataojitori/nocturne_memory.git
cd nocturne_memory
pip install -r backend/requirements.txt
```
