VectorStore class abstract
Interface for vector stores.
Constructors
- VectorStore({required Embeddings embeddings})
-
Interface for vector stores.
const
Properties
- embeddings → Embeddings
-
The embeddings model used to embed documents.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addDocuments(
{required List< Document> documents}) → Future<List< String> > - Runs more documents through the embeddings and add to the vector store.
-
addVectors(
{required List< List< vectors, required List<double> >Document> documents}) → Future<List< String> > - Runs more texts through the embeddings and add to the vector store.
-
asRetriever(
{VectorStoreRetrieverOptions defaultOptions = const VectorStoreRetrieverOptions()}) → VectorStoreRetriever< VectorStore> - Returns a VectorStoreRetriever that uses this vector store.
-
delete(
{required List< String> ids}) → Future<void> - Delete by vector ID.
-
maxMarginalRelevanceSearch(
{required String query, VectorStoreMMRSearch config = const VectorStoreMMRSearch()}) → Future< List< Document> > - Returns docs selected using the maximal marginal relevance algorithm (MMR) for the given query.
-
maxMarginalRelevanceSearchByVector(
{required List< double> embedding, VectorStoreMMRSearch config = const VectorStoreMMRSearch()}) → List<Document> - Returns docs selected using the maximal marginal relevance algorithm (MMR) for the given embedding vector.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
search(
{required String query, required VectorStoreSearchType searchType}) → Future< List< Document> > - Returns docs most similar to query using specified search type.
-
similaritySearch(
{required String query, VectorStoreSimilaritySearch config = const VectorStoreSimilaritySearch()}) → Future< List< Document> > - Returns docs most similar to query using similarity.
-
similaritySearchByVector(
{required List< double> embedding, VectorStoreSimilaritySearch config = const VectorStoreSimilaritySearch()}) → Future<List< Document> > - Returns docs most similar to embedding vector using similarity.
-
similaritySearchByVectorWithScores(
{required List< double> embedding, VectorStoreSimilaritySearch config = const VectorStoreSimilaritySearch()}) → Future<List< (Document, double)> > -
Returns docs and relevance scores in the range
[0, 1]
, 0 is dissimilar, 1 is most similar. -
similaritySearchWithScores(
{required String query, VectorStoreSimilaritySearch config = const VectorStoreSimilaritySearch()}) → Future< List< (Document, double)> > -
Returns docs and relevance scores in the range
[0, 1]
. 0 is dissimilar, 1 is most similar. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited