janbjorge/rekal 是一个从 https://github.com/janbjorge/rekal. 导入的 MCP 服务器候选
概览
janbjorge/rekal 是一个从 https://github.com/janbjorge/rekal. 导入的 MCP 服务器候选
概述(AI 翻译)
LLM的长期记忆。一个SQLite文件,没有云端,没有API密钥。
rekal 是一个 MCP 服务器,为 AI 编码代理在会话间提供持久内存。内存存储在本地 SQLite 中,并通过混合搜索(BM25 关键词 + 向量语义 + 近期衰减)检索。你的机器不会有任何信息流出。
工作原理 ·快速启动 ·安装 ·安装 ·更新 ·工具 ·底层 ·故障排除
支持任何支持 MCP 的代理:Claude Code、Codex CLI、OpenCode、Cursor CLI。
它是如何运作的
- 存储。 代理人保存一个持久事实,包含
memory_store:偏好、决定、非显而易见的发现。 - Index. rekal 将其写入 SQLite 并基于其构建两个索引:一个是 BM25 关键词索引,一个是 384 维向量嵌入,均在本地计算,无需网络调用。
- 回忆。 在后续会话中,代理调用
memory_build_context。Rekal将关键词匹配、语义相似性和近期性合并为一个分数,并返回相关性以下的最高搜索结果。
所有状态都是一个文件:~/.rekal/memory.db。关于评分公式、模式和嵌入模型,请参见“底层”。
快速入门(Claude Code)
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
rekal
Long-term memory for LLMs. One SQLite file, no cloud, no API keys.
rekal is an MCP server that gives AI coding agents persistent memory across sessions. Memories are stored locally in SQLite and retrieved with hybrid search (BM25 keywords + vector semantics + recency decay). Nothing leaves your machine.
How it works · Quickstart · Install · Setup · Updating · Tools · Under the hood · Troubleshooting
Works with any MCP-capable agent: Claude Code, Codex CLI, OpenCode, Cursor CLI.
Session 1: "I prefer Ruff over Black" → memory_store(...)
Session 47: "Set up linting" → memory_build_context("formatting preferences")
← "User prefers Ruff over Black" (0.92)
Sets up Ruff without asking.
How it works
- Store. The agent saves a durable fact with
memory_store: a preference, a decision, a non-obvious discovery. - Index. rekal writes it to SQLite and builds two indexes over it: a BM25 keyword index and a 384-dimensional vector embedding, both computed locally with no network calls.
- Recall. In a later session the agent calls
memory_build_context. rekal blends keyword match, semantic similarity, and recency into a single score and returns the top hits above a relevance floor.
All state is a single file: ~/.rekal/memory.db. For the scoring formula, schema, and embedding model, see Under the hood.
Quickstart (Claude Code)
uv tool install rekal # 1. install rekal (or: pip install rekal)
claude mcp add --scope user rekal -- rekal mcp # 2. register the MCP server (all projects)
claude plugin marketplace add janbjorge/rekal # 3. add the plugin marketplace
claude plugin install rekal-skills@rekal # 4. install the plugin
Then add "autoMemoryEnabled": false to ~/.claude/settings.json so Claude Code’s built-in memory doesn’t compete with rekal.
Restart Claude Code and the agent has persistent memory. For what each step does, the other agents (Codex CLI, OpenCode), and the rationale behind disabling built-in memory, read on.
Install
pip install rekal
# or
uv tool install rekal
Requires Python 3.11+. On first run, rekal creates ~/.rekal/memory.db. To upgrade an existing install later, see Updating.
Setup for Claude Code
Three steps: add the MCP server, install the plugin, and disable built-in memory.
1. Add the MCP server. This gives Claude Code the memory tools:
claude mcp add --scope user rekal -- rekal mcp
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"rekal": {
"command": "rekal",
"args": ["mcp"],
"env": {
"REKAL_PROJECT": "my-project"
}
}
}
}