VectorStore class abstract
Stores embedded documents and finds the ones most similar to a query vector.
rag_kit ships with InMemoryVectorStore. Implement this interface to back retrieval with something else, for example a database with a vector extension. All methods are asynchronous so that remote implementations fit the same interface.
- Implementers
Constructors
- VectorStore()
-
Allows subclasses to have const constructors.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → Future< void> - Removes all documents.
-
count(
) → Future< int> - The number of stored documents.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeWhere(
bool test(Document document)) → Future< int> -
Removes every document for which
testreturns true. -
search(
List< double> query, {int topK = 5, double? minScore, bool where(Document document)?}) → Future<List< ScoredChunk> > -
Returns up to
topKdocuments most similar toquery, best first. -
toString(
) → String -
A string representation of this object.
inherited
-
upsert(
List< Document> documents) → Future<void> -
Inserts
documents, replacing any existing document with the same id.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited