LuceneRagService

class LuceneRagService constructor(val name: String, val description: String, embeddingModel: <Error class: unknown class>? = null, vectorWeight: Double = 0.5) : AbstractWritableRagService, Closeable

LuceneRagService with optional vector search support via an EmbeddingModel. Works in memory. Be careful if loading excessive content!

Constructors

Link copied to clipboard
constructor(name: String, description: String, embeddingModel: <Error class: unknown class>? = null, vectorWeight: Double = 0.5)

Properties

Link copied to clipboard
Link copied to clipboard
open override val name: String

Name of the RAG service. Should be unique per application instance. User code may use this to select a RAG service.

Functions

Link copied to clipboard
open fun accept(documents: List<<Error class: unknown class>>)
Link copied to clipboard
fun clear()

Clear all stored content - useful for testing

Link copied to clipboard
open override fun close()
Link copied to clipboard
Link copied to clipboard
open override fun findById(id: String): ContentElement?
Link copied to clipboard
open override fun findChunksById(chunkIds: List<String>): List<Chunk>
Link copied to clipboard

Get statistics about the current state

Link copied to clipboard
open fun infoString(verbose: Boolean?, indent: Int): String
Link copied to clipboard
open fun provision()

Provision this rag service if necessary

Link copied to clipboard
open override fun save(element: ContentElement): ContentElement
Link copied to clipboard
open override fun search(ragRequest: RagRequest): RagResponse

Make a RAG request

Link copied to clipboard

Will call save on the root and all descendants. The database only needs to store each descendant and link by id, rather than otherwise consider the entire structure.