MilvusDocumentStore<T>

Models & Types ยท AiDotNet.RetrievalAugmentedGeneration.DocumentStores

Milvus vector-database document store backed by the real Milvus v2 REST API (/v2/vectordb/*).

Inheritance: DocumentStoreBase<T> โ†’ MilvusDocumentStore<T>

Implements: IDisposable

For Beginners

Milvus is an open-source vector database. This class is a real client for it - every method here makes an HTTP call to your Milvus server using its REST API. Milvus wraps every response in a { "code": 0, "data": ... } envelope; a non-zero code means the operation failed.

How It Works

This store talks to a running Milvus instance over HTTP. It manages a single collection with a VarChar primary key and dynamic fields enabled, upserts entities (vector + fields), performs filtered vector search, deletes entities by id and queries the whole collection with paging. The original content is stored under content; the full metadata dictionary is stored as a JSON string under metadata_json (for lossless round-tripping) while each scalar metadata entry is also flattened to a m_<key> dynamic field so it can be used in filter expressions.

Constructors

Constructor Summary
MilvusDocumentStore(string collectionName, string url, string token, DistanceMetricType distanceMetric, int vectorDimension, HttpClient httpClient, HttpMessageHandler handler) Initializes a new instance of the MilvusDocumentStore class.

Properties

Property Summary
int DocumentCount { get; } Gets the number of documents (entities) currently stored in the collection.
int VectorDimension { get; } Gets the dimensionality of vectors stored in this collection.
string CollectionName { get; } Gets the name of the Milvus collection this store is bound to.

Methods

Method Summary
Task ClearAsync(CancellationToken cancellationToken)
void Clear()
void Dispose() Releases the HTTP client when this store created it.