QueryRewriterAgent
Defined in the query_rewriter_agent module.Agent for rewriting queries to improve retrieval quality in RAG applications. This agent transforms user queries using various strategies to bridge the gap between how users ask questions and how information is stored in knowledge bases. Attributes: name: Name of the agent model: LLM model to use for rewriting (alias for llm=) max_queries: Maximum number of queries to generate for multi-query strategy abbreviations: Dictionary of common abbreviations to expand
Constructor
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
No description available.
Methods
agent()
Lazy initialization of internal Agent.
rewrite()
Rewrite a query using the specified strategy.
rewrite_basic()
Convenience method for basic rewriting.
rewrite_hyde()
Convenience method for HyDE rewriting.
rewrite_step_back()
Convenience method for step-back rewriting.
rewrite_sub_queries()
Convenience method for sub-query decomposition.
rewrite_multi_query()
Convenience method for multi-query generation.
rewrite_contextual()
Convenience method for contextual rewriting.
add_abbreviation()
Add a custom abbreviation expansion.
add_abbreviations()
Add multiple custom abbreviation expansions.

