JVMFileVectorStorage

A JVM-specific implementation of FileVectorStorage for managing the storage of documents and associated vector embeddings on a file system.

This class utilizes a JVMDocumentProvider along with a JVM-compatible FileSystemProvider.ReadWrite to handle document operations and vector storage in a structured directory format. It uses a root directory as the base for storing documents and their associated embeddings in separate directories.

Use this class to persistently store and retrieve documents and their vector payloads to and from a file-based system in JVM environments.

Parameters

root

The root directory where all documents and vector embeddings will be stored.

Constructors

Link copied to clipboard
constructor(root: Path)

Initializes the JVMFileVectorStorage with a specified root directory root.

Functions

Link copied to clipboard
open override fun allDocuments(): Flow<Path>
Link copied to clipboard
Link copied to clipboard
open suspend override fun delete(documentId: String): Boolean
Link copied to clipboard
open suspend override fun getPayload(documentId: String): Vector?
Link copied to clipboard
open suspend override fun read(documentId: String): Path?
Link copied to clipboard
open suspend override fun readWithPayload(documentId: String): DocumentWithPayload<Path, Vector>?
Link copied to clipboard
open suspend override fun store(document: Path, data: Vector): String