Mcp Memento

io.github.annibale-x由 GitHub 账号 annibale-x 发布v0.2.31更新于 Oct 24, 2026

An MCP server that provides persistent memory and context management across sessions

概览

AI 生成的概览

为 AI 助手提供基于本地 SQLite 的长期记忆,使其能跨会话和项目保存并回忆解决方案、决策与事实。

可以做什么
Memento 为 MCP 客户端提供持久记忆工具:store_memento 可按类型(解决方案、事实、决策)保存条目并附带标签和重要性,recall_mementos 与 search_mementos 则通过自然语言查询或标签检索。它还带有置信度机制,未使用的记忆会逐月衰减,安全相关记忆受保护,并提供包含 35 种关系类型的关系图谱来连接相关知识。工具按 core、extended、advanced 三种配置分组,分别包含 13、17、25 个工具。
适用场景
适合希望助手在不同会话、不同 IDE 与命令行代理之间记住修复方法、配置细节或架构决策的场景。也适合开发者构建随时间积累的个人或共享知识库。它不是自主代理:除非你或预设规则要求助手保存,否则不会存储任何内容。
运行要求
作为本地 Python 包通过 stdio 运行(pipx 或 pip install mcp-memento);未声明需要账号、API 密钥或网络访问。配置可选,可通过命令行参数、MEMENTO_PROFILE 和 MEMENTO_DB_PATH 等环境变量或 YAML 文件设置;默认数据库为本地 SQLite 文件。
安装前请注意
它会写入本地 SQLite 数据库,保存的内容会持久存在,任何能访问该文件的人都能读取。README 说明多个用户可共享同一数据库(例如放在网络存储上),并指出远程部署没有租户隔离,所有客户端看到相同数据。README 还提醒部分 YAML 配置段只是占位、当前无效,且项目处于 beta 阶段,配置 API 可能变化。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Memento,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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

🌱 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

ProfileToolsBest For
Core13 toolsAll users - Essential operations
Extended17 toolsPower users - Statistics, contextual search, decay control
Advanced25 toolsAdministrators - 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

bash
# Install with pipx (recommended for MCP servers)pipx install mcp-memento
# Or with pippip 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)

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

Method 2: Environment Variables

json
{  "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:

yaml
profile: extendeddb_path: ~/.mcp-memento/context.db

Then use minimal JSON config:

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

CLI Agents (Gemini CLI):

bash
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:

python
# Store solutions and knowledgestore_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 laterrecall_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:

PlatformConfiguration GuideNotes
Zed EditorIDE IntegrationNative MCP support
CursorIDE IntegrationAI-powered editor
WindsurfIDE IntegrationModern code editor
VSCodeIDE IntegrationVia MCP extension
Claude DesktopIDE IntegrationDesktop application
Gemini CLIAgent IntegrationGoogle's CLI agent
Claude CLIAgent IntegrationAnthropic's CLI agent
Python / MCP ClientPython IntegrationEmbed server or call via MCP client
Docker / CLIAPI & ProgrammaticMCP 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

python
# 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 filteringredis_solutions = search_mementos(tags=["redis"], memory_types=["solution"])

Manage Confidence

python
# Find potentially obsolete knowledgelow_confidence = get_low_confidence_mementos(threshold=0.3)
# Boost confidence after verificationboost_memento_confidence(    memory_id=verified_solution_id,    boost_amount=0.15,    reason="Verified in production deployment")

Create Relationships

python
# Link solution to problemcreate_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 knowledgerelated = 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 poolingAI: ✅ 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.shAI: ✅ 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)

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

    bash
    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.

KeyTypeDefaultDescription
db_pathstring~/.mcp-memento/context.dbSQLite database file path
profilestringcoreTool profile (core, extended, advanced)
logging.levelstringINFOLog level (DEBUG, INFO, WARNING, ERROR)
features.allow_relationship_cyclesboolfalseAllow 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):

yaml
db_path: ~/.mcp-memento/context.dbprofile: extendedlogging:  level: INFOfeatures:  allow_relationship_cycles: false

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

yaml
db_path: ~/.mcp-memento/global.dbprofile: extendedlogging:  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.

🔗 Links


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

来源:README.md,提交 39dee9e

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.31最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分