Query Expansion
AI / AgentExpand a search query with synonyms and stemmed variants to improve retrieval recall in RAG pipelines.
Feed in a search query and get back synonyms and stemmed variants to widen a keyword-based search, useful for improving recall in a BM25 or Elasticsearch query, or for adding lexical variety alongside embeddings in a RAG retrieval step. Expansion comes from a fixed synonym dictionary plus simple suffix-stripping rules (-ing, -ed, -s, -er), not an LLM or a tool like WordNet, so it covers common English word relationships well but won't expand domain-specific jargon or unusual terms. Over-expanding a query can also hurt precision by pulling in irrelevant matches, so it's worth treating the output as candidates to review rather than something to feed straight into production search without a look. Everything runs locally with a static lookup table.
How to use Query Expansion
- 1.Type a search query to get a list of synonyms and stemmed variants you can OR together to improve recall in a keyword or hybrid search pipeline.
- 2.Use the expanded terms to widen a BM25 or Elasticsearch query that's returning too few results for short, ambiguous queries.
- 3.Feed the expanded query list into your RAG retrieval step as an alternative to (or alongside) embedding-based retrieval.
Frequently asked questions
Use via API, SDK, or MCP
cURL# Free: 1,000 req/day · Pro: 10,000 req/day
curl -X POST https://api.utilix.tech/v1/tools/expand-query \
-H "Authorization: Bearer utx_live_..." \
-H "Content-Type: application/json" \
-d '{"query": "machine learning", "maxSynonyms": 5}'Get an API key from your dashboard · Full API docs →