embedder-kb
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "embedder-kb" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-51079fe67dd3b87e3b2e3130e64a6f1cf8cc276fbf4abe38ad638b2afbc47878. Verify the upstream source and version against https://skillhub.cn/skills/user_64718855/embedder-kb before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Build a semantic search knowledge base for technical documentation and MCU materials using the SiliconFlow OpenAI-compatible embedding interface. Use cases include configuring/connecting an Embedder for a knowledge base or RAG, vectorizing documents, incremental indexing, PDF extraction and catalog-listener auto-rebuilds, packaging the corpus into scheduled automation tasks, and improving retrieval of datasheets, HAL/library examples, and register descriptions. Trigger words: Embedder, embedding, semantic search, vectorization, knowledge base, RAG, SiliconFlow, bge-m3, code retrieval.
Introduction source: third_party · user_64718855 · 1.0.0 Reference
SkillPi interpretation
- Testing
- Not tested
Browse files
Frontmatter
name: embedder-kb
description: 用硅基流动(SiliconFlow)OpenAI 兼容 embedding 接口搭建技术文档/MCU 资料的语义检索库,辅助写代码时精准召回数据手册、HAL/库例程、寄存器说明。Use when the user wants to (1) 配置/接入 Embedder 做知识库或 RAG;(2) 把 MCU/技术文档建成可向量检索的语料库;(3) 增量索引、PDF 抽取、目录监听自动重建;(4) 把语料库封装成定时自动化任务;(5) 问"怎么用 Embedder 辅助开发"。触发词:Embedder、向量化、语义检索、embedding、知识库、RAG、硅基流动、bge-m3、代码检索。Embedder KB — 技术文档语义检索库搭建
Overview
把数据手册、HAL/LL 例程、应用笔记、SDK 源码等建成语义可检索的向量库;写代码时精准召回相关片段。核心:scripts/ 下三个零三方依赖 Python 脚本(调 SiliconFlow bge-m3 embedding),配 mcu_watcher.py 目录监听 + WorkBuddy 自动化定时维护。
Quick Start(首次搭建)
- 拷贝
scripts/三个脚本 +.env.example到你的项目目录(如./kb/)。 - 配 Key:
cp .env.example .env,编辑填入SILICONFLOW_API_KEY=sk-xxxx(去 https://siliconflow.cn 控制台「API 密钥」新建)。账户需有余额,否则 402。 - 放语料:把资料丢进
./corpus/(.md/.txt/.c/.h/.s/.py/.cpp/.hpp/.ino/.rst/.log,或 PDF 走 extract)。 - 建库:
python mcu_init.py(全量,首跑;之后自动化维护)。 - 检索:
python mcu_embedder.py query "STM32H7 以太网描述符 Cache 一致性" --topk 5 --prompt→ 把[来源...]上下文块贴进 WorkBuddy 对话即可基于资料写代码。
命令速查
| 命令 | 作用 |
|---|---|
mcu_embedder.py build --corpus ./corpus --index mcu_index.pkl [--incremental] |
读语料→切分→向量化→存 pickle;--incremental 仅重算新增/改动文件 |
mcu_embedder.py query "问题" --topk 5 [--prompt] |
语义检索;--prompt 输出可粘贴到 WorkBuddy 的上下文块 |
mcu_embedder.py extract --corpus ./corpus [--out DIR] [--force] |
批量把 PDF 抽成可索引 .txt(pdftotext→pypdf→PyPDF2) |
mcu_embedder.py check-key |
联网探测 Key 是否生效(区分 未配置/无效/限流/网络不通/成功) |
mcu_embedder.py selftest |
不联网验证切分+检索+增量判定逻辑 |
mcu_watcher.py --corpus ./corpus --index mcu_index.pkl [--once] |
监听 corpus 变化自动抽 PDF+增量重建;--once 跑一次即退(cron 用) |
mcu_init.py |
前置检查 + 全量/增量建库 + 报告(首次引导用) |
封装为定时自动化(WorkBuddy)
- 用
automation_update工具建recurring任务,prompt 大致:"运行python mcu_watcher.py --once对 corpus/ 做增量向量化重建(从 .env 读 Key)",cwds设项目目录,rrule如FREQ=HOURLY或FREQ=DAILY。 - 关键:自动化运行环境不继承 shell 变量,必须用
.env文件存 Key(脚本已内置load_env_file())。详见 references/siliconflow_api.md「工作流级坑点」。
语料深化范式
- 每份笔记顶部加
> 关键词:型号 外设 寄存器 常见坑,让召回更准、型号间不串。 - 按"写代码会卡住的点"写:寄存器位 + HAL/库调用 + 常见坑,优于教科书叙述。
- 官方 PDF 下载后丢进 corpus 对应目录,
mcu_watcher.py --once自动增量纳入。 corpus/README.md等目录说明文件不进向量库(已自动排除)。
验证 Key / 排查失败
- 建库前必跑
mcu_embedder.py check-key,确认非 402/401。 - 各失败码含义与处理见 references/siliconflow_api.md。
- 真实向量化需联网 + 余额;逻辑正确性可用
selftest(不联网)验证。
Resources
scripts/mcu_embedder.py— 核心:build/query/extract/check-key/selftestscripts/mcu_watcher.py— 目录监听自动重建(防抖、增量、PDF 触发)scripts/mcu_init.py— 首次建库一键引导(前置检查 + 全量/增量)scripts/.env.example— Key 配置样例references/siliconflow_api.md— API 端点、模型选择、工作流级坑点、语料范式
Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 面向开发者高频刚需场景,解决 MCU/技术文档语义检索痛点
- 提供端到端搭建方案,涵盖语料处理、向量化、增量索引与自动化维护
Highlights
- 触发词覆盖全面且边界清晰,涵盖核心功能关键词与平台名称
Highlights
- 文档结构完整,步骤清晰,含具体命令示例与出口条件
- frontmatter 完整,章节划分合理,符合用户阅读习惯
Highlights
- 工具来源明确,参数说明清晰,覆盖主要异常处理
- 提供 Key 验证、离线测试与失败码处理机制,保障执行稳定性
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 13
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- siliconflow.cn
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.