Logo MCP Local Memory

MCP Local Memory

Cộng đồng
Beledarian

A lightweight, powerful local memory server for AI agents supporting text, entities, and relations. Enables persistent codebase understanding and user preference management.

Nhà phát hànhBeledarian
Kho mãmcp-local-memory
Ngôn ngữTypeScript
Bản fork
5
Sao
56
Công cụ có sẵn
0
Phương thức truyền tảistdio
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    MCP Local Memory cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    56 sao và 5 bản fork từ kho mã được liên kết.

Local Memory MCP Server

A local-first MCP server that gives AI agents shared, durable memory through hybrid semantic search, SQLite FTS5, and a knowledge graph—without Docker or a required cloud service.

Local Memory MCP demo

Why use it?

  • Shared across agents: one SQLite database can serve Codex, Claude, desktop clients, IDE integrations, and custom MCP clients.
  • Hybrid recall: when sqlite-vec is available, local all-MiniLM-L6-v2 embeddings and FTS5 keyword evidence are merged. FTS remains available as the explicit fallback.
  • Temporal recall: search natural-language periods such as last week or in 2025, or pass an explicit ISO startDate and endDate.
  • Adaptive ranking: relevance, time-decayed importance, tags, and bounded recent familiarity work together without rewriting importance on every recall.
  • Auditable lifecycle: memories can be reinforced, marked outdated or incorrect, restored, exported, or forgotten.
  • Structured context: entities, relations, observations, conversations, tasks, and todos live beside free-form memories.
  • Local by default: memory data stays in your configured SQLite file. Optional LLM features send input only to the OLLAMA_URL you configure.

For every option and tool, see the extended guide.

Requirements

  • Node.js 22 or newer on a supported LTS release.
  • Python and C++ build tools when better-sqlite3 has no matching prebuild.
  • Windows users can install Desktop development with C++ through Visual Studio Build Tools.

Windows ARM64 semantic search is supported by a bundled, checksum-verified sqlite-vec v0.1.9 DLL. WSL2 remains a supported alternative.

Quick start

Add the published package to an MCP client:

json
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@beledarian/mcp-local-memory@2"],
      "env": {
        "ARCHIVIST_STRATEGY": "nlp"
      }
    }
  }
}

The default database is ~/.memory/memory.db. The first semantic recall may download the local embedding model.

Global installation provides both memory and mcp-local-memory:

bash
npm install -g @beledarian/mcp-local-memory@2
memory --help

From source:

bash
git clone https://github.com/Beledarian/mcp-local-memory.git
cd mcp-local-memory
npm install
npm run build
npm start

See the Codex + WSL2 setup when the database or server runs inside Linux.

Remote Server & Docker Deployment (SSE)

mcp-local-memory supports native HTTP/SSE transport for centralized setups across multiple workstations, laptops, Tailnets, or VPS instances:

bash
# Run standalone SSE server on port 8320 with optional Bearer token auth:
node dist/index.js --transport sse --port 8320 --token "your-secret-token"

# Or run via Docker Compose:
docker compose up -d

Configure your remote MCP client (mcp_config.json):

json
{
  "mcpServers": {
    "memory": {
      "url": "https://your-server.ts.net:8320/sse",
      "headers": {
        "Authorization": "Bearer your-secret-token"
      }
    }
  }
}

Essential configuration

VariableDefaultPurpose
MEMORY_DB_PATH~/.memory/memory.dbSQLite database location.
MCP_TRANSPORTstdiostdio (default) or sse (remote HTTP/SSE server).
PORT / MCP_PORT8320HTTP port when running in SSE mode.
MCP_AUTH_TOKENunsetOptional Bearer token for remote SSE authentication.
ARCHIVIST_STRATEGYnlppassive, nlp, llm, or a comma-separated combination.
OLLAMA_URLhttp://localhost:11434/api/generateOptional LLM generation endpoint.
MEMORY_SEMANTIC_WEIGHT0.9Retrieval relevance versus decayed importance.
MEMORY_MIN_RELEVANCE0.55Minimum relevance required before a candidate can be returned.
MEMORY_RECALL_FAMILIARITY_MAX_BOOST0.03Maximum temporary familiarity contribution; 0 disables future recording and scoring but does not purge existing rows.
MEMORY_RECALL_FAMILIARITY_WINDOW_DAYS30Recent exposure window.
USE_WORKERfalseRun archivist processing in a worker while retaining durable acknowledgement.
EXTENSIONS_PATHunsetDirectory containing opt-in JavaScript extensions.

All scoring, context, archivist, task, and extension variables are documented in the configuration reference.

How recall works

recall supports both topical and temporal questions:

  • Semantic vector and FTS5 keyword candidates are retrieved independently and merged, so an exact term is not hidden by a semantic result.
  • Natural-language dates such as yesterday, last week, and in 2025 are recognized in the query. ISO startDate and endDate filters are also available.
  • Weak matches are omitted, near-duplicates are collapsed, and outdated or incorrect memories stay hidden unless explicitly requested.
  • Relevant results are ranked using retrieval evidence, query coverage, tags, time-decayed importance, and a small recent-familiarity signal.
  • Each returned active memory can record one familiarity exposure per normalized-query hash and UTC day. The contribution is temporary and bounded to 0.03 by default; it does not rewrite importance or refresh decay.

reinforce_memory provides the stronger, durable feedback path:

  • used or important record positive evidence.
  • irrelevant lowers importance.
  • incorrect or outdated suppresses the memory without deleting history.
  • restore returns a suppressed memory to active recall.

The extended scoring guide documents the formula, thresholds, deduplication, privacy limits, decay, and every familiarity control.

Entities, relations, and the graph

Free-form memories and structured knowledge complement each other:

  • Entities represent people, projects, places, topics, or other named concepts. Each has a type, importance, and appendable observations.
  • Relations are directional triples such as Project A --[uses]--> SQLite. Creating a relation also creates any missing endpoint as an Unknown entity.
  • Automatic extraction can identify entities and relations while saving a fact. Use ARCHIVIST_STRATEGY=nlp for local extraction, llm for the configured Ollama endpoint, or passive for manual graph maintenance.
  • Graph exploration can return an overview or a centered one- or two-hop neighborhood with entity observations, relations, and related memories.
  • Graph maintenance supports renaming or deleting entities, removing exact observations, and deleting individual relations. Entity renames update connected relations.
  • Clustering groups semantically related memories and entities into topic overviews when embeddings are available.

Use recall for ranked free-form retrieval and read_graph when connections between named concepts matter. They are complementary views of the same local knowledge base.

MCP surface

AreaTools and resources
Memoryremember_fact, remember_facts, recall, reinforce_memory, list_recent_memories, forget, export_memories
Graphcreate_entity, update_entity, delete_entity, create_relation, delete_relation, delete_observation, read_graph, cluster_memories
Conversationsinit_conversation, add_task, update_task_status, list_tasks, delete_task
Todosadd_todo, complete_todo, list_todos
Optional extractionconsolidate_context when ENABLE_CONSOLIDATE_TOOL=true
Resourcesmemory://current-context, memory://turn-context, task and todo resources

See the complete tool reference for arguments and lifecycle behavior.

Upgrading safely

When upgrading from 1.x:

  • move to Node.js 22;
  • back up MEMORY_DB_PATH;
  • expect automatic additive schema migration;
  • note that MEMORY_SEMANTIC_WEIGHT now means relevance versus importance;
  • recall no longer raises importance or refreshes decay;
  • run importance normalization only if you want to reset historical passive popularity.

The project does not claim crash-proof, zero-loss migration under every interruption scenario, so a verified backup remains the safety boundary.

Older releases passively increased importance and access_count during recall. Preview normalization before changing anything:

bash
npm run normalize:importance -- --db ~/.memory/memory.db

Applying normalization is optional and requires an explicit, non-existing backup path. See the migration and normalization guide.

Documentation

Development

These commands require a source checkout:

bash
npm install
npm run build
npm test

npm test covers scoring, schema migration, lifecycle and familiarity, privacy/provenance, MCP contracts, packaging, and native vector or FTS fallback.

License

MIT

Dùng MCP MCP Local Memory với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối MCP Local Memory, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm MCP Local Memory làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của MCP Local Memory.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "mcp-local-memory": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của MCP Local Memory, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của MCP Local Memory.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng MCP Local Memory giúp tôi làm việc này không?
MCP Local Memory
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng MCP Local Memory.

Câu hỏi thường gặp

Máy chủ MCP MCP Local Memory dùng để làm gì?

MCP Local Memory là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP MCP Local Memory với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng MCP Local Memory với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP MCP Local Memory với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối MCP Local Memory, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP MCP Local Memory với TypingMind?

MCP Local Memory hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP MCP Local Memory cung cấp những công cụ nào trong TypingMind?

MCP Local Memory cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP MCP Local Memory không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu MCP Local Memory yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇