Skip to main content
Glama

MCP Memento

Python Version License MCP Protocol Latest Release Beta

Intelligent memory management for MCP clients with confidence tracking, relationship mapping, and knowledge quality maintenance.

Memento is an MCP server that provides persistent memory capabilities across multiple platforms:

  • IDEs: Zed, Cursor, Windsurf, VSCode, Claude Desktop

  • CLI Agents: Gemini CLI, Claude CLI, custom agents

  • Programmatic Usage: MCP client (Python), Docker deployment, CLI export/import

  • Applications: Any MCP-compatible application

Build a personal or team knowledge base that grows smarter over time, accessible from all your development tools.

Table of Contents

Related MCP server: @contextable/mcp

🌱 A Gentle Introduction

What is Memento? Imagine you're solving a complex bug, figuring out a tricky configuration, or establishing a new coding pattern. Usually, you'd forget the details in a few weeks. Memento is a "long-term memory drive" for your AI assistant. It allows your AI to save these solutions, decisions, and facts so it can recall them instantly across different projects, even months later.

💡 The Agentic Mindset: A Guide for Traditional Developers If you are used to deterministic software (where things happen automatically because a script says so), interacting with AI agents requires a slight mental shift.

Memento is not an autonomous agent that watches your screen and magically decides what to remember. Instead, Memento is a toolbelt provided to your AI assistant (like Claude, Cursor, or Gemini).

  • The AI is the worker: It needs to be told when to use the toolbelt. Nothing is saved without explicit instruction or a pre-defined rule.

  • You are the manager: You control what gets stored. You can either tell the AI during a chat ("Save this database connection string"), or you can give the AI standard operating procedures (via system prompts or .cursorrules/CLAUDE.md files) so it knows to automatically save certain things, like bug fixes or architecture decisions.

How to build the habit:

  1. Start of session: Ask your AI, "What do we know about the authentication system?" to pull context.

  2. During work: When you fix a tricky issue, say, "We fixed the Redis timeout. Store this solution."

  3. End of session: Tell your AI, "Store a summary of what we accomplished today."

Alternatively, you can add custom instructions to your AI (see our Agent Configuration Guide) to make it automatically execute these steps without you having to ask every time.

✨ Key Features

🧠 Intelligent Confidence System

  • Automatic decay: Unused knowledge loses confidence over time (5% monthly)

  • Critical protection: Security/auth/API key memories never decay

  • Boost on validation: Confidence increases when knowledge is successfully used

  • Smart ordering: Search results ranked by confidence × importance

🔗 Relationship Mapping

  • 35 relationship types: SOLVES, CAUSES, IMPROVES, USED_IN, etc. across 7 semantic categories (see Relationship Types Reference)

  • Graph navigation: Find connections between concepts

  • Pattern detection: Identify recurring solution patterns

📊 Three Profile System

Profile

Tools

Best For

Core

13 tools

All users - Essential operations

Extended

17 tools

Power users - Statistics, contextual search, decay control

Advanced

25 tools

Administrators - Graph analysis

🗃️ Cross-Platform Storage

  • SQLite backend: Zero dependencies, local storage

  • Full-text search: Fast, fuzzy matching across all memories

  • Automatic maintenance: Confidence decay, relationship integrity

  • Shared database: Same database works across all integrations

🚀 Quick Start

1. Installation

# Install with pipx (recommended for MCP servers)
pipx install mcp-memento

# Or with pip
pip install mcp-memento

2. Basic Configuration

Memento supports multiple configuration methods. For clarity, we recommend using one method consistently:

Method 1: CLI Arguments (recommended - most explicit)

{
  "mcpServers": {
    "memento": {
      "command": "memento",
      "args": ["--profile", "extended", "--db", "~/.mcp-memento/context.db"]
    }
  }
}

Method 2: Environment Variables

{
  "mcpServers": {
    "memento": {
      "command": "memento",
      "args": [],
      "env": {
        "MEMENTO_PROFILE": "extended",
        "MEMENTO_DB_PATH": "~/.mcp-memento/context.db"
      }
    }
  }
}

Method 3: YAML Configuration File Create ~/.mcp-memento/config.yaml:

profile: extended
db_path: ~/.mcp-memento/context.db

Then use minimal JSON config:

{
  "mcpServers": {
    "memento": {
      "command": "memento",
      "args": []
    }
  }
}

CLI Agents (Gemini CLI):

gemini --mcp-servers memento

Note: The exact flag syntax depends on your Gemini CLI version. Refer to AGENT_CONFIGURATION.md for version-specific setup instructions.

3. First Steps

Once configured, your AI assistant can now:

# Store solutions and knowledge
store_memento(
    type="solution",
    title="Fixed Redis timeout with connection pooling",
    content="Increased connection timeout to 30s and added connection pooling...",
    tags=["redis", "timeout", "production_fix"],
    importance=0.8
)

# Find knowledge later
recall_mementos(query="Redis timeout solutions")

📌 Note: The code above represents MCP tool calls — instructions you give your AI assistant (Claude, Cursor, Gemini, etc.) to invoke Memento's tools. This is not a Python library you can import. For programmatic Python access see the Python Integration Guide.

💬 Natural Language: You can also interact with Memento through natural conversation. Just tell your AI assistant things like "Remember that..." or "Store this..." or "Memento..."- no code required.

📖 Core Concepts

For a deep dive into Memento's concepts (Confidence System, Tagging, Relationships), please read the comprehensive RULES.md and RELATIONSHIPS.md documentation.

🔗 Integrations

Memento works with all major development tools:

Platform

Configuration Guide

Notes

Zed Editor

IDE Integration

Native MCP support

Cursor

IDE Integration

AI-powered editor

Windsurf

IDE Integration

Modern code editor

VSCode

IDE Integration

Via MCP extension

Claude Desktop

IDE Integration

Desktop application

Gemini CLI

Agent Integration

Google's CLI agent

Claude CLI

Agent Integration

Anthropic's CLI agent

Python / MCP Client

Python Integration

Embed server or call via MCP client

Docker / CLI

API & Programmatic

MCP client, Docker, export/import

See also: Integration Overview for guidance on choosing the right integration.

🛠️ Basic Usage Examples

The examples below show the MCP tool calls that an AI assistant (Zed, Cursor, Claude, Gemini CLI, …) executes on your behalf when you ask it to remember or retrieve something. They are written in a Python-like pseudocode that mirrors the MCP tool interface — they are not a Python library you import directly.

To call these tools programmatically from Python, use the mcp client library. See Python Integration for a working example.

Store and Retrieve Knowledge

# Store a solution — the AI calls this tool when you say "remember this fix"
solution_id = store_memento(
    type="solution",
    title="Fixed memory leak in WebSocket handler",
    content="Added proper cleanup in on_close()...",
    tags=["websocket", "memory", "python"],
    importance=0.9
)

# Natural language search — called when you ask "what do you know about X"
results = recall_mementos(query="WebSocket memory leak", limit=5)

# Tag-based search — for precise filtering
redis_solutions = search_mementos(tags=["redis"], memory_types=["solution"])

Manage Confidence

# Find potentially obsolete knowledge
low_confidence = get_low_confidence_mementos(threshold=0.3)

# Boost confidence after verification
boost_memento_confidence(
    memory_id=verified_solution_id,
    boost_amount=0.15,
    reason="Verified in production deployment"
)

Create Relationships

# Link solution to problem
create_memento_relationship(
    from_memory_id=solution_id,
    to_memory_id=problem_id,
    relationship_type="SOLVES",  # See all 35 types in docs/RELATIONSHIPS.md
    strength=0.9,
    context="Connection pooling resolved the timeout issue"
)

# Explore connected knowledge
related = get_related_mementos(
    memory_id=solution_id,
    relationship_types=["RELATED_TO", "USED_IN"],
    max_depth=2
)

Natural Language Interaction (Chat-Based)

Memento works through natural language conversations. The AI assistant interprets intent and calls the appropriate tools automatically.

Store information:

User: Remember that we solved Redis timeout with connection pooling
AI: ✅ Memento stored - "Redis timeout solution: connection pooling"

Retrieve knowledge:

User: What do you remember about Redis timeout?
AI: Found 2 solutions: 1) Connection pooling... 2) Query optimization...

Using the "Memento" keyword:

User: Memento the deployment script is in /scripts/deploy.sh
AI: ✅ Memento stored - "Deployment script location: /scripts/deploy.sh"

The AI can also store important information automatically when configured with the guidelines in AGENT_CONFIGURATION.md.

⚙️ Configuration

Memento supports multiple configuration sources (in order of precedence):

  1. Command-Line Arguments (highest priority)

    memento --profile advanced --db ~/custom/path/memento.db --log-level DEBUG
  2. Environment Variables

    export MEMENTO_PROFILE="advanced"
    export MEMENTO_DB_PATH="~/custom/path/memento.db"
    export MEMENTO_LOG_LEVEL="DEBUG"
    export MEMENTO_ALLOW_CYCLES="false"   # Allow cycles in relationship graph
  3. YAML Configuration Files

    • Project config: ./memento.yaml in current directory (overrides global)

    • Global config: ~/.mcp-memento/config.yaml

Priority Order: CLI Arguments > Environment Variables > Project YAML > Global YAML > Defaults

  1. Default Values (lowest priority)

Supported YAML Keys

The following keys are read and applied by the configuration loader. Any other keys present in the YAML file are silently ignored.

Key

Type

Default

Description

db_path

string

~/.mcp-memento/context.db

SQLite database file path

profile

string

core

Tool profile (core, extended, advanced)

logging.level

string

INFO

Log level (DEBUG, INFO, WARNING, ERROR)

features.allow_relationship_cycles

bool

false

Allow cyclic relationships in the graph

Note: The memento.yaml template shipped with the project contains additional commented sections (confidence, search, performance, memory, fts, project). These are not yet implemented — they are aspirational placeholders for future releases and have no effect on the current server behaviour.

Example Configuration Files

Project configuration (./memento.yaml):

db_path: ~/.mcp-memento/context.db
profile: extended
logging:
  level: INFO
features:
  allow_relationship_cycles: false

Global configuration (~/.mcp-memento/config.yaml):

db_path: ~/.mcp-memento/global.db
profile: extended
logging:
  level: INFO

📚 Documentation Structure

Essential Guides

Integration Guides

Development & Advanced Topics

🏗️ Architecture Overview

Database Schema

Memento uses a unified SQLite schema accessible from all integrations:

  • Core tables: nodes (memory storage), relationships (directed graph)

  • Full-text search: nodes_fts — FTS5 virtual table for fast searching (falls back to LIKE-based search if FTS5 is unavailable)

  • Confidence tracking: Automatic decay with protection for critical memories

Consistent Behavior

The system works identically across all platforms:

  1. Same database: All tools access the same SQLite file

  2. Same confidence tracking: Updates from one tool reflected everywhere

  3. Same search ranking: Results ordered by confidence × importance

  4. Same relationship types: 35 semantic relationship types available everywhere

📜 Background

Memento is a simplified, lightweight fork of MemoryGraph by Gregory Dickson, optimized for MCP integration across IDEs and CLI agents.

The fork focuses on portability and token efficiency: it removes heavy dependencies (NetworkX, multi-backend storage, bi-temporal tracking, multi-tenant architecture) in favor of a SQLite-only backend with confidence-based decay and guideline-driven storage.

Team Collaboration & Remote Deployment

Multiple users can share a SQLite database (e.g., on network storage) using tagging conventions (team:[name], author:[name]). Memento can also run as a remote MCP server, though all clients share the same database without tenant isolation. See Team Collaboration guidelines for details.

For true multi-tenancy, use the original MemoryGraph project.

When to Choose MemoryGraph vs Memento?

  • Use Memento: For lightweight, cross-platform memory management in IDEs and CLI tools

  • Use MemoryGraph: For enterprise use cases requiring multi-tenancy, bi-temporal tracking, or custom backends

🙏 Acknowledgments

Memento is built upon the solid foundation of Gregory Dickson's MemoryGraph project. We're grateful for his pioneering work in memory management systems.

This fork maintains compatibility with MemoryGraph's core concepts while adapting them for the specific needs of MCP integration and modern development tooling. For users requiring the full power of MemoryGraph's advanced features, we recommend exploring the original project.

🧪 Beta Status

mcp-webgate is in beta. Core functionality is stable and the server is used in production, but the configuration API may still change before 1.0.

Feedback is very welcome. If something doesn't work as expected, behaves oddly, or you have a use case that isn't covered:

→ Open an issue on GitHub

Bug reports, configuration questions, and feature requests all help shape the roadmap.

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for detailed guidelines on:

  • Development setup and workflow

  • Code style and conventions

  • Testing requirements

  • Documentation standards

  • Pull request process

📄 License

MIT License - see LICENSE for details.


Need help? Check the documentation or open an issue on GitHub.

Available Tools

17 tools
adjust_memento_confidenceA

Manually adjust confidence of a relationship.

Use for:

  • Correcting confidence scores when you know a memory is valid/invalid

  • Setting custom confidence based on verification

  • Overriding automatic decay for specific cases

Examples:

  • adjust_memento_confidence(relationship_id="rel-123", new_confidence=0.9, reason="Verified in production")

  • adjust_memento_confidence(relationship_id="rel-456", new_confidence=0.1, reason="Obsolete after library update")

Confidence ranges:

  • 0.9-1.0: High confidence (recently validated)

  • 0.7-0.89: Good confidence (regularly used)

  • 0.5-0.69: Moderate confidence (somewhat outdated)

  • 0.3-0.49: Low confidence (likely outdated)

  • 0.0-0.29: Very low confidence (probably obsolete)

Inputs: relationship_id (required), new_confidence (required), reason.

apply_memento_confidence_decayA

Apply automatic confidence decay based on last access time.

Use for:

  • System maintenance to keep knowledge base fresh

  • Applying intelligent decay rules

  • Monthly confidence adjustment routine

Intelligent decay rules:

  • Critical memories (security, auth, api_key, password, critical, no_decay tags): NO DECAY

  • High importance memories: Reduced decay based on importance score

  • General knowledge: Standard 5% monthly decay (decay_factor=0.95)

  • Temporary context: Higher decay rate

Decay formula: monthly_decay = confidence × decay_factor^(months_since_last_access)

Minimum confidence: 0.1 (won't decay below this)

Returns:

  • Number of relationships updated

  • Summary of decay applied

  • Breakdown by memory type

Inputs: memory_id.

boost_memento_confidenceA

Boost confidence when a memory is successfully used.

Use for:

  • Reinforcing valid knowledge

  • Manual confidence increase for verified information

  • After successfully applying a solution

  • When verifying old information is still valid

Usage patterns:

  • After successfully applying a solution → boost its confidence

  • When verifying old information is still valid → boost confidence

  • When multiple team members confirm a pattern → boost confidence

Boost mechanics:

  • Base boost: +0.10 per access (capped at 1.0)

  • Additional boost for validation: +0.10 to +0.20

  • Maximum confidence: 1.0 (cannot exceed)

Inputs: memory_id (required), relationship_id, boost_amount, reason.

create_memento_relationshipA

Link two mementos with a typed relationship.

Common types: SOLVES (solution→problem), CAUSES (cause→effect), ADDRESSES (fix→error), REQUIRES (dependent→dependency), RELATED_TO (general)

EXAMPLES:

  • create_memento_relationship(from_memory_id="sol-1", to_memory_id="prob-1", relationship_type="SOLVES")

  • create_memento_relationship(from_memory_id="err-1", to_memory_id="fix-1", relationship_type="CAUSES", context="Config error caused timeout")

Optional: strength (0-1), confidence (0-1), context (description)

Inputs: from_memory_id (required), to_memory_id (required), relationship_type (required), strength, +2 more.

delete_mementoC

Delete a memento and all its relationships

Inputs: memory_id (required).

get_low_confidence_mementosA

Find memories with low confidence scores.

Use for:

  • Identifying potentially obsolete knowledge

  • Periodic cleanup and verification

  • Quality assurance of the knowledge base

  • Finding memories that need review

Features:

  • Filter by confidence threshold (default: < 0.3)

  • Shows relationships causing low confidence

  • Includes memory details and last access time

  • Sorted by confidence (lowest first)

Returns:

  • List of low confidence relationships with associated memories

  • Memory details for both ends of each relationship

  • Confidence scores and last access times

Inputs: threshold, limit.

get_mementoA

Retrieve a specific memento by ID.

Use when you have a memory_id from search results or store_memento. Set include_relationships=true (default) to see connected memories.

EXAMPLE: get_memento(memory_id="abc-123")

Inputs: memory_id (required), include_relationships.

get_memento_statisticsC

Get statistics about the memento database

Inputs: no named parameters.

get_recent_memento_activityA

Get summary of recent memento activity for session context.

Returns: memory counts by type, recent memories (up to 20), unresolved problems.

EXAMPLES:

  • get_recent_memento_activity(days=7) - last week's activity

  • get_recent_memento_activity(days=30, project="/app") - last month for specific project

Inputs: days, project.

memento_onboardingA

Get comprehensive onboarding protocol for Memento including tool usage guidance, retrieval flow optimization, and best practices.

MEMENTO ONBOARDING PROTOCOL:

  1. INITIALIZATION: Run memento_onboarding() at session start

  2. RETRIEVAL FLOW:

    • Fact Check: Use search_mementos(tags=[...]) for simple identity/known facts

    • Complex Tasks: Use recall_mementos(query="...") for dev/architecture context

    • Fallback: If search fails, fallback to recall

  3. AUTOMATIC STORAGE: Store via store_memento on git commits, bug fixes, version releases

  4. ON-DEMAND TRIGGERS: Store instantly when user says "memento...", "remember...", etc.

  5. MEMORY SCHEMA: Required tags (project, tech, category). Importance: 0.8+ (critical), 0.5 (standard)

OPTIMIZED RETRIEVAL (Avoid 6+ tool calls):

  • Target: 1-3 tool calls for simple info

  • Maximum: 5 tool calls for complex tasks

  • Follow decision tree: Known tags → search_mementos, Conceptual → recall_mementos

CRITICAL DISTINCTION: Memento vs Session memory

  • Memento: Long-term, cross-session, global scope

  • Session Memory: Temporary, project-specific, session-only

USE memento_onboarding(topic="...") for specific guidance:

  • "protocol": Full onboarding protocol

  • "retrieval_flow": Optimized retrieval guide

  • "distinction": Memento vs Session memory

  • "examples": Practical examples

  • "best_practices": Usage guidelines

Inputs: topic.

recall_mementosA

Primary tool for finding mementos using natural language queries.

Optimized for fuzzy matching - handles plurals, tenses, and case variations automatically.

BEST FOR:

  • Conceptual queries ("how does X work")

  • General exploration ("what do we know about authentication")

  • Fuzzy/approximate matching

USE FOR: Long-term knowledge that survives across sessions. DO NOT USE FOR: Temporary session context or project-specific state.

LESS EFFECTIVE FOR:

  • Acronyms (DCAD, JWT, API) - use search_mementos with tags instead

  • Proper nouns (company names, services)

  • Exact technical terms

EXAMPLES:

  • recall_mementos(query="timeout fix") - find timeout-related solutions

  • recall_mementos(query="how does auth work") - conceptual query

  • recall_mementos(project_path="/app") - memories from specific project

FALLBACK: If recall returns no relevant results, try search_mementos with tags filter.

Inputs: query (required), memory_types, project_path, limit, +1 more.

search_memento_relationships_by_contextC

Search memento relationships by their structured context fields (scope, conditions, evidence, components)

Inputs: scope, conditions, evidence, components, +3 more.

search_mementosA

Advanced search with fine-grained filters for precise retrieval of mementos.

USE THIS TOOL FIRST (not recall) when searching for:

  • Acronyms: DCAD, JWT, MCR2, API, etc.

  • Proper nouns: Company names, service names, project names

  • Known tags: When you know the tag from previous memories

  • Technical terms: Exact matches needed

PARAMETERS:

  • tags: Filter by exact tag match (most reliable for acronyms)

  • memory_types: Filter by type (solution, problem, etc.)

  • min_importance: Filter by importance threshold

  • search_tolerance: strict/normal/fuzzy

  • match_mode: any/all for multiple terms

NOTE: Tags are automatically normalized to lowercase for case-insensitive matching.

EXAMPLES:

  • search_mementos(tags=["jwt", "auth"]) - find JWT-related memories

  • search_mementos(tags=["dcad"]) - find DCAD memories by tag

  • search_mementos(query="timeout", memory_types=["solution"]) - timeout solutions

  • search_mementos(tags=["redis"], min_importance=0.7) - important Redis memories

For conceptual/natural language queries, use recall_mementos instead.

Inputs: query, terms, match_mode, tags, +7 more.

store_mementoA

Store a new memento with context and metadata.

Required: type, title, content. Optional: id, tags, importance (0-1), context.

USE FOR: Long-term knowledge that should survive across ALL sessions. DO NOT USE FOR: Temporary session state or project-specific context.

LIMITS:

  • title: max 500 characters

  • content: max 50KB (50,000 characters)

  • tags: max 50 tags, 100 chars each

  • id: if provided, must be unique string identifier

TAGGING BEST PRACTICE:

  • Always include acronyms AS TAGS (e.g., tags=["jwt", "auth"])

  • Fuzzy search struggles with acronyms in content

  • Tags provide exact match fallback for reliable retrieval

Types: solution, problem, error, fix, task, code_pattern, technology, command, file_context, workflow, project, general, conversation

Note: decision is not a standalone type — use type="general" with tags=["decision", "architecture"]. Note: pattern is not a standalone type — use type="code_pattern".

EXAMPLES:

  • store_memento(type="solution", title="Fixed Redis timeout", content="Increased timeout to 30s...", tags=["redis"], importance=0.8)

  • store_memento(type="error", title="OAuth2 auth failure", content="Error details...", tags=["auth", "oauth2"], id="custom-error-123")

Returns memory_id. Use create_memento_relationship to link related memories.

Inputs: type (required), title (required), content (required), id, +4 more.

update_mementoC

Update an existing memento

Inputs: memory_id (required), title, content, summary, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 17 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between recall_mementos and search_mementos, as both are for retrieval with nuanced differences (conceptual vs. precise). Tools like adjust_memento_confidence, boost_memento_confidence, and apply_memento_confidence_decay are clearly differentiated, focusing on manual adjustment, reinforcement, and automated decay respectively, minimizing confusion.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with a clear verb_noun structure (e.g., adjust_memento_confidence, create_memento_relationship, get_related_mementos). There are no deviations in naming conventions, making the set predictable and easy to parse.

    Tool Count4/5

    With 17 tools, the count is slightly high but reasonable for a memory management system covering storage, retrieval, relationships, confidence management, and statistics. It aligns well with the server's purpose, though it might feel a bit heavy compared to simpler domains.

    Completeness5/5

    The tool set provides comprehensive coverage for a memory management domain, including CRUD operations (store, get, update, delete), search and recall variants, relationship management, confidence handling, statistics, and onboarding. There are no obvious gaps; it supports full lifecycle management from creation to decay and retrieval.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      Not graded
      maintenance
      Provides long-term memory storage for AI assistants with semantic search, enabling persistent storage of preferences, decisions, and context with relationship tracking between memories.
      19
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A persistent AI memory server that enables storage and retrieval of context and project artifacts across conversations. It features full-text search, version history, and automatic content chunking using local SQLite or hosted cloud storage.
      15 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      A persistent memory server that stores and retrieves atomic coding insights like architectural decisions and debugging patterns for AI agents. It enables agents to maintain institutional knowledge across sessions using semantic search and local SQLite storage.
      22 npm
      11
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A local-first persistent memory server that provides AI agents with deterministic, multimodal information retrieval across different sessions and projects. It enables long-term memory continuity using a 5-signal hybrid search engine and cognitive reasoning loops designed for complex development workflows.
      1
      Apache 2.0