JVMFileDocumentEmbeddingStorage

A file-system-based VectorStorage implementation for managing and embedding documents represented by file paths.

This class extends EmbeddingStorage and is specialized for JVM-based systems where documents are represented as file paths (java.nio.file.Path). It combines a DocumentEmbedder for embedding the file content into vectors and a ai.koog.rag.vector.backend.JVMFileVectorStorageBackend for managing the storage and retrieval of these embeddings along with their associated documents.

Parameters

embedder

The embedder responsible for generating vector representations of file-based documents.

root

The root directory path used as the base for file-based vector storage.

Constructors

Link copied to clipboard
constructor(embedder: DocumentEmbedder<Path>, root: Path)

Creates an instance of JVMFileDocumentEmbeddingStorage.

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>