What is query rewriting in RAG?
Simple meaning
Query rewriting uses an LLM or rules to expand, correct, or split the user question into better search strings.
Open the full page for Why, Steps, Example and Key takeaway.
Panel-ready GenAI / LLM questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.
Query rewriting uses an LLM or rules to expand, correct, or split the user question into better search strings.
Open the full page for Why, Steps, Example and Key takeaway.
A reranker scores the first-stage hits more carefully, often with a cross-encoder.
Open the full page for Why, Steps, Example and Key takeaway.
HyDE generates a hypothetical answer, embeds that, and searches with the hypothetical embedding.
Open the full page for Why, Steps, Example and Key takeaway.
You generate several paraphrased queries, retrieve for each, and merge unique chunks.
Open the full page for Why, Steps, Example and Key takeaway.
Retrieval can miss the right chunk, return conflicting sources, or pack so much text that the model ignores the key sentence.
Open the full page for Why, Steps, Example and Key takeaway.
Re-embed changed chunks, upsert by stable IDs, and delete vectors for removed content.
Open the full page for Why, Steps, Example and Key takeaway.
You restrict candidates by tenant, date, product, or ACL before or during ANN search.
Open the full page for Why, Steps, Example and Key takeaway.
HNSW is a graph index with strong recall and simple incremental inserts, at higher memory cost.
Open the full page for Why, Steps, Example and Key takeaway.
Cosine cares about angle, L2 about Euclidean distance, inner product about both direction and magnitude.
Open the full page for Why, Steps, Example and Key takeaway.
Providing relevant passages and requiring citations reduces unsupported claims.
Open the full page for Why, Steps, Example and Key takeaway.
Citations let users and evals check claims against retrieved IDs.
Open the full page for Why, Steps, Example and Key takeaway.
Lower it for extraction, classification, SQL, and customer-support facts.
Open the full page for Why, Steps, Example and Key takeaway.
Temperature shapes the full distribution
Open the full page for Why, Steps, Example and Key takeaway.
Fine-tuned facts are frozen until the next training run.
Open the full page for Why, Steps, Example and Key takeaway.
Parameter-efficient fine-tuning trains small adapter matrices instead of all weights.
Open the full page for Why, Steps, Example and Key takeaway.
Further training on a narrow dataset can erase general skills the base model had.
Open the full page for Why, Steps, Example and Key takeaway.
Fine-tune for house style, tool schemas, and refusal policy
Open the full page for Why, Steps, Example and Key takeaway.
Loaders ingest PDFs, HTML, and databases into Document objects.
Open the full page for Why, Steps, Example and Key takeaway.
Buffer memory stores raw turns, summary memory compresses old history, and vector memory retrieves past facts by similarity.
Open the full page for Why, Steps, Example and Key takeaway.
LangChain Expression Language composes steps as runnable units with standard invoke, batch, and stream methods.
Open the full page for Why, Steps, Example and Key takeaway.