Memento
Memento is a local-first AI agent memory and intelligence middleware providing persistent memory, goal enforcement, and autonomous cognitive capabilities via a SQLite-backed temporal graph — at zero cloud cost.
Core Memory Operations
Store and retrieve memories using hybrid FTS5 + vector embedding search with Reciprocal Rank Fusion (RRF)
Add, consolidate, share, and evaluate memories across sessions and workspaces
Automatically inject relevant memories before every tool call
Project & Goal Management
Set and track project goals with multi-level enforcement (context injection, LLM alignment checks, file-watcher daemon)
Manage project state (vision, milestones, blockers) with key-value storage
Get project summaries including active goals and recent activity
Session Lifecycle
Begin, resume, and hand off sessions with full working memory snapshots
Auto-checkpoint every 25 tool calls with session diff tracking
Generate LLM-agnostic handoff prompts for transferring context between agents
Knowledge Graph
Build a Project Memory Graph with typed entities (files, components, decisions, bugs, features) and relationships (depends_on, blocks, implements)
Run impact analysis to see what breaks when something changes
Extract knowledge graph entries from existing memories automatically
Query cross-workspace stats for federated setups
Cognitive & Autonomous Features
Dream synthesis: Generate creative insights from memory patterns
Goal alignment: Evaluate code/plans against active goals
Spider-sense warnings: Detect anomalies and risks proactively
Auto-generate tasks from memory and goal analysis
Background autonomous agent with passive, active, and autonomous modes for consolidation, KG extraction, and drift detection
Active Coercion (Code Immune System)
Apply preset rule packs or define custom deterministic regex/tree-sitter rules
Block anti-patterns at commit time via git hooks — no LLM involvement
Configuration & Diagnostics
Configure enforcement levels, daemon, autonomy, schedulers, and dependency tracking
Health diagnostics: system status, memory stats, KG health, search quality, cache performance, and relevance reports
Manage proactive notifications for goal drift and anomaly alerts
Workspace & Dependency Tools
Audit dependencies to find unused (orphan) or undeclared (ghost) packages
Migrate memories across workspaces with deterministic heuristics
Full workspace isolation: each project gets its own
.memento/SQLite database with no context bleedingFederation: multiple workspaces can share a knowledge graph via Unix socket
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Mementoremember the deadline for project is next Monday"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Memento is a local-first, open-source MCP middleware that gives your AI agents (Cursor, Claude Desktop, Trae, etc.) persistent memory, proactive goal enforcement, and autonomous intelligence — all running on a zero-cost SQLite temporal graph with Reciprocal Rank Fusion (RRF) retrieval.
No cloud databases. No API calls for storage. Everything stays on your machine.
Architecture
Temporal Graph Memory (RRF)
Built on SQLite FTS5 (full-text search) and cosine similarity (vector embeddings). Fuses keyword matches and semantic meaning via Reciprocal Rank Fusion. WAL-mode enabled for concurrency.
Tri-State Goal Enforcer
Keep your AI aligned with project objectives at three escalation levels:
Level 1 — Context Injection: Automatically injects active goals into every search result. Active by default.
Level 2 — Strict Mentor: Forces the AI to submit code/plans for goal alignment evaluation via LLM.
Level 3 — Daemon Push: File-watcher monitors your workspace and proactively flags goal drift.
Active Coercion (Code Immune System)
Deterministic regex/tree-sitter rules that block anti-patterns at commit time and in the IDE. 100% deterministic — zero LLM hallucination risk during enforcement.
Autonomous Agent
Background cognitive loop with four levels:
off: No background behavior (default).
passive: Observe health and patterns every 5 min. No modifications.
active: Consolidate memories, extract KG, warm caches, detect anomalies every 2 min.
autonomous: All of the above plus dream synthesis, goal drift detection, task generation, health reports every 1 min.
Workspace Isolation
Each project gets its own .memento/ directory with an isolated SQLite database. No context bleeding between projects. Configure via MEMENTO_DIR or per-project .cursor/mcp.json.
Session Continuity
Auto-checkpoints every 25 tool calls with full L1 working memory snapshot.
Auto-resume restores goals and context from the previous session.
LLM-agnostic handoff prompts for session transfer between agents.
Project Memory Graph
Semantic entity-relationship graph on top of the Knowledge Graph. Track files, components, decisions, and their dependencies. Impact analysis shows what breaks when you change something.
Related MCP server: Memento
Unified Tool API (v0.3.x)
Memento exposes 14 action-based tools via MCP. Each tool uses an action parameter instead of separate tools per operation:
Tool | Actions | Purpose |
| (main router) | Primary proactive memory interface |
|
| Vision, milestones, blockers, goals |
|
| Session lifecycle and handoff |
|
| Project Memory Graph |
|
| FTS, vNext pipeline, routing trace |
|
| Memory write operations |
|
| All configuration |
|
| Cognitive engine operations |
|
| Diagnostics |
|
| Active Coercion management |
|
| Knowledge Graph operations |
|
| Proactive notifications |
| (standalone) | Dependency audit |
| (standalone) | Workspace memory migration |
Quick Start
Install
pip install memento-mcpOr run without installing:
uvx memento-mcpConfigure (Cursor / Claude Desktop / Trae)
Add to your global mcp.json (e.g. ~/.cursor/mcp.json):
{
"mcpServers": {
"memento": {
"command": "memento-mcp",
"env": {
"OPENAI_API_KEY": "your-api-key",
"OPENAI_BASE_URL": "https://api.openai.com/v1",
"MEM0_MODEL": "openai/gpt-4o-mini"
}
}
}
}For per-project workspace isolation, add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"memento": {
"command": "memento-mcp",
"env": {
"OPENAI_API_KEY": "your-api-key",
"OPENAI_BASE_URL": "https://api.openai.com/v1",
"MEM0_MODEL": "openai/gpt-4o-mini",
"MEMENTO_DIR": "${workspaceFolder}"
}
}
}
}Add .cursor/ to your .gitignore to avoid committing API keys.
Verify
memento-mcp --help
memento --helpSet MEMENTO_EMBEDDING_BACKEND=none to disable embeddings. Memento falls back to FTS5-only search — no API key needed.
MEMENTO_EMBEDDING_BACKEND=none memento-mcpEnvironment Variables
Variable | Default | Description |
| — | Required for OpenAI embeddings and cognitive features |
|
| OpenAI-compatible endpoint (e.g. OpenRouter) |
|
| LLM model for cognitive features |
|
| Embeddings model |
| auto-detect |
|
| cwd | Workspace root for |
|
| Enable local web UI ( |
|
| Local UI port |
| — | Auth token for local web UI |
|
| Require confirmation before applying coercion rules |
|
| Inject relevant memories on every tool call ( |
|
| Number of memories to inject proactively |
|
| Decay λ for semantic memories (~200d half-life) |
|
| Decay λ for episodic memories (~50d half-life) |
|
| Decay λ for working memories (~14d half-life) |
|
| Write |
|
| Auto-checkpoint frequency |
| — | Path to a shared KG SQLite file (federation — multiple workspaces share one graph) |
| — | Unix socket path for push notifications between agents (replaces 30s WAL polling) |
CLI Usage
Memento works from the terminal too:
# Auto-capture git context as a memory
memento capture --auto
# Save a free-form note
memento capture --text "Resolved auth timeout by increasing JWT expiry"
# Search memories
memento search "how did I fix the promise bug"
# Show workspace status
memento statusHow Proactivity Works
Memento operates at two levels:
Always-on (zero configuration)
Goal awareness: Every tool call is checked against active goals. If work drifts, a warning is appended.
Auto-resume: L1 working memory (goals, context) restores from the previous session's checkpoint.
Auto-checkpoint: Every 25 events, a full session snapshot is saved with project state and handoff prompt.
Session diff: Each checkpoint computes the delta from the previous session (goals changed, files touched).
Activatable (via memento_configure)
L2 enforcement: Goal alignment checks via LLM on explicit request.
L3 daemon: File-watcher with proactive goal drift notifications.
Autonomous agent: Background consolidation, KG extraction, dream synthesis, task generation.
Active coercion: Deterministic code pattern enforcement.
Consolidation/KG schedulers: Background deduplication and knowledge extraction.
Example activation sequence:
memento_project(action="set_goals", goals=["Implement auth flow", "Refactor DB layer"])
memento_configure(action="enforcement", level="level2", enabled=true)
memento_configure(action="consolidation_scheduler", enabled=true, interval_minutes=30)
memento_configure(action="autonomy", level="active")License
Memento is released under the GNU Affero General Public License v3.0 (AGPL-3.0). If you modify Memento and offer it as a network service, you must release your modified source code under the same license.
See LICENSE for details.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JoyciAkira/memento'
If you have feedback or need assistance with the MCP directory API, please join our Discord server