SpringAiKoogVectorStore

class SpringAiKoogVectorStore(vectorStore: VectorStore, dispatcher: CoroutineDispatcher) : KoogVectorStore(source)

Adapts a Spring AI VectorStore to Koog storage abstractions.

Constructors

Link copied to clipboard
constructor(vectorStore: VectorStore, dispatcher: CoroutineDispatcher)

Functions

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

It adds documents with randomly generated ids for null ids, otherwise it adds documents with specified ids.

Link copied to clipboard
open suspend override fun delete(filterExpression: String, namespace: String?): List<String>

It deletes documents by filterExpression, but returns an empty list, because VectorStore does not return deleted ids.

open suspend override fun delete(ids: List<String>, namespace: String?): List<String>

It deletes documents by ids, but returns specified ids, because Spring AI VectorStore does not return deleted ids.

Link copied to clipboard
Link copied to clipboard
open suspend override fun search(request: SimilaritySearchRequest, namespace: String?): List<SearchResult<TextDocument>>

Does similarity search, because Spring AI VectorStore currently supports only similaritySearch.

Link copied to clipboard
open suspend override fun update(documents: Map<String, TextDocument>, namespace: String?): List<String>

It deletes old documents by their ids and adds new documents. Spring AI VectorStore does not support transactional update.