LuceneRagFacetProvider

class LuceneRagFacetProvider constructor(val name: String, embeddingModel: <Error class: unknown class>? = null, vectorWeight: Double = 0.5, chunkerConfig: ContentChunker.Config = ContentChunker.DefaultConfig(), indexPath: Path? = null) : AbstractWritableContentElementRepository, RagFacetProvider, Closeable

LuceneRagService with optional vector search support via an EmbeddingModel. Supports both in-memory and disk-based persistence.

Constructors

Link copied to clipboard
constructor(name: String, embeddingModel: <Error class: unknown class>? = null, vectorWeight: Double = 0.5, chunkerConfig: ContentChunker.Config = ContentChunker.DefaultConfig(), indexPath: Path? = null)

Properties

Link copied to clipboard
open val name: String

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
open override fun count(): Int

Return the total number of content elements in the repository

Link copied to clipboard
open override fun facets(): List<RagFacet<out Retrievable>>
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
open override fun findChunksForEntity(entityId: 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

Manually trigger loading of existing chunks from disk. Useful for ensuring chunks are loaded immediately after startup.

Link copied to clipboard
open override fun onNewRetrievables(retrievables: List<Retrievable>)

The Retrievables have been saved to the store, but Retrievables are special, and we probably want to embed them

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
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.