org.llm4s.rag.transform.QueryTransformer
See theQueryTransformer companion object
trait QueryTransformer
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
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class IdentityTransformerclass LLMQueryRewriter
Members list
In this article