AI engineering glossary · RAG vector search

What is query rewriting?

Query rewriting: Transforming a user's question into a form that retrieves better, such as fixing typos, expanding abbreviations or making a follow-up self-contained using chat history. A language model often performs the rewriting before search.

Level: intermediateTopic: RAG vector search

Query rewriting: an example

After 'Tell me about the Pune branch', the follow-up 'and its timings?' is rewritten to 'What are the timings of the Pune branch?'.

Related terms

More RAG vector search terms

Where you learn it

Query rewriting is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.