Package org.springframework.ai.vectorstore
@NonNullApi
@NonNullFields
package org.springframework.ai.vectorstore
Provides interfaces and implementations for working with vector databases in Spring AI.
Vector databases store embeddings (numerical vector representations) of data along with the original content and metadata, enabling similarity search operations. This package contains two primary interfaces:
VectorStoreRetriever- A read-only functional interface that provides similarity search capabilities for retrieving documents from a vector store. This interface follows the principle of least privilege by exposing only retrieval operations.VectorStore- Extends VectorStoreRetriever and adds mutation operations (add, delete) for managing documents in a vector store. This interface provides complete access to vector database functionality.
The package also includes supporting classes such as:
SearchRequest- Configures similarity search parameters including query text, result limits, similarity thresholds, and metadata filters.Filter- Provides filtering capabilities for metadata-based document selection (located in the filter subpackage).
This package is designed to support Retrieval Augmented Generation (RAG) applications by providing a clean separation between read and write operations, allowing components to access only the functionality they need.
- Since:
- 1.0.0
- Author:
- Mark Pollack
- See Also:
-
ClassDescriptionAbstractVectorStoreBuilder<T extends AbstractVectorStoreBuilder<T>>Abstract base builder implementing common builder functionality for
VectorStore.Choose whether the Vector store should prioritize recall or latency when returning similar vectors in search results.Choose the method to calculate the similarity between the vector embedding in a Vector Search index and the vector embedding in a Vector Search query.GemFireAiSearchFilterExpressionConverter is a class that converts Filter.Expression objects into GemFire VectorDB query string representation.Similarity search request.SearchRequest Builder.SimpleVectorStore is a simple implementation of the VectorStore interface.An immutableContentimplementation representing content, metadata, and its embeddings.TheVectorStoreinterface defines the operations for managing and querying documents in a vector database.VectorStore.Builder<T extends VectorStore.Builder<T>>Builder interface for creating VectorStore instances.A functional interface that provides read-only access to vector store retrieval operations.