Browse / General-purpose / okf-agent-memory-cn
okf-agent-memory-cn
passwordand
OKF Agent Memory 中文检索改造版(gse)
Open passwordand/okf-agent-memory-cn → Matched by file structure only.
Works with any agent
ships AGENTS.md, the cross-tool instruction file.
In its own words
这是 OKF Agent Memory v0.6.1 的中文增强版(v0.6.1-cn.1)。项目保留 OKF 的 Markdown 数据格式、CLI 和 MCP 接口,在搜索层集成 go-ego/gse,让中文和中英文混合查询可以正常分词和召回。
v0.6.1-cn.1 保留中文检索、显式初始化和双库隔离。更新内容及兼容性说明见 发布说明,历史验证见 隔离测试报告。
源码
- 上游源码:okf-memory/okf-agent-memory
- 本仓库:passwordand/okf-agent-memory-cn
适用场景
- 需要本地运行、低延迟、少维护的 Agent 长期记忆;
- 记忆以可读、可 Git 管理的 Markdown 文件保存;
- 在 Codex、OpenCode、WorkBuddy 等客户端中通过 MCP 使用;
- 中文检索不能接受原版 ASCII 分词造成的漏检。
主要改动
- 基于上游 v0.6.1,新增知识包、多层检索、元数据过滤及搜索 / 同步修复;
- 显式绑定根目录的 MCP 保持双库隔离,不允许跨层参数扩大读取范围;
- 使用 gse 搜索模式处理中文分词;
- 保留显式
okf_init()、无参数okf init创建knowledge/和双库 wrapper; - 保留英文、数字和概念 ID 检索;
- 分词器只初始化一次,避免每次查询重复加载词典;
- 使用编译时嵌入词典,发布后的可执行文件不依赖 Go 模块缓存路径;
- 增加中文检索回归测试;
- 提供 Windows PowerShell 构建脚本。
快速开始
下载预编译版本(推荐)
跨电脑部署无需重新编译。前往 GitHub Releases,按系统和架构下载对应文件:
- Windows x64:
okf-windows-amd64.exe - Windows ARM64:
okf-windows-arm64.exe - macOS Apple Silicon:
okf-darwin-arm64 - macOS Intel:
okf-darwin-amd64 - Linux x64:
okf-linux-amd64 - Linux ARM64:
okf-linux-arm64
下载后将文件重命名为 okf.exe(Windows)或 okf(macOS/Linux),并把它放到 PATH;macOS/Linux 还需要执行 chmod +x okf。随后运行 okf version 验证即可。只有修改 Go 源码,或 Release 没有覆盖目标平台时,才需要重新编译。
从源码构建(开发者)
Windows PowerShell
构建产物为 dist/okf-cn.exe。构建脚本会先执行测试,再生成可执行文件。
项目库 + 全局库:双 MCP wrapper
官方 okf mcp 在启动时固定一个根目录。向已运行的服务传 bundle 不能扩大这个边界;Windows 上不同盘符的原始路径也无法通过同一进程的相对路径检查。因此需要两个 MCP 条目、两份独立进程,而不是一个服务静默回退。
目标:Agent 负责选库,用户只说「记住 / 查一下 / 做到哪了」。
Quoting 50% of the README. Read the rest on GitHub ↗
Where it came from
Read from the repository's git tree on 2026-08-17.