中文 | English
面向 OpenClaw 的生产级本地化插件:
- 知识库插件(
openclaw-knowledgebase-local-mysql) - 记忆插件(
openclaw-memory-local-mysql)
特性:
- MySQL 持久化存储
- Ollama 向量嵌入
- 零外部云服务依赖
kb_store/kb_store_batchkb_searchkb_scan- 可配置分块策略
memory_store/memory_recall/memory_forgetmemory_list/memory_update/memory_explain- Scope 记忆(
global/project/session) - Session 默认 TTL(7 天)
- 治理管道:duplicate / refine / conflict / unrelated
- 唯一 active key 规则(registry 驱动)
- Recall 分层:rule / project_fact / vector
- 维护脚本(过期 + 软清理)
.
├── infrastructure/
│ ├── docker-compose.yml
│ ├── .env.example
│ └── mysql/
│ └── migrations/
│ ├── openclaw_memory/
│ └── openclaw_knowledge_base/
├── plugins/
│ ├── openclaw-knowledgebase-local-mysql/
│ │ ├── src/
│ │ ├── dist/
│ │ └── openclaw.plugin.json
│ └── openclaw-memory-local-mysql/
│ ├── src/
│ ├── tests/
│ ├── dist/
│ └── openclaw.plugin.json
├── scripts/
│ ├── start.sh
│ ├── run-migrations.js
│ ├── migrate.sh
│ └── memory-maintenance.js
└── plugins-config-example.json
git clone git@github.com:karoc/local-knowledgebase-memory.git openclaw-local-plugins
cd openclaw-local-plugins
cp infrastructure/.env.example infrastructure/.env./scripts/start.shcd plugins/openclaw-knowledgebase-local-mysql
npm install
npm run build
cd ../openclaw-memory-local-mysql
npm install
npm run build使用 plugins-config-example.json 作为配置模板。
node scripts/run-migrations.js./scripts/migrate.sh export
./scripts/migrate.sh import# dry-run
node scripts/memory-maintenance.js --dry-run --expire-now --soft-prune
# apply
node scripts/memory-maintenance.js --expire-now --soft-prunecd plugins/openclaw-memory-local-mysql
npx tsc -p tsconfig.json
node --test --test-force-exit --test-concurrency=1 tests/*.test.js- 请勿提交真实凭据。
infrastructure/.env仅本地保留。- 发布或部署前请轮换数据库密码。
MIT License. See LICENSE.