mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
* docs: update wiki for RAG engine plugin architecture Replace KnowledgeRetriever component docs with RAGEngine across all three languages (zh/en/ja). Key changes: - Add new rag-engine.mdx component docs covering RAGEngine base class, creation_schema/retrieval_schema, capability declarations, lifecycle hooks, host RAG APIs, and complete code examples - Update knowledge base usage docs to reflect unified KB model (remove internal/external distinction, add RAG engine selection flow) - Update component list (add.mdx) and plugin intro to reference RAGEngine - Add RAG API section to plugin common APIs (invoke_embedding, vector_upsert/search/delete, get_rag_file_stream) - Update docs.json navigation to point to rag-engine pages Companion to LangBot PR #1995 and SDK PR #34. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: sync with sdk * docs: update vector API docs with metadata filters, search_type, and documents support - Replace Warning tags about unimplemented filters with Info tags documenting canonical filter format (Chroma-style where syntax) and supported operators - Document search_type/query_text params for full-text and hybrid search - Document documents param for vector_upsert - Update RetrievalContext.filters description from reserved to active - Add filter usage examples (en/zh/ja) Co-Authored-By: Claude Opus 4.6 <[email protected]> * docs: enhance RAG Engine documentation across multiple languages - Expanded the description of the RAG Engine component to include bridging capabilities with advanced knowledge base services like Dify, RAGFlow, and FastGPT. - Clarified the `DOC_INGESTION` capability description, specifying conditions under which the declaration can be omitted. - Updated documentation in English, Japanese, and Chinese to ensure consistency and clarity. * docs: add instructions for show_if conditional rendering * docs: add Parser component documentation (zh/en/ja) Add Parser as a new component type in plugin docs. Parser extracts structured text from binary files (PDF, Word, etc.) before RAG engine ingestion. Includes manifest format, parse method API, data models (ParseContext/ParseResult/TextSection), RAGEngine integration via parsed_content, and cross-plugin invoke_parser API. Also add DOC_PARSING capability to RAG engine docs and parsed_content field to IngestionContext. Companion to SDK PR langbot-app/langbot-plugin-sdk#37 and LangBot PR langbot-app/LangBot#2000. Co-Authored-By: Claude Opus 4.6 <[email protected]> * docs: rename RAGEngine components to KnowledgeEngine * refactor: change rag engine to knowledge engine --------- Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Junyan Qin <[email protected]>
---
title: "使用知识库 (Knowledge Base)"
---
LangBot 原生支持 RAG(Retrieval-Augmented Generation,即检索增强生成),您可以创建知识库,并将其与流水线绑定,流水线将根据知识库中的内容回答问题。
知识库由 RAG 引擎插件驱动,不同的 RAG 引擎提供不同的索引和检索策略。您可以在[插件市场](https://space.langbot.app/market)中查找可用的 RAG 引擎插件。
## 创建知识库
在知识库页面,点击`创建知识库`按钮:
1. 填写知识库名称
2. 选择一个 RAG 引擎(由已安装的插件提供)
3. 根据所选引擎的配置表单填写相关参数(如嵌入模型、分块大小等)
4. 点击`创建`按钮
<Info>
不同的 RAG 引擎有不同的配置参数,具体取决于引擎的 `creation_schema` 定义。某些引擎可能需要先配置嵌入模型,请先阅读[配置模型](/zh/usage/models/readme)。
</Info>
如果所选 RAG 引擎支持文档上传(声明了 `DOC_INGESTION` 能力),创建后请到知识库的"文档"页面,上传文档,LangBot 将会在后台开始解析和索引。
## 使用知识库
请到流水线配置中,"AI 能力"页,选择`内置 Agent`作为运行器,并在下方选择您刚刚创建的知识库。
<img width="400px" src="/images/zh/deploy/knowledge/use_local_agent.png" alt="use_kb" />
<img width="400px" src="/images/zh/deploy/knowledge/use_kb.png" alt="use_kb" />
<Info>
仅当运行器为`内置 Agent`时,才可以使用 LangBot 原生知识库,若要在使用其他运行器时使用知识库,请参考所使用的运行器对应产品的文档。
</Info>
现在即可在`对话调试`或流水线所绑定的机器人上使用知识库进行对话:
<img width="400px" src="/images/zh/deploy/knowledge/use_kb_in_chat.png" alt="use_kb_in_chat" />
## 开发自定义 RAG 引擎
如果现有的知识引擎插件不能满足您的需求,您可以开发自己的知识引擎插件。请参阅[组件:知识引擎](/zh/plugin/dev/components/knowledge-engine)了解开发方式。