WeaviateDocumentStore<T>

Models & Types · AiDotNet.RetrievalAugmentedGeneration.DocumentStores

Weaviate vector-database document store backed by the real Weaviate REST/GraphQL API.

Inheritance: DocumentStoreBase<T> → WeaviateDocumentStore<T>

Implements: IDisposable

For Beginners

Weaviate is an open-source vector database with a GraphQL API. This class is a real client for it - every method here makes an HTTP call to your Weaviate server. Weaviate requires object ids to be UUIDs, so each document’s string id is turned into a deterministic UUID; the original string id is kept in the docId property so you always get it back.

How It Works

This store talks to a running Weaviate instance over HTTP. It manages a single class, upserts objects (vector + properties), performs nearVector GraphQL search with a where filter, deletes objects and cursor-pages the whole class. The original document id and content are stored under the reserved properties docId and content; the full metadata dictionary is stored as a JSON string under metadataJson (for lossless round-tripping) while each scalar metadata entry is also flattened to a m_<key> property so it can be used in server-side where filters.

Constructors

Constructor Summary
WeaviateDocumentStore(string className, string url, string apiKey, DistanceMetricType distanceMetric, int vectorDimension, HttpClient httpClient, HttpMessageHandler handler) Initializes a new instance of the WeaviateDocumentStore class.

Properties

Property Summary
int DocumentCount { get; } Gets the number of documents (objects) currently stored in the class.
int VectorDimension { get; } Gets the dimensionality of vectors stored in this class.
string ClassName { get; } Gets the name of the Weaviate class 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.