https://github.com/jin6yang/astrbot_plugin_external_knowledgebase
AstrBot plugin providing an online knowledge base for AI.
https://github.com/jin6yang/astrbot_plugin_external_knowledgebase
astrbot-plugin knowledgebase python rag
Last synced: 21 days ago
JSON representation
AstrBot plugin providing an online knowledge base for AI.
- Host: GitHub
- URL: https://github.com/jin6yang/astrbot_plugin_external_knowledgebase
- Owner: jin6yang
- License: agpl-3.0
- Created: 2026-04-16T19:02:14.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2026-04-18T23:26:56.000Z (about 2 months ago)
- Last Synced: 2026-04-18T23:36:45.286Z (about 2 months ago)
- Topics: astrbot-plugin, knowledgebase, python, rag
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
External Knowledge Base Retrieval
Astrbot Plugin
Astrbot 插件 - 外部知识库检索
💖 一款可以让 AstrBot Bot 自由访问外部知识库的插件,使用 Python 编写 😎
由 POINTER 用 ❤️ 制作
[中文 README](README.md) | [English README](README_en.md)
[](https://deepwiki.com/)
[](https://zread.ai/)
[](https://codewiki.google/)
> [!NOTE]
> 本插件正在开发中......
>
> 本插件暂未上架 AstrBot 插件市场
>
> 本插件因为还在开发中,所以版本号可能会保持不变
## 主要功能
让 AstrBot Bot 自由访问外部知识库,并且提供3种决策方案供用户选择
## 更新路线图
- [x] 加入查询知识库的决策层
## 安装
AstrBot Web UI - 插件 - 右下角"+"号 - 从链接安装
## 使用
按 AstrBot Web UI 中本插件设置的引导使用
也可以查看下面 `## 插件配置` 获取详细信息
## 支持的外部知识库
[Dify](https://dify.ai/)(推荐)
[Flowise](https://flowiseai.com/)
[RAGFlow](https://ragflow.io/)(未经过完善测试)
## 插件配置
### 决策模式
L1: 总是发送知识库查询并把匹配到的内容注入提示词
L2: 通过关键词判断是否执行 `L1`
L3: 调用大模型进行意图识别(推荐使用输出速度快的模型以保证整体的回复速度)
### 默认提示词
#### L2
请问,解释,文档,是什么,介绍,怎么,如何,帮我,可以,帮
#### L3
你是一个意图识别引擎。
用户语境:
{history}
用户当前输入: {user_msg}
判断用户上述输入是否是在提问查资料并需要通过外部知识库或文档检索进一步的背景知识。如果需要检索额外资料,回答YES,否则如果只是日常聊天或不需要检索资料,回答NO。只输出YES或NO。
#### 查询重写
根据以下对话历史,将用户的最新输入重写为独立的搜索查询词。核心任务是:解决指代不明,将代词(他,那个等)替换为具体提及的实体;如果不需要重写,直接输出用户输入内容。只输出重写后的内容,不要作答或解释。
对话历史:
{history}
用户最新的需重写输入: {user_msg}
#### 知识库检索结果注入
请参考以下背景知识来回答用户的问题(如果背景知识与问题无关可以忽略):
{context_str}
请结合以上背景知识回答问题。
### 知识库 API 基地址
#### 官方云服务
Dify: https://api.dify.ai/v1
RAGFlow: N/A (仅支持本地部署)
Flowise: https://cloud.flowiseai.com/api/v1
#### 本地部署(包括 Docker 部署)
请修改 API 端点(API 基地址)为你的可访问地址,比如 `http://127.0.0.1:3000/api/v1`
### 插件安装位置
Windows: `%USERPROFILE%\.astrbot\data\plugins\astrbot_plugin_external_knowledgebase`
## 感谢
[Dependencies](https://github.com/jin6yang/astrbot_plugin_external_knowledgebase/network/dependencies)
[AstrBotDevs/AstrBot✨](https://github.com/AstrBotDevs/AstrBot)
## 开发支持
- [AstrBot Repo](https://github.com/AstrBotDevs/AstrBot)
- [AstrBot Plugin Development Docs (Chinese)](https://docs.astrbot.app/dev/star/plugin-new.html)
- [AstrBot Plugin Development Docs (English)](https://docs.astrbot.app/en/dev/star/plugin-new.html)
## 许可证
