LogoLogo
HomeNewsSupportVideos
  • Welcome
  • Wisej.NET
  • Concepts
    • Getting Started
    • General Concepts
    • Architecture
    • Extensibility
    • AI Providers
    • Vector Databases
    • Usage Metrics
    • Logging & Error Handling
  • Markup
  • Components
    • API
      • SmartAdapter
        • SmartAudioTTSAdapter
        • SmartAudioWhisperAdapter
        • SmartCalendarAdapter
        • SmartChartAdapter
        • SmartChartJS3Adapter
        • SmartChatBoxAdapter
        • SmartComboBoxAdapter
        • SmartCopilotAdapter
        • SmartDataEntryAdapter
        • SmartDocumentAdapter
        • SmartFullCalendarAdapter
        • SmartObjectAdapter
        • SmartPictureBoxAdapter
        • SmartQueryAdapter
        • SmartRealtimeAdapter
        • SmartReportAdapter
        • SmartTextBoxAdapter
        • SmartAdapter.ExtendsAttribute
        • SmartAdapter.FieldNameAttribute
        • SmartAdapter.FieldPromptAttribute
        • SmartAdapter.FieldRectangleAttribute
        • SmartAdapter.WorksWithAttribute
      • SmartEndpoint
        • AmazonBedrockEndpoint
        • AnthropicEndpoint
        • AzureAIEndpoint
        • CerebrasEndpoint
        • DeepSeekEndpoint
        • GoogleAIEndpoint
        • GroqCloudEndpoint
        • GroqCloudEndpointWhisper
        • HuggingFaceEndpoint
        • HuggingFaceJavaScriptEndpoint
        • LocalAIEndpoint
        • LocalAIEndpointImageGen
        • LocalAIEndpointTTS
        • LocalAIEndpointWhisper
        • NvidiaAIEndpoint
        • OllamaEndpoint
        • OpenAIEndpoint
        • OpenAIEndpointDallE
        • OpenAIEndpointRealtime
        • OpenAIEndpointTTS
        • OpenAIEndpointWhisper
        • SambaNovaEndpoint
        • SmartHttpEndpoint
        • TogetherAIEndpoint
        • XAIEndpoint
        • SmartEndpoint.Metrics
        • SmartEndpoint.Response
      • SmartExtensions
      • SmartHub
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
      • SmartObject
      • SmartPrompt
        • SmartAgentPrompt
        • SmartParallelPrompt
        • SmartPrompt.Parameter
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
      • SmartRealtimeSession
      • SmartSession
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.Message
        • SmartSession.MessageCollection
        • SmartSession.MessageRole
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
        • SmartSession.TrimmingStrategy
      • SmartTool
        • SmartTool.IToolProvider
        • SmartTool.ToolAttribute
        • SmartTool.ToolContext
      • Markup
        • MarkupExtensions
      • Controls
        • UVLightOverlay
      • Embeddings
        • EmbeddedDocument
        • Embedding
        • Matches
        • Metadata
      • Helpers
        • ApiKeys
        • Markdown
        • TextTokenizer
      • Services
        • DefaultSessionTrimmingService
        • IDocumentConversionService
          • DefaultDocumentConversionService
        • IEmbeddingGenerationService
          • DefaultEmbeddingGenerationService
          • HuggingFaceEmbeddingGenerationService
        • IEmbeddingStorageService
          • AzureAISearchEmbeddingStorageService
          • ChromaEmbeddingStorageService
          • FileSystemEmbeddingStorageService
          • MemoryEmbeddingStorageService
          • PineconeEmbeddingStorageService
          • QdrantEmbeddingStorageService
        • IHttpClientService
          • DefaultHttpClientService
        • ILoggerService
          • DefaultLoggerService
        • IOCRService
          • DefaultOCRService
        • IRerankingService
          • DefaultRerankingService
          • LocalAIRerankingService
          • PineconeRerankingService
        • ISessionTrimmingService
          • DefaultSessionTrimmingService
        • ITextSplitterService
          • RecursiveCharacterTextSplitterService
          • TextSplitterServiceBase
        • ITokenizerService
          • DefaultTokenizerService
        • IWebSearchService
          • BingWebSearchService
          • BraveWebSearchService
          • GoogleWebSearchService
      • Tools
        • ArxivTools
        • ChartJS3Tools
        • DatabaseTools
        • DataTableFilterTools
        • DocumentSearchTools
        • DocumentTools
        • FullCalendarTools
        • IToolsContainer
        • MathTools
        • ToolsContainer
        • UtilityTools
        • WebSearchTools
    • Built-in Services
      • IOCRService
      • ILoggerService
      • ITextSplitterService
      • ITokenizerService
      • IHttpClientService
      • IWebSearchService
      • IRerankingService
      • ISessionTrimmingService
      • IDocumentConversionService
      • IEmbeddingStorageService
      • IEmbeddingGenerationService
    • Built-in SmartTools
      • ToolsContainer
      • MathTools
      • UtilityTools
      • DatabaseTools
      • DocumentTools
      • DocumentSearchTools
      • WebSearchTools
      • ChartJS3Tools
      • FullCalendarTools
    • Built-in SmartAdapters
      • SmartAdapter
      • SmartAudioTTSAdapter
      • SmartAudioWhisperAdapter
      • SmartCalendarAdapter
      • SmartChartAdapter
      • SmartChartJS3Adapter
      • SmartChatBoxAdapter
      • SmartComboBoxAdapter
      • SmartCopilotAdapter
      • SmartDataEntryAdapter
      • SmartDocumentAdapter
      • SmartFullCalendarAdapter
      • SmartObjectAdapter
      • SmartPictureBoxAdapter
      • SmartQueryAdapter
      • SmartRealtimeAdapter
      • SmartReportAdapter
      • SmartTextBoxAdapter
    • Configure Services
    • Using SmartHub
    • Using SmartTools
    • Using SmartPrompt
    • Using SmartSession
    • Using SmartRealTimeAdapter
    • UVLightOverlay Control
Powered by GitBook
On this page
  • Constructors
  • MemoryEmbeddingStorageService()
  • Methods
  • ExistsAsync(collectionName, documentName)
  • QueryAsync(collectionName, query, topN, minSimilarity, filter)
  • QueryAsync(collectionName, documentName, query, topN, minSimilarity)
  • RemoveAsync(collectionName, filter)
  • RemoveAsync(collectionName, documentName)
  • RetrieveAsync(collectionName, documentName, includeEmbedding)
  • RetrieveAsync(collectionName, includeEmbedding, filter)
  • StoreAsync(collectionName, document)
  • Implements
Export as PDF
  1. Components
  2. API
  3. Services
  4. IEmbeddingStorageService

MemoryEmbeddingStorageService

Wisej.AI.Services.MemoryEmbeddingStorageService

PreviousFileSystemEmbeddingStorageServiceNextPineconeEmbeddingStorageService

Last updated 5 days ago

Namespace: Wisej.AI.Services

Assembly: Wisej.AI (3.5.0.0)

Provides an in-memory implementation of the interface.

public class MemoryEmbeddingStorageService : IEmbeddingStorageService
Public Class MemoryEmbeddingStorageService
    Inherits IEmbeddingStorageService

This service stores embedded documents in memory using a dictionary. It supports operations such as checking for existence, querying, removing, retrieving, and storing documents.

Constructors

MemoryEmbeddingStorageService()

Initializes a new instance of .

Methods

ExistsAsync(collectionName, documentName)

Checks if a document exists in the specified collection.

Parameter
Type
Description

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.

Parameter
Type
Description

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.

Parameter
Type
Description

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.

Parameter
Type
Description

collectionName

The name of the collection.

An optional filter predicate to apply to documents. Default is null.

Removes a specific document from the collection.

Parameter
Type
Description

collectionName

The name of the collection.

documentName

The name of the document.

Retrieves a specific document from the collection.

Parameter
Type
Description

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.

Parameter
Type
Description

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.

Parameter
Type
Description

collectionName

The name of the collection.

document

The document to store.

Throws:

Implements

Name
Description

Represents a service for storing and querying embedded documents within specified collections.

QueryAsync(collectionName, query, topN, minSimilarity, filter)

filter

Returns: . A task that represents the asynchronous operation. The task result contains an array of objects.

QueryAsync(collectionName, documentName, query, topN, minSimilarity)

Returns: . A task that represents the asynchronous operation. The task result contains the with the top similar chunks.

Thrown when the document is null.

RemoveAsync(collectionName, filter)

filter

Returns: . A task that represents the asynchronous operation.

RemoveAsync(collectionName, documentName)

Returns: . A task that represents the asynchronous operation.

RetrieveAsync(collectionName, documentName, includeEmbedding)

Returns: . A task that represents the asynchronous operation. The task result contains the .

RetrieveAsync(collectionName, includeEmbedding, filter)

filter

Returns: . A task that represents the asynchronous operation. The task result contains an array of objects.

StoreAsync(collectionName, document)

Returns: . A task that represents the asynchronous operation.

Thrown when the document is null.

Task<EmbeddedDocument[]>
EmbeddedDocument
Task<EmbeddedDocument>
EmbeddedDocument
ArgumentNullException
Task
Task
Task<EmbeddedDocument>
EmbeddedDocument
Task<EmbeddedDocument[]>
EmbeddedDocument
Task
ArgumentNullException
String
String
String
Single[]
Int32
Single
Predicate<EmbeddedDocument>
String
String
Single[]
Int32
Single
String
Predicate<EmbeddedDocument>
String
String
String
String
Boolean
String
Boolean
Predicate<EmbeddedDocument>
String
EmbeddedDocument
IEmbeddingStorageService
IEmbeddingStorageService
MemoryEmbeddingStorageService
Task<Boolean>