SQLiteDocumentRegistry

org.llm4s.rag.loader.SQLiteDocumentRegistry
See theSQLiteDocumentRegistry companion object
@Experimental

A DocumentRegistry in a SQLite file, so that RAG.sync survives a restart of a single-process application: the next sync re-embeds only what changed and deletes what the source dropped while the process was down. It pairs with RAGConfig.withSQLite; for several processes sharing one index, use PgDocumentRegistry.

It holds one connection, and serialises calls on it. close closes it.

Attributes

Companion
object
Source
SQLiteDocumentRegistry.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

Get all registered document IDs, of every source.

Get all registered document IDs, of every source.

Attributes

Returns

Set of all document IDs currently registered

Source
SQLiteDocumentRegistry.scala
def clear(): Result[Unit]

Clear all registrations, of every source.

Clear all registrations, of every source.

Attributes

Source
SQLiteDocumentRegistry.scala
override def close(): Unit

Attributes

Definition Classes
Source
SQLiteDocumentRegistry.scala
def documentIds(sourceId: String): Result[Set[String]]

Get the IDs of the documents sourceId owns.

Get the IDs of the documents sourceId owns.

Value parameters

sourceId

The source

Attributes

Returns

The IDs of its registered documents

Source
SQLiteDocumentRegistry.scala

Check if document exists and get its version.

Check if document exists and get its version.

Value parameters

docId

Document identifier

Attributes

Returns

Version if document is registered, None otherwise

Source
SQLiteDocumentRegistry.scala
def register(docId: String, version: DocumentVersion, sourceId: String): Result[Unit]

Register a document as indexed, owned by sourceId. Registering a document again replaces its version and moves it to sourceId.

Register a document as indexed, owned by sourceId. Registering a document again replaces its version and moves it to sourceId.

Value parameters

docId

Document identifier

sourceId

The source the document belongs to

version

Document version at time of indexing

Attributes

Source
SQLiteDocumentRegistry.scala
def unregister(docId: String): Result[Unit]

Unregister a document (deleted from source).

Unregister a document (deleted from source).

Value parameters

docId

Document identifier to remove

Attributes

Source
SQLiteDocumentRegistry.scala

Inherited methods

def contains(docId: String): Result[Boolean]

Check if a document is registered.

Check if a document is registered.

Attributes

Inherited from:
DocumentRegistry
Source
DocumentRegistry.scala
def count(): Result[Int]

Get the count of registered documents.

Get the count of registered documents.

Attributes

Inherited from:
DocumentRegistry
Source
DocumentRegistry.scala
def register(docId: String, version: DocumentVersion): Result[Unit]

Register a document as indexed, under DocumentRegistry.DefaultSourceId.

Register a document as indexed, under DocumentRegistry.DefaultSourceId.

Value parameters

docId

Document identifier

version

Document version at time of indexing

Attributes

Inherited from:
DocumentRegistry
Source
DocumentRegistry.scala

Concrete fields

val dbPath: String

Attributes

Source
SQLiteDocumentRegistry.scala