IVectorIndex<T>
Interfaces · AiDotNet.RetrievalAugmentedGeneration.VectorSearch.Indexes
Interface for vector search indexes.
Known implementations: AnnVectorIndex<T>, FlatIndex<T>, GpuFlatIndex<T>, HNSWIndex<T>, IVFIndex<T>, LSHIndex<T>, QuantizedFlatIndex<T>
Properties
| Property | Summary |
|---|---|
int Count { get; } |
Gets the number of vectors in the index. |
Methods
| Method | Summary |
|---|---|
List<ValueTuple<string, T>> Search(Vector<T> query, int k) |
Searches for the k nearest neighbors to the query vector. |
bool Remove(string id) |
Removes a vector from the index. |
void Add(string id, Vector<T> vector) |
Adds a vector to the index. |
void AddBatch(Dictionary<string, Vector<T>> vectors) |
Adds multiple vectors to the index in batch. |
void Clear() |
Clears all vectors from the index. |