JVMFileEmbeddingStorage

A JVM-specific implementation of TextFileDocumentEmbeddingStorage tailored for text document embedding and storage within a file system. This class utilizes a ai.koog.rag.base.files.JVMDocumentProvider to handle document reading and manages embeddings using a provided ai.koog.embeddings.base.Embedder.

Parameters

embedder

The embedding implementation used to generate and compare vector embeddings.

root

The root directory where the document storage system is initialized.

Constructors

Link copied to clipboard
constructor(embedder: Embedder, root: Path)

Creates an instance of JVMFileEmbeddingStorage.

Properties

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

Functions

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

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<Path>
Link copied to clipboard
open override fun rankDocuments(query: String): Flow<SearchResult<Path>>
Link copied to clipboard
open suspend override fun search(request: SimilaritySearchRequest, namespace: String?): List<SearchResult<Path>>
Link copied to clipboard
open fun supports(capability: StorageCapability): Boolean
Link copied to clipboard
open suspend override fun update(documents: Map<String, Path>, namespace: String?): List<String>