类 InMemoryVectorStore
java.lang.Object
top.aoyudi.rag.impl.InMemoryVectorStore
- 所有已实现的接口:
VectorStore
内存实现的向量存储仓库
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明private final EmbeddingGeneratorprivate final TextSplitterprivate final VectorSimilarityCalc -
构造器概要
构造器构造器说明InMemoryVectorStore(EmbeddingGenerator embeddingGenerator, TextSplitter textSplitter, VectorSimilarityCalc vectorSimilarityCalc) -
方法概要
修饰符和类型方法说明voidaddDocument(String repositoryKey, Document document) 添加文档向量到指定仓库voidaddDocuments(String repositoryKey, List<Document> documents) 将文档添加到指定向量仓库(会自动分割为块)void清空指定仓库的所有文档voidcreateRepository(String repositoryKey) 创建新仓库(如果不存在)voiddeleteRepository(String repositoryKey) 删除指定仓库及其所有文档列出所有现有仓库similaritySearch(String repositoryKey, float[] queryVector) 根据查询向量从指定仓库检索相似文档similaritySearch(String repositoryKey, String queryText) 根据查询文本从指定仓库检索相似文档(内部会自动生成向量)
-
字段详细资料
-
repositoryDocuments
-
embeddingGenerator
-
vectorSimilarityCalc
-
textSplitter
-
-
构造器详细资料
-
InMemoryVectorStore
public InMemoryVectorStore(EmbeddingGenerator embeddingGenerator, TextSplitter textSplitter, VectorSimilarityCalc vectorSimilarityCalc)
-
-
方法详细资料
-
createRepository
从接口复制的说明:VectorStore创建新仓库(如果不存在)- 指定者:
createRepository在接口中VectorStore- 参数:
repositoryKey- 仓库标识
-
deleteRepository
从接口复制的说明:VectorStore删除指定仓库及其所有文档- 指定者:
deleteRepository在接口中VectorStore- 参数:
repositoryKey- 仓库标识
-
listRepositories
从接口复制的说明:VectorStore列出所有现有仓库- 指定者:
listRepositories在接口中VectorStore- 返回:
- 仓库标识列表
-
addDocument
从接口复制的说明:VectorStore添加文档向量到指定仓库- 指定者:
addDocument在接口中VectorStore- 参数:
repositoryKey- 仓库标识document- 文档对象
-
addDocuments
从接口复制的说明:VectorStore将文档添加到指定向量仓库(会自动分割为块)- 指定者:
addDocuments在接口中VectorStore- 参数:
repositoryKey- 目标仓库标识documents- 文档列表
-
similaritySearch
从接口复制的说明:VectorStore根据查询向量从指定仓库检索相似文档- 指定者:
similaritySearch在接口中VectorStore- 参数:
repositoryKey- 仓库标识queryVector- 查询向量- 返回:
- 相似文档列表
-
similaritySearch
从接口复制的说明:VectorStore根据查询文本从指定仓库检索相似文档(内部会自动生成向量)- 指定者:
similaritySearch在接口中VectorStore- 参数:
repositoryKey- 仓库标识queryText- 查询文本- 返回:
- 相似文档列表
-
clear
从接口复制的说明:VectorStore清空指定仓库的所有文档- 指定者:
clear在接口中VectorStore- 参数:
repositoryKey- 仓库标识
-