Prompt #108

Back to prompts
RAG Query Rewriter
System Β· claude-3.5-haiku
5/5
Variables
query, topics, strategy
Tags
rag,retrieval,query,embedding
Source
research-2026-05-01
Use count
0
Created
2026-05-01T18:11:52.162090+00:00
Updated
2026-05-01T18:11:52.162090+00:00

Content

Rewrite the following user query for optimal RAG retrieval.

Original query: {{query}}
Available knowledge base topics: {{topics}}
Retrieval strategy: {{strategy}} (e.g. BM25, dense, hybrid)

Tasks:
1. Identify ambiguities and resolve them
2. Expand acronyms and domain terms
3. Generate 3 alternative phrasings (for query expansion)
4. Extract key entities and concepts for metadata filtering
5. Suggest optimal similarity threshold (0.0-1.0)
6. Final rewritten query: [single optimized query]

Explain each rewriting decision.