InMemoryTextDocumentEmbeddingStorage

Implementation of an in-memory storage solution for text document embeddings.

This class leverages the functionality of an embedder and a document provider to compute embeddings for text documents and store them in memory for efficient retrieval.

Parameters

embedder

The embedder used for generating vectorized representations of text.

documentReader

The document provider facilitating access to document contents.

Type Parameters

Document

The type representing the document being managed.

Path

The type representing the path or identifier for locating documents.

Constructors

Link copied to clipboard
constructor(embedder: Embedder, documentReader: DocumentProvider<Path, Document>)

Properties

Link copied to clipboard
open override val capabilities: Set<StorageCapability>

Functions

Link copied to clipboard
open suspend override fun add(documents: List<Document>, namespace: String?): List<String>
Link copied to clipboard

Retrieves a flow of all documents stored in the system.

Link copied to clipboard
open suspend override fun delete(ids: List<String>, namespace: String?): List<String>
Link copied to clipboard
open suspend override fun get(ids: List<String>, namespace: String?): List<Document>
Link copied to clipboard
open override fun rankDocuments(query: String): Flow<SearchResult<Document>>
Link copied to clipboard
open suspend override fun search(request: SimilaritySearchRequest, namespace: String?): List<SearchResult<Document>>
Link copied to clipboard
open fun supports(capability: StorageCapability): Boolean
Link copied to clipboard
open suspend override fun update(documents: Map<String, Document>, namespace: String?): List<String>