org.llm4s.rag.transform
Members list
Type members
Classlikes
Pass-through transformer that returns the query unchanged.
Pass-through transformer that returns the query unchanged.
Useful for:
- Testing pipeline composition without side effects
- Default/placeholder when no transformation is needed
- Verifying that the transform chain is invoked correctly
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
IdentityTransformer.type
Rewrites user queries using an LLM to improve retrieval quality.
Rewrites user queries using an LLM to improve retrieval quality.
Takes vague, conversational, or poorly-formed queries and rewrites them into precise search queries optimized for semantic vector search.
Value parameters
- llmClient
-
The LLM client to use for rewriting
- systemPrompt
-
Custom system prompt (uses default if not provided)
Attributes
- Example
-
val rewriter = LLMQueryRewriter(llmClient) rewriter.transform("tell me about that config thing") // Right("RAGConfig configuration options builder pattern settings") rewriter.transform("how do I use it with postgres?") // Right("PostgreSQL pgvector integration RAG pipeline configuration") - Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
LLMQueryRewriter.type
Composable pre-retrieval query transformation.
Composable pre-retrieval query transformation.
QueryTransformers modify user queries before they are embedded and sent to the vector store, improving retrieval quality.
Transforms are applied sequentially in the order they are added to RAGConfig. Each transform receives the output of the previous one.
Attributes
- Example
-
val rag = RAG.builder() .withEmbeddings(EmbeddingProvider.OpenAI) .withQueryTransformer(LLMQueryRewriter(llmClient)) .build() // "tell me about that config thing" // → rewritten to "RAGConfig configuration options and builder pattern" // → then embedded and searched val results = rag.query("tell me about that config thing") - Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class IdentityTransformerclass LLMQueryRewriter
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
QueryTransformer.type