openmemkit
Click on "Deploy 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., "@openmemkit search my notes about the Apollo deployment"
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.
memory-mcp-openmemkit
File-native, dual-channel AI agent memory as an MCP server. / 文件原生、双通道检索的 AI 记忆 MCP 服务器。
English | 中文
English
openmemkit gives any MCP-compatible AI agent (Claude Desktop, Codex CLI, Cursor,
Cline, Continue, …) a persistent, queryable memory that lives in plain Markdown
files you own. The framework ships with no memory data of its own — every user
points it at their own memory directory and SQLite index.
Why openmemkit
File-native — memories are human-readable Markdown organised by domain and date.
grep, edit, and version-control them with git; no proprietary lock-in.Dual-channel search — SQLite FTS5 (trigram tokenizer, great for CJK and English) plus optional semantic embeddings (local
bge-small-zh, offline), fused with Reciprocal Rank Fusion. Short queries (<3 chars) auto-fall-back to LIKE.Audited writes — agents never edit
.mddirectly. They append to awrite_log; an explicitflush/applystep distributes entries according to a configurable whitelist. Every write is traceable.Zero mandatory dependencies — the core is pure Python standard library (
sqlite3,re,json). Semantic search is an optional extra.Two transports — stdio (for desktop agents) and HTTP/SSE (for remote/shared deployments), same engine, identical behavior.
Batteries-included CLI —
init,index,search,get,write,flush,stats,doctor,domain, and both servers.
Quick start
pip install memory-mcp-openmemkit
# 1. Create your OWN empty memory root (the framework ships no data)
openmemkit init
# 2. Point your agent at it (stdio), then ask it to remember things
openmemkit serveDefault locations (override with flags, env vars, or a TOML config):
What | Default |
Memory root |
|
SQLite index |
|
Config file |
|
MCP client configuration
stdio (Claude Desktop claude_desktop_config.json, Codex config.toml, etc.):
{
"mcpServers": {
"openmemkit": {
"command": "openmemkit",
"args": ["serve", "--root", "/path/to/your/memories", "--db", "/path/to/index.sqlite"]
}
}
}HTTP/SSE:
openmemkit serve-http --host 127.0.0.1 --port 8765
# SSE endpoint : http://127.0.0.1:8765/sse
# messages POST: http://127.0.0.1:8765/messages/<session>MCP tools
Tool | Purpose |
| Load |
| List domains with file counts |
| Search chunks; modes |
| Read one |
| List indexed files with chunk counts/mtime |
| Index statistics, domain distribution, write-log status, semantic coverage |
| Append an audited entry ( |
| Replace a |
| Move a |
| Show the audited change trail for a path (or the whole write log) |
| Distribute pending write-log entries to |
Semantic search (optional)
pip install "memory-mcp-openmemkit[semantic]"Then enable it via config ([semantic] enabled = true), env
(OPENMEMKIT_SEMANTIC=1), or --semantic on indexing. The default model
(BAAI/bge-small-zh-v1.5) downloads from HuggingFace on first use and runs fully
offline afterward. Swap in any backend by implementing the Embedder protocol and
calling openmemkit.embedder.register_backend().
Configuration
# openmemkit.toml
root = "~/.local/share/openmemkit/memories"
db_path = "~/.local/share/openmemkit/openmemkit.sqlite"
[search]
default_top_k = 60
default_mode = "hybrid" # keyword | hybrid | vector
min_fts_len = 3
[semantic]
enabled = false # flip to true after installing [semantic]
model = "BAAI/bge-small-zh-v1.5"
[write]
auto_apply_kinds = ["network_fetch", "task_history", "data_read", "data_written", "memory_note"]
top_level_files = ["MEMORY.md"]
[server]
host = "127.0.0.1"
port = 8765Resolution order: CLI flags > OPENMEMKIT_* env vars > TOML > built-in defaults.
CLI
openmemkit init [--force] # scaffold an empty memory root
openmemkit index [--semantic] [--incremental] # (re)build the search index
openmemkit search "query" [--domain web] [--mode hybrid]
openmemkit get notes/project.md
openmemkit list [--domain notes]
openmemkit write --kind memory_note --summary "..."
openmemkit rm notes/old.md [--summary "..."] # delete (moves to .trash/)
openmemkit update notes/x.md --file new.md # replace (archives old version)
openmemkit history [notes/x.md] [--json] # audited change trail
openmemkit flush # apply pending writes + reindex
openmemkit stats [--json]
openmemkit doctor [--fix] # integrity + index-drift check
openmemkit domain list|add|rm <name> [--force]
openmemkit backup [--output out.tar.gz] # snapshot memories + SQLite
openmemkit restore backup.tar.gz --yes # restore (moves current aside)
openmemkit prune --domain web --days 90 [--delete] [--dry-run]
openmemkit export --format jsonl|md [--out f] # bulk export
openmemkit serve # MCP stdio
openmemkit serve-http --host 127.0.0.1 --port 8765Management & data safety
Deletes are recoverable.
memory_delete/rmmove files to.trash/YYYY-MM-DD/and write atombstonerecord; nothing is hard-deleted.Updates are versioned.
memory_update/updatecopy the previous file to.archive/YYYY-MM-DD/and link log entries viaparent_id, sohistoryshows the full chain.Backup/restore.
backupproduces a tar.gz of yourmemories/tree plus a consistentVACUUM INTOSQLite snapshot (with amanifest.json);restoremoves the current state aside before replacing it, so it is reversible.Retention.
prunearchives (or with--deletehard-deletes) files older than per-domainretention_days, with--dry-runto preview.MEMORY.mdis protected from delete/update through the engine.
Security model
Agents only write through
memory_write→write_log; they cannot touch arbitrary files. Path traversal is rejected at read time.Auto-apply is whitelist-based. Kinds outside the whitelist stay
pendinguntil reviewed (CLIflushapplies configured auto-kinds).OPENMEMKIT_READONLY=1disables all writes — useful for sharing one memory root across multiple agents.The engine only reads beneath the configured
rootand writes todb_path. There is no telemetry and no network call other than the optional model download.
Development
git clone <repo> && cd memory-mcp-openmemkit
uv sync --extra dev
uv run pytest # 28 tests: chunker/search/write/CLI/stdio/HTTP
uv run openmemkit --versionLicense
MIT.
Related MCP server: mcp-memory
中文
openmemkit 为任何兼容 MCP 的 AI agent(Claude Desktop、Codex CLI、Cursor、Cline、
Continue 等)提供持久、可检索的长期记忆,记忆以你拥有的纯 Markdown 文件形式存储。
框架本身不携带任何记忆数据——每个用户都把它指向自己的记忆目录和 SQLite 索引。
特性
文件原生:记忆是人类可读的 Markdown,按域/日期组织,可 grep、可编辑、可 git 版本管理,无私有格式锁定。
双通道检索:SQLite FTS5(trigram 分词,中英文通吃)+ 可选语义向量(本地
bge-small-zh,完全离线),用 RRF 融合;<3 字短查询自动走 LIKE 兜底。审计式写入:agent 不直接改
.md,先写write_log,经flush/apply按白名单 分发,每条写入可追溯。零强制依赖:核心纯 Python 标准库(
sqlite3/re/json),语义检索为可选 extras。双 transport:stdio(桌面 agent)与 HTTP/SSE(远程/共享部署),同一引擎、行为一致。
完整 CLI:
init、index、search、get、list、write、rm、update、history、flush、stats、doctor、domain、backup、restore、prune、export, 以及两种 server。管理与安全:删除移入
.trash/(可恢复),更新归档旧版本到.archive/(版本链), 备份/恢复带清单,prune 按域保留期归档,MEMORY.md受保护。
快速开始
pip install memory-mcp-openmemkit
# 1. 创建属于你自己的空记忆库(框架不携带任何数据)
openmemkit init
# 2. 让 agent 以 stdio 方式接入
openmemkit serve默认路径(可用参数、环境变量或 TOML 配置覆盖):
项目 | 默认 |
记忆根目录 |
|
SQLite 索引 |
|
配置文件 |
|
客户端配置
stdio(Claude Desktop / Codex 等):
{
"mcpServers": {
"openmemkit": {
"command": "openmemkit",
"args": ["serve", "--root", "/你的/记忆目录", "--db", "/你的/index.sqlite"]
}
}
}HTTP/SSE:
openmemkit serve-http --host 127.0.0.1 --port 8765
# SSE:http://127.0.0.1:8765/sse
# 消息 POST:http://127.0.0.1:8765/messages/<session>语义检索(可选)
pip install "memory-mcp-openmemkit[semantic]"在配置中开启 [semantic] enabled = true,或设 OPENMEMKIT_SEMANTIC=1,或索引用
--semantic。默认模型 BAAI/bge-small-zh-v1.5 首次使用时从 HuggingFace 下载,之后完全
离线。实现 Embedder 协议并调用 register_backend() 即可接入任意向量后端。
开发
git clone <repo> && cd memory-mcp-openmemkit
uv sync --extra dev
uv run pytest许可证
MIT。
Available Tools
11 toolsmemory_bootstrapARead-onlyIdempotent
Call once at session start. Returns MEMORY.md rules, all domain indexes, environment paths, and semantic-search status. / 会话开始时调用一次。返回 MEMORY.md 规则、全部域索引、环境路径与语义检索状态。
Inputs: no named parameters.
memory_deleteA
Delete a .md file by moving it to .trash/ (recoverable) and recording a tombstone in the audit log. Refuses MEMORY.md. / 删除 .md 文件:移入 .trash/(可恢复)并写 tombstone 审计记录。禁止删除 MEMORY.md。
Inputs: path (required), agent, summary.
memory_domainsARead-onlyIdempotent
List memory domains with their .md file counts. / 列出记忆库各域及其 .md 文件数量。
Inputs: no named parameters.
memory_flushA
Trigger immediate distribution of pending write_log entries to .md files, then reindex. / 触发立即分发 pending 条目到 .md 文件并重建索引。
Inputs: no named parameters.
memory_getARead-onlyIdempotent
Read a single .md file by path (relative to memory root). Top-level MEMORY.md by bare name; domain files like web/2026-08-20.md. / 按 path 精读单个 .md 文件。顶层 MEMORY.md 用裸名;域文件如 web/2026-08-20.md。
Inputs: path (required), max_chars.
memory_historyARead-onlyIdempotent
Show the audited change history for a path (or the whole write_log). / 查看某路径(或整个 write_log)的审计变更历史。
Inputs: path, limit.
memory_listBRead-onlyIdempotent
List indexed files with domain, chunk count, mtime. Supports domain filter and limit. / 列出已索引文件,含域、chunk 数、修改时间;支持域过滤与限量。
Inputs: limit, domain.
memory_searchARead-onlyIdempotent
Search memory chunks. mode: keyword (FTS5/LIKE, default for short queries), hybrid (keyword + vector RRF fusion, default), vector (pure cosine). Filter by domain/date_range. / 检索记忆正文。mode=keyword(关键字)、hybrid(关键字+向量融合,默认)、vector(纯向量);支持域/日期过滤。
Inputs: query (required), mode, top_k, domain, +3 more.
memory_statsARead-onlyIdempotent
Return index statistics: chunk count, per-domain distribution, write log status, semantic coverage, db size. / 返回索引统计:chunk 数、域分布、write_log 状态、语义覆盖、数据库体积。
Inputs: no named parameters.
memory_updateA
Replace the content of an existing .md file. The previous version is archived under .archive/ and the change is recorded in the audit log. Refuses MEMORY.md. / 替换已有 .md 文件内容;旧版本归档到 .archive/,变更记入审计日志。禁止更新 MEMORY.md。
Inputs: path (required), content (required), agent, summary.
memory_writeA
Append to the audited write_log (does NOT modify .md directly). network_fetch entries auto-apply to web/ on flush; other kinds are distributed per config. / 写入审计式 write_log(不直接改 .md)。network_fetch 类条目在 flush 时自动落 web/,其余按配置分发。
Inputs: kind (required), summary (required), agent, domain, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
memory_domains, memory_list, and memory_stats all return overlapping inventory/index information, which could cause misselection. memory_update and memory_write also both suggest writing, though they target different backends; the descriptions help, but boundaries are not always obvious.
All tools share the memory_ prefix and most follow a verb-oriented pattern like search, get, list, update, delete, write, and flush. A few noun-style names such as domains, stats, and history deviate slightly, but the overall convention remains predictable.
11 tools is well within the ideal range for a memory-management server. Each major operation—bootstrap, read, search, list, stats, update, delete, history, write, and flush—has a dedicated tool without excessive fragmentation.
The set covers session bootstrap, reading/searching, metadata inspection, update/delete, audit history, and the write_log flush pipeline. Minor gaps exist: delete is described as recoverable but no restore tool is exposed, and there is no direct create-file operation apart from the write_log/flush path.
Maintenance
Related MCP Connectors
Shared Markdown memory for your agents: docs, typed collections, files, skills and Dispatch.
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Portable AI memory shared across models and harnesses - plain markdown you own.
Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
Related MCP Servers
- AlicenseAqualityBmaintenanceA local-first shared memory layer for MCP-aware agents like Claude, Codex, and Hermes, enabling persistent memory across chats and clients via Markdown files and SQLite FTS.62MIT
- AlicenseAqualityBmaintenanceProvides AI agents with persistent, long-term memory via OKF-formatted markdown and SQLite indexing, enabling stateful storage, retrieval, and search across sessions.6223MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to capture, structure, remember, and retrieve source-backed memory as local Markdown files, with reviewable writes and no cloud dependency.218MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to write, search, browse, link, consolidate, and promote layered Markdown-backed memories with SQLite FTS5 indexing, rule checks, and optional semantic retrieval across projects.1Apache 2.0