AS AgentScopeAPI 手册 / API Reference
功能域Functional domain

RAG 与知识库RAG & knowledge

从文档读取、切分、向量化到向量库检索与重排的完整链路,包含 Milvus/Qdrant/MongoDB/Elasticsearch 以及多种第三方 RAG 平台集成。The document-to-retrieval pipeline: readers, chunking, embeddings, vector stores, retrieval and third-party RAG integrations.

114类型总数types total
33Python
81Java
3学习锚点learning anchors

心智模型Mental model

知识库把文档切分、向量化、写入向量存储,并在查询时做召回与重排,最终把证据注入模型上下文。Knowledge bases chunk and embed documents, store vectors, retrieve and rerank at query time, then inject evidence into model context.

先学什么What to learn first

  • 切分策略与 embedding 模型必须匹配,换模型要重建索引。Chunking strategy must match the embedding model; changing models requires re-indexing.
  • 召回质量先看 chunk 元数据与过滤条件,再看重排模型。Debug recall through chunk metadata and filters before blaming the reranker.
  • 回答要带来源引用,否则无法审计和纠错。Answers must carry source citations for auditability and correction.

生产常见坑Production pitfalls

  • 文档更新后未删除旧向量,召回过期内容。Stale vectors remain after document updates and surface outdated facts.
  • 把知识库检索放进每次对话的同步路径,首字延迟飙升。Synchronous retrieval on every turn destroys time-to-first-token.

进入对应闯关单元Practice this domain →

域内图谱Domain map

点击节点打开 API 页面;拖拽平移,滚轮缩放。Click a node to open its API page. Drag to pan, scroll to zoom.

Python Java

Python API 集Python API set 33

归入本功能域的全部 Python 公开类型,按所属包分组。Every public Python type classified into this domain, grouped by owning package.

agentscope.rag22
ApproxTokenChunkerclassApprox 令牌切分器,把私有文档转化为可检索的知识。
ApproxTokenChunker.Parametersclass参数,把私有文档转化为可检索的知识。
Chunkclass分块,把私有文档转化为可检索的知识。
ChunkerBaseclass切分器基类,把私有文档转化为可检索的知识。
ChunkerBase.Parametersclass参数,把私有文档转化为可检索的知识。
DocumentSummaryclass文档摘要,把私有文档转化为可检索的知识。
ElasticsearchStoreclassElasticsearch 存储,负责持久化与读取数据。
ExcelParserclassExcel 解析器,把私有文档转化为可检索的知识。
ImageParserclass用于图像文件的解析器。
KnowledgeBaseclass文档知识库
MilvusLiteStoreclassMilvus Lite 存储,负责持久化与读取数据。
MongoDBStoreclassMongoDB 存储,负责持久化与读取数据。
ParserBaseclass解析器基类,把私有文档转化为可检索的知识。
PDFParserclass用于PDF 文件的解析器。
PPTParserclass用于PowerPoint`.pptx`文件的解析器。
QdrantStoreclassQdrant 存储,负责持久化与读取数据。
SectionclassSection,把私有文档转化为可检索的知识。
TextParserclass文本解析器,把私有文档转化为可检索的知识。
VectorRecordclass向量记录,把私有文档转化为可检索的知识。
VectorSearchResultclass向量搜索结果,把私有文档转化为可检索的知识。
VectorStoreBaseclass向量存储基类,把私有文档转化为可检索的知识。
WordParserclassWord 解析器,把私有文档转化为可检索的知识。
agentscope.app.rag11
AsyncReadableclass异步可读,把私有文档转化为可检索的知识。
BlobStoreBaseclass二进制对象存储基类,把私有文档转化为可检索的知识。
CollectionPerKbManagerclass集合每个知识库管理器,把私有文档转化为可检索的知识。
DimensionPolicyclass维度策略,把私有文档转化为可检索的知识。
DimensionPolicyErrorclass维度策略错误,把私有文档转化为可检索的知识。
DimensionPolicyKindclass维度策略种类,把私有文档转化为可检索的知识。
KnowledgeBaseErrorclass知识库基类管理器错误的基类。
KnowledgeBaseManagerBaseclass知识库管理器基类,把私有文档转化为可检索的知识。
KnowledgeBaseNotFoundErrorclass知识库未找到错误,把私有文档转化为可检索的知识。
LocalBlobStoreclass本地二进制对象存储,负责持久化与读取数据。
S3BlobStoreclassS 3 二进制对象存储,负责持久化与读取数据。

Java API 集Java API set 81

归入本功能域的全部 Java 公开类型,按包分组并标注构件。Every public Java type classified into this domain, grouped by package with its artifact.

io.agentscope.core.rag.reader17
AbstractChunkingReaderclassagentscope-extensions-rag-simple抽象 Chunking 读取器,把私有文档转化为可检索的知识。
Builderclassagentscope-extensions-rag-simple构建器,用于构建并配置目标实例。
ExternalApiReaderclassagentscope-extensions-rag-simple外部 API 读取器,把私有文档转化为可检索的知识。
ImageReaderclassagentscope-extensions-rag-simple图像读取器,把私有文档转化为可检索的知识。
InputTypeenumagentscope-extensions-rag-simple定义输入类型的枚举。
PDFReaderclassagentscope-extensions-rag-simplePDF 读取器,把私有文档转化为可检索的知识。
Readerinterfaceagentscope-extensions-rag-simple定义读取器契约的接口。
ReaderInputclassagentscope-extensions-rag-simple读取器输入,把私有文档转化为可检索的知识。
ReaderUtilsclassagentscope-extensions-rag-simple读取器 Utils,把私有文档转化为可检索的知识。
RequestBuilderinterfaceagentscope-extensions-rag-simple定义请求构建器契约的接口。
ResponseParserinterfaceagentscope-extensions-rag-simple定义响应解析器契约的接口。
SplitStrategyenumagentscope-extensions-rag-simple定义已拆分 Strategy相关取值的枚举。
TableFormatenumagentscope-extensions-rag-simple定义Table 格式相关取值的枚举。
TextChunkerclassagentscope-extensions-rag-simple文本切分器,把私有文档转化为可检索的知识。
TextReaderclassagentscope-extensions-rag-simple文本读取器,把私有文档转化为可检索的知识。
TikaReaderclassagentscope-extensions-rag-simpleTika 读取器,把私有文档转化为可检索的知识。
WordReaderclassagentscope-extensions-rag-simpleWord 读取器,把私有文档转化为可检索的知识。
io.agentscope.core.rag.integration.dify13
Builderclassagentscope-extensions-rag-difyDifyKnowledge的构建器。
Builderclassagentscope-extensions-rag-difyDifyRAGConfig的构建器。
Builderclassagentscope-extensions-rag-difyMetadataFilter的构建器。
Builderclassagentscope-extensions-rag-difyMetadataFilterCondition的构建器。
Builderclassagentscope-extensions-rag-difyRerankConfig的构建器。
DifyDocumentConverterclassagentscope-extensions-rag-difyDify 文档转换器,把私有文档转化为可检索的知识。
DifyKnowledgeclassagentscope-extensions-rag-difyDify 知识库,把私有文档转化为可检索的知识。
DifyRAGClientclassagentscope-extensions-rag-difyDify RAG 客户端,封装与远端服务的连接和调用。
DifyRAGConfigclassagentscope-extensions-rag-difyDify RAG 配置,保存相关配置项。
MetadataFilterclassagentscope-extensions-rag-dify元数据过滤器,把私有文档转化为可检索的知识。
MetadataFilterConditionclassagentscope-extensions-rag-dify元数据过滤 Condition,把私有文档转化为可检索的知识。
RerankConfigclassagentscope-extensions-rag-dify重排配置,保存相关配置项。
RetrievalModeenumagentscope-extensions-rag-dify定义检索模式相关取值的枚举。
io.agentscope.core.rag.store12
Builderclassagentscope-extensions-rag-simpleElasticsearchStore的构建器。
Builderclassagentscope-extensions-rag-simpleInMemoryStore的构建器。
Builderclassagentscope-extensions-rag-simple构建器,用于构建并配置目标实例。
Builderclassagentscope-extensions-rag-simple构建器,用于构建并配置目标实例。
Builderclassagentscope-extensions-rag-simple构建器,用于构建并配置目标实例。
DistanceTypeenumagentscope-extensions-rag-simple定义Distance 类型的枚举。
ElasticsearchStoreclassagentscope-extensions-rag-simpleElasticsearch 存储,负责持久化与读取数据。
InMemoryStoreclassagentscope-extensions-rag-simpleIn 记忆存储,负责持久化与读取数据。
MilvusStoreclassagentscope-extensions-rag-simpleMilvus 存储,负责持久化与读取数据。
PgVectorStoreclassagentscope-extensions-rag-simplePg 向量存储,负责持久化与读取数据。
QdrantStoreclassagentscope-extensions-rag-simpleQdrant 存储,负责持久化与读取数据。
VDBStoreBaseinterfaceagentscope-extensions-rag-simple定义 VDB 存储基类契约的接口。
io.agentscope.core.rag.integration.bailian11
BailianClientclassagentscope-extensions-rag-bailianBailian 客户端,封装与远端服务的连接和调用。
BailianConfigclassagentscope-extensions-rag-bailianBailian 配置,保存相关配置项。
BailianDocumentConverterclassagentscope-extensions-rag-bailianBailian 文档转换器,把私有文档转化为可检索的知识。
BailianKnowledgeclassagentscope-extensions-rag-bailianBailian 知识库,把私有文档转化为可检索的知识。
Builderclassagentscope-extensions-rag-bailianBailianConfig的构建器。
Builderclassagentscope-extensions-rag-bailianBailianKnowledge的构建器。
Builderclassagentscope-extensions-rag-bailianRerankConfig的构建器。
Builderclassagentscope-extensions-rag-bailianRewriteConfig的构建器。
QueryHistoryEntryclassagentscope-extensions-rag-bailian查询历史条目,把私有文档转化为可检索的知识。
RerankConfigclassagentscope-extensions-rag-bailian重排配置,保存相关配置项。
RewriteConfigclassagentscope-extensions-rag-bailianRewrite 配置,保存相关配置项。
io.agentscope.core.rag.integration.haystack7
Builderclassagentscope-extensions-rag-haystack构建器,用于构建并配置目标实例。
Builderclassagentscope-extensions-rag-haystack构建器,用于构建并配置目标实例。
FilterPolicyenumagentscope-extensions-rag-haystack定义过滤策略相关取值的枚举。
HayStackClientclassagentscope-extensions-rag-haystackHay Stack 客户端,封装与远端服务的连接和调用。
HayStackConfigclassagentscope-extensions-rag-haystackHay Stack 配置,保存相关配置项。
HayStackDocumentConverterclassagentscope-extensions-rag-haystackHay Stack 文档转换器,把私有文档转化为可检索的知识。
HayStackKnowledgeclassagentscope-extensions-rag-haystackHay Stack 知识库,把私有文档转化为可检索的知识。
io.agentscope.core.rag.integration.ragflow6
Builderclassagentscope-extensions-rag-ragflow构建器,用于构建并配置目标实例。
Builderclassagentscope-extensions-rag-ragflow构建器,用于构建并配置目标实例。
RAGFlowClientclassagentscope-extensions-rag-ragflow用于RAGFlow API的HTTP 客户端。
RAGFlowConfigclassagentscope-extensions-rag-ragflowRAG Flow 配置,保存相关配置项。
RAGFlowDocumentConverterclassagentscope-extensions-rag-ragflowRAG Flow 文档转换器,把私有文档转化为可检索的知识。
RAGFlowKnowledgeclassagentscope-extensions-rag-ragflowRAG Flow 知识库,把私有文档转化为可检索的知识。
io.agentscope.core.rag4
GenericRAGHookclassagentscope-core泛型 RAG 钩子,把私有文档转化为可检索的知识。
Knowledgeinterfaceagentscope-core定义知识库契约的接口。
KnowledgeRetrievalToolsclassagentscope-core知识库检索工具,封装可被智能体调用的能力。
RAGModeenumagentscope-core定义RAG 模式相关取值的枚举。
io.agentscope.core.rag.exception2
ReaderExceptionclassagentscope-extensions-rag-simple读取器异常,表示执行过程中的错误。
VectorStoreExceptionclassagentscope-extensions-rag-simple向量存储异常,表示执行过程中的错误。
io.agentscope.core.rag.integration.dify.exception2
DifyApiExceptionclassagentscope-extensions-rag-difyDify API 异常,表示执行过程中的错误。
DifyAuthExceptionclassagentscope-extensions-rag-difyDify 认证异常,表示执行过程中的错误。
io.agentscope.core.rag.integration.ragflow.exception2
RAGFlowApiExceptionclassagentscope-extensions-rag-ragflowRAG Flow API 异常,表示执行过程中的错误。
RAGFlowAuthExceptionclassagentscope-extensions-rag-ragflowRAG Flow 认证异常,表示执行过程中的错误。
io.agentscope.core.rag.knowledge2
Builderclassagentscope-extensions-rag-simpleSimpleKnowledge的构建器。
SimpleKnowledgeclassagentscope-extensions-rag-simple开箱即用的知识库实现
io.agentscope.core.rag.store.dto2
SearchDocumentDtoclassagentscope-extensions-rag-simple搜索文档 Dto,把私有文档转化为可检索的知识。
SearchDocumentDtoBuilderclassagentscope-extensions-rag-simple用于SearchDocument DTO的构建器类。
io.agentscope.core.rag.integration.haystack.exception1
HayStackApiExceptionclassagentscope-extensions-rag-haystackHay Stack API 异常,表示执行过程中的错误。

Python ↔ Java 对照Python ↔ Java

两套实现共享同一概念模型,但在并发(async/await 与 Reactor)、打包(wheel 模块与 Maven 构件)和生命周期 API 上存在差异。需要精确签名时请使用 API 全景。The two implementations follow the same conceptual model but differ in concurrency (async/await vs Reactor), packaging (wheel modules vs Maven artifacts) and lifecycle APIs. Use the full API map to locate exact signatures.

打开 API 全景Open full API map →

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.