VDBStoreBase
public interface VDBStoreBase
源码Source
io/agentscope/core/rag/store/VDBStoreBase.java:39–78定义 VDB 存储基类契约的接口。位于 io.agentscope.core.rag.store 包。核心成员包括 add、search、delete。
Interface for vector database storage.
This interface provides a unified API for storing and searching vector embeddings. Implementations can use in-memory storage, Qdrant, ChromaDB, or other vector databases.
The store directly stores Document objects (including metadata/payload), not just vectors. This allows retrieval of complete documents with their metadata.
Key features:
-
Batch document addition for efficiency
-
Vector similarity search with optional score threshold
-
Document retrieval with embeddings and metadata
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Mono<Void> add(List<Document> documents) | 设置添加。 Adds multiple documents to the store. |
public Mono<List<Document>> search(SearchDocumentDto searchDocumentDto) | 设置搜索。 Searches for similar documents. |
public Mono<Boolean> delete(String id) | 删除数据。 Deletes a document from the store (optional). |
方法详情Method Detail
add
public Mono<Void> add(List<Document> documents)
设置添加。
Adds multiple documents to the store.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
documents | List<Document> | 文档到存储(所有必须有向量设置)的列出。the list of documents to store (all must have embeddings set) |
Mono<Void>返回Mono。a Mono that completes when all documents are stored
源码Source
io/agentscope/core/rag/store/VDBStoreBase.java:53search
public Mono<List<Document>> search(SearchDocumentDto searchDocumentDto)
设置搜索。
Searches for similar documents.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
searchDocumentDto | SearchDocumentDto | 搜索文档 DTO。the search document DTO |
Mono<List<Document>>返回Mono>。a Mono that emits a list of Document objects with scores set, sorted by similarity (descending)
源码Source
io/agentscope/core/rag/store/VDBStoreBase.java:66delete
public Mono<Boolean> delete(String id)
删除数据。
Deletes a document from the store (optional).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。the document ID (UUID string) to delete |
Mono<Boolean>返回Mono。a Mono that emits true if the deletion was successful, false otherwise
源码Source
io/agentscope/core/rag/store/VDBStoreBase.java:77