feat: add runtime RAG retrieval — FoJin-powered answers for all teachers

Add rag_query.py CLI tool (search/semantic/dict/kg subcommands) and
rag_instructions.md prompt fragment so every teacher skill queries
FoJin's real Buddhist texts at runtime instead of relying solely on
LLM training data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
xianren
2026-04-04 19:56:14 +08:00
parent 6b2131b805
commit ad689a58fe
3 changed files with 268 additions and 0 deletions
+3
View File
@@ -70,6 +70,8 @@ python3 ${CLAUDE_SKILL_DIR}/tools/sutra_collector.py --name "<法师名>" --trad
### Step 3:分析与生成
**运行时检索规则**:加载 `${CLAUDE_SKILL_DIR}/prompts/rag_instructions.md`,将其中的检索指引嵌入生成的每个法师 SKILL.md 的运行规则中,确保法师回答时调用 FoJin 实时检索而非仅依赖 LLM 自身知识。
**教义分析**:加载 `${CLAUDE_SKILL_DIR}/prompts/sutra_analyzer.md`,填入采集数据,分析教义结构。
**风格分析**:加载 `${CLAUDE_SKILL_DIR}/prompts/voice_analyzer.md`,填入采集数据,分析说法风格。
@@ -118,6 +120,7 @@ teachers/{slug}/
| 任务 | 工具 |
|------|------|
| FoJin 数据查询 | `${CLAUDE_SKILL_DIR}/tools/fojin_bridge.py` |
| FoJin 实时检索 | `${CLAUDE_SKILL_DIR}/tools/rag_query.py` |
| 经文采集 | `${CLAUDE_SKILL_DIR}/tools/sutra_collector.py` |
| 角色生成 | `${CLAUDE_SKILL_DIR}/tools/teacher_builder.py` |
| 文件写入 | `${CLAUDE_SKILL_DIR}/tools/skill_writer.py` |