R9 Rag Engine logo

R9 Rag Engine

Community
r9412460971-cloud
r9-rag-engine

R9 投研工作台的本地向量检索引擎。对所有 skill 的 SKILL.md、references、课程知识库和 OPC 公司记忆做语义分块、embedding 和 FAISS 索引,供其他 skill 在回答问题时检索相关知识片段。当用户问题需要查找 skill 使用方法、课程材料、公司历史决策、话术模板等分散知识时触发。

Overview

Publisherr9412460971-cloud
RepositoryOPC-skill
Skill namer9-rag-engine
Stars
37
Forks
11
Bundled files
12
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 12 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by r9412460971-cloud on GitHub. Read the source before you install it.

Installation

Install the R9 Rag Engine AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/r9412460971-cloud/OPC-skill/tree/main/skills/r9-rag-engine
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/r9412460971-cloud/OPC-skill.git /tmp/OPC-skill
mkdir -p .claude/skills
cp -r /tmp/OPC-skill/skills/r9-rag-engine .claude/skills/r9-rag-engine
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable R9 Rag Engine in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads R9 Rag Engine on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so R9 Rag Engine is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

r9-rag-engine

R9 投研工作台的本地向量 RAG 引擎。把分散在 94 个 skill、课程知识库和 OPC 记忆中的知识做语义索引,让 Agent 不用加载整篇 reference 也能召回最相关的片段。

触发条件

当其他 skill 或 routing agent 需要查找以下知识时调用本 skill:

  • 某个 skill 的具体用法、输出格式、判断规则
  • R9 课程中的框架、案例、话术、数据
  • OPC 公司历史会议纪要、决策记录、指令跟踪
  • 分散在多个 skill references 中的交叉知识

核心能力

1. 语义检索

输入自然语言问题,返回最相关的文本片段(chunk),包含来源路径和相关度分数。

python
from scripts.rag_api import search, format_results

results = search("客户基金回撤安抚话术", top_k=5)
print(format_results(results))

2. 已索引内容

  • ~/.kimi/skills/*/SKILL.md — 所有 skill 主文档
  • ~/.kimi/skills/*/references/* — skill 参考资料
  • ~/OPC/**/*.{pdf,docx} — OPC 公司记忆归档文件

3. 本地运行

  • Embedding 模型:BAAI/bge-small-zh-v1.5(中英双语,约 100MB)
  • 向量索引:FAISS(IndexFlatIP,本地文件)
  • 无需 API Key,数据不出本机

使用方式

命令行检索

bash
python3 /Users/r9/.kimi/skills/r9-rag-engine/scripts/search.py "固收+基金回撤安抚话术"

重新构建索引

当新增/修改 skill、references 或 OPC 归档文件后运行:

bash
python3 /Users/r9/.kimi/skills/r9-rag-engine/scripts/build_index.py

其他 skill 调用

rag_api.py 依赖 venv 中的 faiss 和 sentence-transformers,必须在隔离环境里运行。推荐两种方式:

方式 A:子进程调用(适合 system python 环境)

python
import json
import subprocess

query = "投顾组合再平衡方法"
result = subprocess.run(
    [
        "/Users/r9/.kimi/skills/r9-rag-engine/.venv/bin/python",
        "-c",
        f"""
import sys
sys.path.insert(0, "/Users/r9/.kimi/skills/r9-rag-engine/scripts")
from rag_api import search
import json
print(json.dumps(search({query!r}, top_k=3), ensure_ascii=False))
"""
    ],
    capture_output=True,
    text=True,
    timeout=120,
)
results = json.loads(result.stdout)

方式 B:在 venv 内直接 import

bash
/Users/r9/.kimi/skills/r9-rag-engine/.venv/bin/python your_script.py

脚本内:

python
from rag_api import search
results = search("投顾组合再平衡方法", top_k=3)

集成规范

其他 skill 在需要检索知识时,优先按以下流程:

  1. 用 rag_api.search() 检索相关问题
  2. 取 top-k 结果(建议 3-5 条)
  3. 将检索到的文本片段加入 prompt 上下文
  4. 基于片段生成回答,并注明来源

文件结构

r9-rag-engine/
├── SKILL.md
├── scripts/
│   ├── setup.py          # 创建 venv、安装依赖、下载模型
│   ├── build_index.py    # 构建/重建索引
│   ├── search.py         # CLI 检索
│   ├── rag_api.py        # Python API
│   ├── chunker.py        # Markdown/PDF/DOCX 分块
│   ├── embedder.py       # embedding 模型封装
│   ├── _venv_helper.py   # 自动切 venv 运行
│   └── rag_config.py     # 共享配置
└── data/
    ├── config.json       # 索引配置
    ├── index.faiss       # FAISS 向量索引
    └── metadata.jsonl    # chunk 元数据

维护责任

  • Vega(运营技术):定期运行 build_index.py,确保索引与 skill 内容同步。
  • Luce(CEO):审核检索质量,决定是否扩展索引范围。

版本:v1.0

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the R9 Rag Engine AI skill do?

R9 投研工作台的本地向量检索引擎。对所有 skill 的 SKILL.md、references、课程知识库和 OPC 公司记忆做语义分块、embedding 和 FAISS 索引,供其他 skill 在回答问题时检索相关知识片段。当用户问题需要查找 skill 使用方法、课程材料、公司历史决策、话术模板等分散知识时触发。

Why use R9 Rag Engine on TypingMind?

Because you install it once and use it with any model. R9 Rag Engine is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install R9 Rag Engine in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/r9412460971-cloud/OPC-skill/tree/main/skills/r9-rag-engine. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use R9 Rag Engine?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with R9 Rag Engine?

As many as you like. As long as a model supports skills, you can use R9 Rag Engine with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the R9 Rag Engine AI skill free?

It is published on GitHub by r9412460971-cloud. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇