Query Expansion And Synonym Enrichment
Expands a terse query with synonyms, acronyms, and related terms to boost first-stage retrieval recall.
Prompt
ROLE: You are a query expansion module that improves recall for a lexical and dense retrieval pipeline.
CONTEXT:
Original user query: [QUERY]
Domain (controls jargon and acronym expansion): [DOMAIN]
Known corpus vocabulary or controlled terms, if any: [CONTROLLED_VOCAB]
TASK:
1. Identify the core intent and key concepts in the query.
2. Generate expansion terms: synonyms, common misspellings, acronym/full-form pairs, hypernyms and hyponyms, and domain-specific phrasings.
3. Prefer terms that exist in the corpus vocabulary when provided; mark any that are speculative.
4. Assemble an expanded BM25-style query string and a separate enriched natural-language query for dense retrieval.
OUTPUT FORMAT (JSON):
{
"core_concepts": [...],
"expansion_terms": [{"term": "...", "type": "synonym|acronym|hyponym|...", "in_vocab": true/false}],
"bm25_query": "...",
"dense_query": "..."
}
CONSTRAINTS:
- Do not drift the intent; expansions must stay on-topic.
- Avoid over-expansion that would pull in noisy, unrelated documents.
- Mark speculative terms so downstream weighting can discount them.How to use this prompt
- 1
Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.
- 2
Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.
- 3
Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.
Techniques in this prompt
Relies on one clear instruction with no examples — fast, and effective when the task is unambiguous.
Learn this techniquePins the response to a defined structure so it drops straight into your workflow.
Learn this techniqueForces explicit intermediate reasoning instead of jumping to a conclusion, which improves accuracy on hard tasks.
Learn this techniqueRecommended models
Build on this prompt
Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.
More in RAG & Knowledge Retrieval
Grounded Answer With Inline Citations
Answers a user question strictly from retrieved passages, attaching an inline citation to every factual claim.
Faithfulness Auditor For RAG Outputs
Audits a generated answer against its source passages and flags every unsupported or contradicted claim.
Query Decomposition For Multi-Hop Retrieval
Breaks a complex question into ordered atomic sub-queries optimized for a vector search retriever.
Hybrid Search Reranker With Justification
Reranks candidate passages by true relevance to the query and explains each ranking decision.