MemoryEmbeddingStorageService
Wisej.AI.Services.MemoryEmbeddingStorageService
Last updated
Wisej.AI.Services.MemoryEmbeddingStorageService
Last updated
Namespace: Wisej.AI.Services
Assembly: Wisej.AI (3.5.0.0)
Provides an in-memory implementation of the interface.
This service stores embedded documents in memory using a dictionary. It supports operations such as checking for existence, querying, removing, retrieving, and storing documents.
Initializes a new instance of .
Checks if a document exists in the specified collection.
collectionName
The name of the collection.
documentName
The name of the document.
Returns: . A task that represents the asynchronous operation. The task result contains a boolean indicating whether the document exists.
Queries the specified collection for documents similar to the provided query vector.
collectionName
The name of the collection.
query
The query vector to compare against.
topN
The number of top similar documents to return.
minSimilarity
The minimum similarity threshold for documents to be considered.
An optional filter predicate to apply to documents. Default is null.
Queries a specific document in the collection for similarity to the provided query vector.
collectionName
The name of the collection.
documentName
The name of the document.
query
The query vector to compare against.
topN
The number of top similar chunks to return.
minSimilarity
The minimum similarity threshold for chunks to be considered.
Throws:
Removes documents from the specified collection that match the given filter.
collectionName
The name of the collection.
An optional filter predicate to apply to documents. Default is null.
Removes a specific document from the collection.
collectionName
The name of the collection.
documentName
The name of the document.
Retrieves a specific document from the collection.
collectionName
The name of the collection.
documentName
The name of the document.
includeEmbedding
Indicates whether to include the embedding in the retrieved document.
Retrieves all documents from the specified collection that match the given filter.
collectionName
The name of the collection.
includeEmbedding
Indicates whether to include the embedding in the retrieved documents.
An optional filter predicate to apply to documents. Default is null.
Stores a document in the specified collection.
collectionName
The name of the collection.
document
The document to store.
Throws:
Represents a service for storing and querying embedded documents within specified collections.
filter
Returns: . A task that represents the asynchronous operation. The task result contains an array of objects.
Returns: . A task that represents the asynchronous operation. The task result contains the with the top similar chunks.
Thrown when the document is null.
filter
Returns: . A task that represents the asynchronous operation.
Returns: . A task that represents the asynchronous operation.
Returns: . A task that represents the asynchronous operation. The task result contains the .
filter
Returns: . A task that represents the asynchronous operation. The task result contains an array of objects.
Returns: . A task that represents the asynchronous operation.
Thrown when the document is null.