xhh678876/openclaw-sjtu/shuiyuan-rag-service
Claude Code and agent skill by xhh678876/openclaw-sjtu
- community
Checking that the SKILL.md file is still in the repository.
水源社区 RAG 检索的常驻 FastAPI 服务(127.0.0.1:9111),把 BGEM3 embedding + BGE reranker 预加载到内存供 lobster-gateway 等多个客户端共享,避免 stdio MCP 每会话冷启动 30s。当用户说"启动水源 RAG 服务"、"重启 shuiyuan-rag"、"shuiyuan-rag /healthz"、"水源检索服务挂了"、"RAG HTTP 服务状态"、"shuiyuan_rag_http"时使用。
Install
npx vskill@latest install xhh678876/openclaw-sjtu/shuiyuan-rag-serviceSKILL.md
Shuiyuan RAG HTTP 服务
scripts/shuiyuan_rag_http.py —— 把原本是 stdio MCP server 的水源检索(shuiyuan_rag_mcp.py)包成长跑 FastAPI 服务。
为什么不用 MCP 直接跑? Claude Code 每个 session 都会 spawn 一个独立的 stdio server,每个都要 ~30s 冷启动加载 BGEM3 embedding。改 HTTP daemon 后 lobster-gateway 几个 chat session 共享一份内存模型,第一次启动后每查询 1-3s。
When to Invoke
- 用户问"水源搜索挂了 / 慢了"
- "重启 RAG 服务"
- "查 /healthz / /stats"
- 修改 KB 后要 reload
运行
API
Request Schema (POST /search)
Response
环境变量
由 launchd plist 控制,不在代码里写死。
安全收敛(已 commit)
/healthz不再泄露SHUIYUAN_KB_PATH绝对路径 —— 即使绑 127.0.0.1,localhost fetch 也能拿到没必要给/stats500 错误返通用"stats unavailable",不再回显内部 exception(防止内部路径/LanceDB 实现细节)_models_loaded全局布尔替代之前侵入式访问srm._embed_model私有属性
故障排查
| 症状 | 排查 | ||
|---|---|---|---|
| 500 + log "no public table loaded" | KB 文件丢/路径错;检查 SHUIYUAN_KB_PATH | ||
| 首次查询超长 | 正常,BGEM3 加载 30s;之后 1-3s | ||
| 全部 0 命中 + low_confidence=true | BGE-reranker 全部低于阈值;问题词大概率不在 KB | ||
| connection refused | 服务没起;`launchctl list \ | grep shuiyuan-rag` | |
| 重启后 /healthz ready=false | lifespan 还在跑;等 30s |
部署架构
服务挂了 lobster-gateway 的 chat 会拿不到 RAG 上下文,直接答用户问题但没引用 —— 不会崩,质量会下降。
相关
- KB 数据:
scripts/shuiyuan_kb/(已 gitignored) - 老 MCP server:
scripts/shuiyuan_rag_mcp.py(本服务包它) - 数据采集:
scripts/shuiyuan_ingest.py+scripts/shuiyuan_discourse.py
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/shuiyuan-rag-service/SKILL.md
Popularity
- Repository stars
- 56
- Repository forks
- 4
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/xhh678876/openclaw-sjtu/shuiyuan-rag-service)