org.llm4s.rag
Members list
Packages
Type members
Classlikes
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
EmbeddingProvider.type
High-level RAG (Retrieval-Augmented Generation) pipeline.
High-level RAG (Retrieval-Augmented Generation) pipeline.
Provides a unified interface for:
- Document ingestion (from files, directories, or raw text)
- Semantic search with hybrid fusion
- Answer generation with retrieved context
Attributes
- Example
-
// Create pipeline val rag = RAG.builder() .withEmbeddings(EmbeddingProvider.OpenAI) .withChunking(ChunkerFactory.Strategy.Sentence, 800, 150) .build() .toOption.get // Ingest documents rag.ingest("./docs") // Search val results = rag.query("What is X?") // With answer generation (requires LLM client) val ragWithLLM = RAG.builder() .withEmbeddings(EmbeddingProvider.OpenAI) .withLLM(llmClient) .build() .toOption.get val answer = ragWithLLM.queryWithAnswer("What is X?") - Companion
- object
- Supertypes
-
trait Closeabletrait AutoCloseableclass Objecttrait Matchableclass Any
Result from RAG answer generation.
Result from RAG answer generation.
Value parameters
- answer
-
The generated answer text
- contexts
-
The chunks used as context for generation
- question
-
The original question
- usage
-
Optional token usage statistics
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Configuration for RAG pipeline.
Configuration for RAG pipeline.
Uses immutable copy pattern for fluent configuration. All settings have sensible defaults for quick start.
Attributes
- Example
-
// Minimal configuration val config = RAGConfig() .withEmbeddings(EmbeddingProvider.OpenAI) // Full customization with SQLite val config = RAGConfig() .withEmbeddings(EmbeddingProvider.OpenAI, "text-embedding-3-large") .withChunking(ChunkerFactory.Strategy.Sentence, 800, 150) .withRRF(60) .withSQLite("./rag.db") .withLLM(llmClient) // Using PostgreSQL with pgvector val config = RAGConfig() .withEmbeddings(EmbeddingProvider.OpenAI) .withPgVector("jdbc:postgresql://localhost:5432/mydb", "user", "pass", "embeddings") - Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Result from RAG search operation.
Result from RAG search operation.
Value parameters
- content
-
The text content of the chunk
- id
-
Chunk identifier
- keywordScore
-
Optional keyword match score
- metadata
-
Additional metadata (source, docId, etc.)
- score
-
Combined relevance score
- vectorScore
-
Optional vector similarity score
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
RAG pipeline statistics.
RAG pipeline statistics.
Value parameters
- chunkCount
-
Number of chunks indexed
- documentCount
-
Number of documents indexed
- vectorCount
-
Number of vectors in store
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
RerankingStrategy.type