代码记忆宫殿 是 AI Skill Hub 本期精选MCP工具之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
离线优先的AI代码记忆工具,通过LanceDB向量数据库自动挖掘和索引本地代码库,为开发者提供智能代码理解和检索能力。适合需要快速理解大型项目结构的开发者和AI编程助手用户。
代码记忆宫殿 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
离线优先的AI代码记忆工具,通过LanceDB向量数据库自动挖掘和索引本地代码库,为开发者提供智能代码理解和检索能力。适合需要快速理解大型项目结构的开发者和AI编程助手用户。
代码记忆宫殿 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/rergards/mempalace-code
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"------": {
"command": "npx",
"args": ["-y", "mempalace-code"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 代码记忆宫殿 执行以下任务... Claude: [自动调用 代码记忆宫殿 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"______": {
"command": "npx",
"args": ["-y", "mempalace-code"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<img src="assets/mempalace_banner.jpg" alt="mempalace-code" width="640">
mempalace-code backup schedule --freq daily # daily at 03:00 mempalace-code backup schedule --freq weekly # weekly on Sunday at 03:00 mempalace-code backup schedule --freq hourly # every hour
mempalace-code init <dir> # initialize rooms mempalace-code init <dir> --detect-entities # optional prose entity bootstrap
```bash uv tool install mempalace-code # recommended (fast, Rust-based)
mempalace-code init <dir> is config-first by default: it detects rooms from the directory structure and does not scan file contents for names. Add --detect-entities only when the directory contains prose where people or project names matter, such as meeting notes, client notes, personal notes, or conversation exports:
mempalace-code init ~/notes --detect-entities # prompts to confirm detected people/projects
mempalace-code init ~/notes --detect-entities --yes # auto-accept entity confirmation (no room prompts)
The detector is a lightweight bootstrap step, not the main miner. It samples up to 10 readable files, prefers prose files (.md, .txt, .rst, .csv), reads the first 5 KB of each sampled file, and looks for heuristic signals such as Alice said, thanks Bob, Apollo repo, deploy Apollo, or import Apollo. Confirmed results are written to <dir>/entities.json:
{
"people": ["Alice", "Bob"],
"projects": ["Apollo"]
}
Use it for human/project context. Leave it off for normal code repos unless their docs contain the entities you want captured. Full-repo scanning would be slower and noisier: class names, packages, examples, and variables often look like people or products to a heuristic pass. Code structure, symbols, languages, and architecture relationships are handled by mempalace-code mine, not by entity detection.
export MEMPALACE_WATCH_DISK_MIN_FREE_BYTES=2GiB # watcher-specific floor export MEMPALACE_DISK_MIN_FREE_BYTES=1GiB # global floor (watcher + backup)
{ "disk_min_free_bytes": 1073741824, // 1 GiB global default "watch_disk_min_free_bytes": 2147483648, // 2 GiB for watcher specifically "backup_disk_min_free_bytes": 2147483648 // 2 GiB for backups specifically } ```
MCP read/search behavior is not affected by a paused watcher — agents can still search the palace while the daemon waits for disk space.
---
mempalace-code version-check --check-now ```
How it works:
n records the opt-out permanently. Non-interactive (piped, CI, non-TTY) invocations never prompt.--check-now ignores the interval, contacts PyPI, and prints current/latest/error to stdout.https://pypi.org/pypi/mempalace-code/json is contacted. No telemetry, no user IDs, no installed-package inventory.Environment overrides:
| Variable | Effect |
|---|---|
MEMPALACE_VERSION_CHECK=1 | Force-enable (overrides config and state) |
MEMPALACE_VERSION_CHECK=0 | Force-disable (overrides config and state) |
MEMPALACE_VERSION_CHECK_INTERVAL_HOURS=N | Override interval (default: 168) |
Setting MEMPALACE_VERSION_CHECK=0 in a CI pipeline guarantees no network calls regardless of any saved preference.
---
mempalace-code version-check --enable
This is a code-first fork of milla-jovovich/mempalace. We inherited the good parts — the palace metaphor, the MCP integration, the LongMemEval harness — and rebuilt what was broken. Every claim here is backed by code, tests, and documented benchmarks.
| Upstream | This fork |
|---|---|
| ChromaDB — [silently deletes data on version bump](https://github.com/milla-jovovich/mempalace/issues/469) | LanceDB — crash-safe Arrow storage, no version-cliff |
| "No internet after install" — [false](https://github.com/milla-jovovich/mempalace/issues/524) | mempalace-code init downloads model explicitly; offline after model setup |
| "100% R@5" — [unverifiable](https://github.com/milla-jovovich/mempalace/issues/27) | Number removed. Methodology caveats documented |
| ~30% test coverage | 2025 tests, every feature acceptance-gated |
| No backup, no recovery | backup / restore / export / import |
| No incremental mining | Content-hash incremental: only changed files re-chunked |
| No code-search | code_search — filter by language, symbol, glob |
| Line-count chunking | Language-aware mining: tree-sitter AST for supported grammars, regex structural chunking, YAML-aware Kubernetes/Helm/Ansible splits, prose sections, and adaptive chunks for configs/data |
Full audit: docs/UPSTREAM_HARDENING.md.
---
| Project size | Median | Mean | P95 | Peak |
|---|---|---|---|---|
| Small (555 chunks) | **13x** | 19x | 42x | 59x |
| Large (19k chunks) | **80x** | 129x | 279x | **595x** |
Token savings scale with project size — grep noise grows linearly (more files contain the keyword), while mempalace-code search stays constant (top-5 semantically relevant chunks regardless of corpus size). These numbers are from a 19k-chunk project; larger codebases would push the ratios higher.
创新的离线MCP工具,结合向量数据库实现本地代码挖掘,架构清晰。但项目年轻,生态成熟度待验证,适合尝鲜用户。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,代码记忆宫殿 在MCP工具赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | mempalace-code |
| 原始描述 | 开源MCP工具:Offline-first AI memory for coding — mine codebases into a local LanceDB vector 。⭐15 · Python |
| Topics | MCP工具代码分析向量数据库离线AI开源 |
| GitHub | https://github.com/rergards/mempalace-code |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-05-23 · 更新时间:2026-05-23 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端