FileVectorStorage

FileVectorStorage is a class that manages the storage and retrieval of documents and their corresponding vector embeddings within a file system. It uses a DocumentProvider to handle document content and a FileSystemProvider to interact with the file system for storing and reading data.

Parameters

Document

Type representing the document to be stored.

Path

Type representing the file path in the storage system.

documentReader

A provider responsible for handling document serialization and deserialization.

fs

A file system provider enabling read and write operations for file storage.

root

Root file path where the storage system will organize data.

Inheritors

Constructors

Link copied to clipboard
constructor(documentReader: DocumentProvider<Path, Document>, fs: FileSystemProvider.ReadWrite<Path>, root: Path)

Functions

Link copied to clipboard
open override fun allDocuments(): Flow<Document>
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): Document?
Link copied to clipboard
open suspend override fun readWithPayload(documentId: String): DocumentWithPayload<Document, Vector>?
Link copied to clipboard
open suspend override fun store(document: Document, data: Vector): String