AWS Builder Center

Beyond Basic RAG: 6 Techniques to Improve Retrieval Quality in GenAI Apps

Basic RAG often returns weak answers. Learn six practical techniques, including better chunking, hybrid search, reranking, and metadata filters, that improve retrieval.

A basic RAG system works like this: split documents, embed them, retrieve the top matches, and let the model answer. It's a great start, but real-world results can be disappointing. The model is usually not the problem. Retrieval is. If the wrong chunks are retrieved, even the best model produces a poor answer.
Here are six techniques to improve it.

1. Chunk with intention

Chunks that are too small lose context. Chunks that are too large bury the answer in noise.
  • Try different chunk sizes and compare results
  • Respect document structure, such as headings and sections
  • Use overlap so ideas aren't cut in half
  • Consider hierarchical chunking: retrieve small chunks, but pass the larger parent section to the model

2. Use hybrid search

Vector search finds meaning, but can miss exact terms like product codes, names, or error IDs. Keyword search is the opposite. Hybrid search combines both, so you get semantic matches and exact matches.

3. Add a reranker

First retrieve a larger set of candidates (say 20), then use a reranking model to score how well each one answers the question, and keep the best few (say 5). This often improves relevance noticeably at modest cost.

4. Filter with metadata

Attach metadata to documents, such as department, date, product, or document type, and filter before or during search. A question about the 2026 policy should not retrieve the 2019 one.

5. Rewrite the query

Users write short, vague, or conversational questions. You can use a model to:
  • Expand an unclear question into a clearer search query
  • Split a complex question into several sub-queries
  • Rewrite follow-ups like "what about the second one?" into standalone questions using chat history

6. Make the model show its evidence

  • Require citations to the retrieved chunks
  • Instruct the model to say "I don't know" when the context doesn't contain the answer
  • Consider grounding checks that flag unsupported claims

Quick reference

Symptom
Likely fix
Answer is vague or partial
Better chunking, parent-document retrieval
Misses exact names or codes
Hybrid search
Right document, wrong passage
Reranking
Outdated or wrong-scope answers
Metadata filters
Follow-up questions fail
Query rewriting
Confident but unsupported answers
Citations, grounding checks

Where this fits on AWS

Amazon Bedrock Knowledge Bases supports options such as configurable chunking strategies, metadata filtering, and reranking, and the exact feature set keeps expanding. Read the current documentation to see which options your chosen vector store supports.

Change one thing at a time

When tuning RAG, change a single variable, test against the same set of questions, and compare. Otherwise you won't know what helped. (The next step is building an evaluation set, which is a topic for another article.)

Conclusion

Good RAG is mostly good retrieval. Improving chunking, search, ranking, and filtering often matters more than switching to a bigger model.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article