rei-memory-mcp
rei-memory-mcp
只读 MCP 服务器,允许 Rei / Claude 通过全文搜索、ID 或 STEP 查询 Rei-AIOS SEED_KERNEL(截至 2026-08-19 已有 1,677+ 条理论)。
第一阶段 — 只读。 不通过 MCP 工具暴露任何写入路径。数据摄取是一次性脚本;理论新增和晋升属于第二阶段(seed_propose 暂存表)。
设计原则
三层分类法(proven / hypothesis / speculative)是必填的 schema 字段。没有层级的理论无法被摄取。流行病卫生纪律由 schema 强制执行,而非依赖人工注意。
Related MCP server: Ek-Chuah MCP
工具
工具 | 用途 |
| 对 title+body 进行 FTS5 全文搜索。使用 Trigram 分词器支持日语。 |
| 完整正文 + 扇出链接( |
| 按 STEP 统计数量 + 层级分布。当前 SEED_KERNEL 中仅约 ~3% 的行带有 STEP 标记;其余归入 |
环境搭建
需要 Python 3.11+ 和 SQLite 3.34+(用于 FTS5 trigram 分词器 — 随 Python 3.11+ 一起提供)。
# from repo root
python -m venv .venv
.venv/Scripts/activate # Windows
source .venv/bin/activate # Unix
pip install -e '.[dev]'构建数据库
SEED_KERNEL 以 TypeScript 源码形式存在于 rei-aios/src/axiom-os/seed-kernel*.ts 中。将其导出为 JSONL,然后摄取:
# 1. dump (run inside the rei-aios repo; script is bundled there)
cd path/to/rei-aios
npx tsx scripts/dump-seed-kernel-json.ts > /path/to/rei-memory-mcp/data/seed-kernel-dump.jsonl
# 2. ingest into SQLite
cd path/to/rei-memory-mcp
python scripts/ingest.py \
--input data/seed-kernel-dump.jsonl \
--db data/seed_kernel.dbdata/*.jsonl 和 data/*.db 均已被 gitignore — 按需重新生成即可。
运行 MCP 服务器
# stdio transport (default)
python -m rei_memory_mcp.server
# or via console script:
rei-memory-mcp数据库路径从 REI_MEMORY_DB 环境变量读取(默认:./data/seed_kernel.db)。
Claude Desktop 配置
添加到你的 Claude Desktop MCP 设置中(调整路径):
{
"mcpServers": {
"rei-memory": {
"command": "python",
"args": ["-m", "rei_memory_mcp.server"],
"cwd": "C:/Users/user/rei-memory-mcp",
"env": {
"REI_MEMORY_DB": "C:/Users/user/rei-memory-mcp/data/seed_kernel.db"
}
}
}
}测试
pytest针对日语查询的测试(test_search.py::test_japanese_query_hits)是关键信号 — 如果该测试失败,说明 trigram 分词器已损坏,搜索将静默失效。
诚实的范围说明
只读。 刻意不提供任何写入型 MCP 工具。错误的记忆不应有快速成形的路径。
Trigram 日语支持。 2 个或更少字符的查询将无法匹配日语文本(这是 trigram 分词器的工作方式)。请使用 3 个及以上字符的查询。
STEP 覆盖率。 当前 SEED_KERNEL 中仅约 ~3% 的条目在正文中嵌入了
STEP N标记。seed_list_steps会如实报告这一情况。id 形态。 当前 SEED_KERNEL 混合了三种 ID 模式(
T-\d+、invented-*、kebab-case 短横线命名)。三种均被接受;不做任何重塑。无向量搜索。 FTS5 trigram 是第一阶段完整的检索方案。如果事实证明它不够用,第二阶段可以在此基础上添加 embeddings — 而非替换。
路线图(未实现)
第二阶段 —
seed_propose暂存表 + 人工审批 → 晋升至theories。不会将直接写入theories暴露为工具。第三阶段 — 晋升历史表,使理论的演变轨迹(hypothesis → proven)本身成为一件产物。
第四阶段 — 基于访问次数的衰减用于排序。
immutable: true的行豁免;任何内容都不会被删除。
许可证
AGPL-3.0(附带商业双许可条款 — 参见 LICENSE)。与 rei-aios 主仓库保持一致。
急がず、ゆっくりと。種は育ちます。
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Read-only MCP server exposing a user ORANO library to their own AI agent.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Related MCP Servers
- AlicenseAqualityBmaintenanceAn MCP server that enables LLMs to pull-based search through Clawket's RAG repository for exploratory and conditional queries. It provides read-only access to search artifacts, tasks, and decisions via HTTP API.510 npmMIT
- FlicenseNot gradedqualityBmaintenanceRead-only MCP server that serves the Archivo Epistemico (epistemic graph), enabling AI to read and query the epistemic path autonomously via tools like search, get_via, resolve, and get_necesidad.-
- FlicenseNot gradedqualityCmaintenanceRead-only MCP server for querying an evidence-aware knowledge vault with temporal and provenance-aware data, supporting agent memory and semantic graph projections.-
- AlicenseAqualityCmaintenanceA read-only MCP server for discovering engineering work and reusable assets on Archimedes Market. It enables searching and retrieving public assets and bounties through natural language.4MIT