MemoryMesh

MemoryMesh

A universal, local-first MCP hub that indexes personal files (documents, code, etc.) and provides private semantic search via hybrid dense+BM25 retrieval, enabling agents like Claude Desktop to query your data without sending it to the cloud.

Category
访问服务器

README

MemoryMesh

Universal MCP hub for personal data. Local-first, private by default, designed to be the memory layer of the agents you'll build next.

CI PyPI License Python MCP Tests v0.1.0

MemoryMesh indexes your local files — and in future versions, your emails, calendar, browser history, and chat logs — and exposes them through the Model Context Protocol. Any MCP-aware client (Claude Desktop, Cursor, Claude Code, or your own agent) can ask semantic questions over the things you actually own, without sending a single byte to the cloud.

It is a hub, not a single-purpose RAG. The transport, embedding model, parser, and chunking strategy are all swappable behind clean interfaces — so the same hub can grow from "search my notes" to "remember everything for my Agent OS."


Why this exists

Personal data is fragmented across dozens of apps. No AI agent can reach all of it in a unified, private way. Anthropic's MCP defined the protocol; MemoryMesh fills the gap of the hub that wires everything up — locally, with privacy as a precondition rather than a setting.


How it works

                   ┌──────────────────────────────┐
  MCP clients ───▶ │         MemoryMesh           │
(Claude Desktop,   │  ┌────────────────────────┐  │
 Cursor, agents)   │  │ MCP Tools (FastMCP):   │  │
                   │  │  search_memory         │  │
                   │  │  list_sources          │  │
                   │  │  get_document          │  │
                   │  │  index_now             │  │
                   │  └──────────┬─────────────┘  │
                   │             ▼                 │
                   │     Search Engine             │
                   │   dense + BM25 → RRF          │
                   │             │                 │
                   │   ┌─────────┴──────────┐      │
                   │   ▼                    ▼      │
                   │ ChromaDB            BM25      │
                   │ (embeddings)     (sparse)     │
                   │   ▲                    ▲      │
                   │   └──────── Indexer ───┘      │
                   │                ▲              │
                   │           Watchdog            │
                   └────────────────┬──────────────┘
                                    ▼
                             Your filesystem

Indexing pipeline: file watcher detects changes → SHA-256 dedup skips unchanged files → parser (txt/md/pdf/docx/code) → smart chunker (tree-sitter for code, by-heading for markdown, recursive for text) → embeddings via sentence-transformers → upsert into ChromaDB + BM25 index.

Search pipeline: query → dense search (ChromaDB) + sparse search (BM25) over-fetch → Reciprocal Rank Fusion (k=60) → top-k results with path, preview, score, and metadata.


What makes it different

Most comparable tools pick one dimension to optimize. MemoryMesh is the only one that hits all of them simultaneously:

Feature MemoryMesh LangChain LlamaIndex PrivateGPT AnythingLLM MemGPT Haystack
MCP native
Hybrid search (dense + BM25 + RRF) Partial Partial
Real-time watcher + SHA-256 dedup
Post-crash reconciliation
100% local, zero telemetry
Cross-platform (Win/Linux/Mac) Partial Partial
No framework dependency
Designed as infrastructure

MCP native means it was built for MCP from day one — not bolted on after. The 4 tools (search_memory, list_sources, get_document, index_now) have a stable API that will not break across versions.

Designed as infrastructure means the architecture anticipates multi-agent access, per-agent permissions, and hardware agents (ESP32, Arduino) querying the same hub. See Roadmap.


Status

Feature Status
Local file indexing (txt, md, code, pdf, docx)
Hybrid search — dense + BM25 + RRF
MCP server — 4 tools, stdio + streamable-http
Real-time incremental indexing (watchdog + debounce)
Tree-sitter code chunking (Python, JS, TS, Go, Rust…)
Cross-platform — Windows / Linux / macOS
Post-crash reconciliation
Optional OCR for scanned PDFs (Tesseract / EasyOCR)
Privacy audit log (query hashes only, no cleartext)
172 tests — unit + integration
Parent Document Retriever (extended_preview) 🔜 v0.2
GitHub Actions CI (Ubuntu / Windows / macOS) 🔜 v0.2
Docker + docker-compose 🔜 v0.2
Cross-encoder reranker 🔜 v0.3
Evaluation framework (Precision@k, MRR, NDCG) 🔜 v0.3
RAG with local LLM (Ollama) 🔜 v0.4
Email / Calendar / Browser sources 🔜 v0.4
Per-agent permission layer 🔜 v0.5

Quickstart

Prerequisite: Python 3.11+ and uv.

# Install from PyPI
pip install memorymesh-mcp

Or clone for development:

# Clone and install
git clone https://github.com/kilhubprojects/memory-mesh.git
cd memory-mesh
uv sync

# Initialize state directory and copy example config
uv run memorymesh init

# Edit config.yaml — point it at the folders you want indexed
# (see Configuration section below)

# Index a folder
uv run memorymesh index ~/Documents

# Test a search
uv run memorymesh search "how did I configure the debounce"

Run as daemon (real-time indexing)

uv run memorymesh start --transport streamable-http --detach
uv run memorymesh status
# edit a file in one of your sources — it gets indexed within ~2s
uv run memorymesh search "the sentence you just typed"
uv run memorymesh stop

Wire it into Claude Desktop

Add to your Claude Desktop config:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "memorymesh": {
      "command": "uv",
      "args": [
        "run",
        "--directory", "/absolute/path/to/memory-mesh",
        "memorymesh", "serve", "--stdio"
      ]
    }
  }
}

Restart Claude Desktop. The four tools appear automatically.


MCP Tools

Tool Description
search_memory(query, top_k, mode, source) Hybrid search over all indexed content. Returns path, preview, score, file type, and source.
list_sources() List all configured sources with file counts and index status.
get_document(path, max_bytes) Read the full content of an indexed file (up to 1 MB by default).
index_now(path) Force immediate re-index of a file or directory, bypassing the watcher.

All tools are backwards-compatible. The v0.1 signatures are frozen — adding extended_preview in v0.2 is additive, not breaking.


Configuration

Everything lives in config.yaml. See config.example.yaml for a fully commented reference. Key highlights:

sources:
  - name: documents
    path: ~/Documents
    recursive: true
    extensions: [.txt, .md, .pdf, .docx]

  - name: projects
    path: ~/Projects
    recursive: true
    extensions: [.py, .js, .ts, .go, .rs, .md]

embeddings:
  model: all-MiniLM-L6-v2   # swap to paraphrase-multilingual-MiniLM-L12-v2 for PT/EN

search:
  mode: hybrid               # hybrid | dense | sparse
  top_k: 10

server:
  transport: stdio           # stdio | streamable-http

Global ignore list protects sensitive paths by default: .env, *.key, id_rsa*, secrets/, .ssh/, .aws/, .git/, node_modules/.


Benchmarks

Benchmarks will be published here after v0.2 lands CI across all three platforms. The goal is reproducible numbers — not "fast on my machine."

Scripts are already in benchmarks/ and runnable locally:

  • bench_indexing.py — indexing throughput (chunks/s, MB/s) on a synthetic corpus
  • bench_search_latency.py — p50/p95/p99 search latency across hybrid/dense/sparse modes
  • bench_embedding_models.py — speed vs. quality comparison across three embedding models

Privacy & security

Three hard commitments that do not change across versions:

  1. No data leaves your machine. No telemetry. No external API calls unless you explicitly opt in — and even then, there is a WARNING in the log.
  2. HTTP listener binds to 127.0.0.1 only by default. Exposing to other interfaces requires an explicit config override.
  3. Logs never contain document content or queries in cleartext. The audit log records query hashes, not queries.

Encryption at rest is on the roadmap. If your disk is encrypted at the OS level, you are covered for the threat model MemoryMesh is designed against.


Roadmap

Version Focus ETA
v0.2 Security hardening + CI/CD + Parent Document Retriever soon
v0.3 Eval framework (Precision@k, MRR) + reranker + query expansion
v0.4 Local LLM via Ollama (full RAG) + email/calendar sources
v0.5 Per-agent permissions + hierarchical memory (hot/warm/cold)
v1.0 Agent OS integration — memory layer for multi-agent systems ~6 months
v2.0 Hardware agents — ESP32/Arduino querying the hub over BLE/WiFi ~12 months

Full details in ROADMAP.md.


Troubleshooting

  • UnicodeDecodeError on a text file — MemoryMesh tries UTF-8, UTF-8 BOM, cp1252, latin-1 in order. If a file still fails, it is logged and skipped, not crashed.
  • Watcher doesn't fire on a network drive / WSL mount — set watcher.use_polling: true in config.yaml.
  • Tesseract not found — install it system-wide and ensure it is in PATH. Windows: UB-Mannheim installer.
  • Embedding model mismatch after changing config — run memorymesh reindex --all. The CLI refuses to start if the model ID stored in ChromaDB does not match the config.

About this project

MemoryMesh is a solo project by Carlos, a high school student (3rd year, STEM) from Brazil, aiming for mechanical engineering at MIT.

It was built using vibe coding — writing code in tight collaboration with LLMs at high speed — with structured architectural reviews at each phase. The process: LLM proposes code, architect reviews for correctness, design gaps, and spec violations, test suite confirms. Bugs that slipped through (startup order in the reconciliation system, BM25 encapsulation violation, wrong constructor kwargs in the CLI) were caught in review before they ever ran in production.

This is what vibe coding looks like when you take the review step seriously: a 172-test suite, a real hybrid search pipeline, a reconciliation system, and an architecture designed to carry forward into an Agent OS — built by one person, in high school, in a few weeks.

Other projects by Carlos: a J.A.R.V.I.S.-style voice assistant, a robot with hybrid AI (PC + Arduino + micro:bit via Bluetooth), and a trading simulator with RandomForest + PyQt5.


Contributing

MemoryMesh is not yet accepting external contributions — there is no CI or contribution guide in place yet. This changes in v0.2. Watch the repo or check back then.


License

MIT. See LICENSE.


Acknowledgements

Architecture informed by studying LlamaIndex, LangChain, PrivateGPT, AnythingLLM, MemGPT, and Haystack — understanding what each does well and what it does not. And to chroma-mcp and the MCP Python SDK for showing what MCP-native looks like in practice.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选