/install knowledge-rag
📖 Knowledge RAG — 个人知识库搜索
把你的笔记、转录、文章、文档集中管理,用自然语言搜索,不用管文件放哪。
能做什么
- 📹 搜你转的 B站视频内容
- 📚 搜你的读书笔记
- 📱 搜你存的公众号文章
- 📄 搜任何你丢进去的文档
- 🌐 还有网页搜索界面,浏览器打开就能用
首次设置
1. 安装 Ollama(向量引擎)
从 \x3Chttps://ollama.com/download> 下载安装,或者:
# Linux / macOS
curl -fsSL https://ollama.com/install.sh | sh
# Windows 在官网下载安装包
2. 下载向量模型
ollama pull nomic-embed-text
3. 准备知识目录
把你想要搜索的文件放在这里:
~/workspace/knowledge/
├── bilibili/ ← B站转录文件放这里
├── notes/ ← 读书笔记放这里
├── wechat-articles/ ← 公众号文章放这里
└── other/ ← 其他文档放这里
支持 .txt 和 .md 格式。
4. 构建索引
python3 scripts/index_knowledge.py
工作流
方式一:通过我搜索(推荐)
直接问我,我会自动调用搜索:
你:付鹏说的英国经济那事具体怎么讲的? 我:在知识库里搜一下 → 带原文回答你
你:帮我查一下笔记里关于美联储的部分 我:搜 notes 来源 → 返回结果
方式二:网页搜索界面
启动搜索网页,在浏览器打开:
python3 scripts/knowledge_server.py 8765
然后打开 http://localhost:8765
方式三:命令行搜索
# 全量搜索
python3 scripts/query_knowledge.py "你的问题"
# 只搜某个来源
python3 scripts/query_knowledge.py "美联储" --source bilibili
# 只看某个作者
python3 scripts/query_knowledge.py "英国" --author 付鹏
# 查看更多结果
python3 scripts/query_knowledge.py "英国" --top 10
# 查看索引统计
python3 scripts/query_knowledge.py --stats
新增资料
有新文件时,跑一下索引更新:
python3 scripts/index_knowledge.py
加 --force 会全量重建:
python3 scripts/index_knowledge.py --force
推荐搭配:📼 Bilibili Auto Transcript
如果你也转B站视频,装 bilibili-auto-transcript,转录完自动存到知识库:
clawhub install bilibili-auto-transcript
装好后,转录的文件自动进 ~/workspace/knowledge/bilibili/,索引脚本会自动识别。
转完即搜,无需手动操作。
设置开机自启(网页界面)
Linux 系统(含 WSL2 开了 systemd):
# 创建用户级 systemd 服务
mkdir -p ~/.config/systemd/user/
cat > ~/.config/systemd/user/knowledge-server.service \x3C\x3C 'SERVICE'
[Unit]
Description=知识仓库搜索界面
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/python3 /path/to/scripts/knowledge_server.py 8765
WorkingDirectory=/path/to/scripts
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
SERVICE
# 记得把上面的 /path/to/ 换成实际路径
systemctl --user daemon-reload
systemctl --user enable knowledge-server.service
systemctl --user start knowledge-server.service
数据在哪
所有数据存在 ~/workspace/knowledge/,跟 OpenClaw 无关,卸载也不丢。
索引文件在 ~/workspace/knowledge/.rag_data/。
注意事项
- 依赖 Ollama + nomic-embed-text 做向量化
- 首次索引需联网下载向量模型(~274MB)
- 纯文本搜索,不支持图片/PDF 中的表格
- 删除旧文件后需要重新索引才能从搜索结果中移除
- 搜索网页服务默认监听 8765 端口,可在启动时改
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install knowledge-rag - After installation, invoke the skill by name or use
/knowledge-rag - Provide required inputs per the skill's parameter spec and get structured output
What is Knowledge RAG?
个人知识库搜索引擎。把笔记、转录、文章建成向量索引,自然语言搜。搭配 Bilibili Auto Transcript 使用更佳:视频转录自动入库,转完即搜。 It is an AI Agent Skill for Claude Code / OpenClaw, with 56 downloads so far.
How do I install Knowledge RAG?
Run "/install knowledge-rag" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Knowledge RAG free?
Yes, Knowledge RAG is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Knowledge RAG support?
Knowledge RAG is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Knowledge RAG?
It is built and maintained by 54Lynnn (@54lynnn); the current version is v1.1.2.