Use HYBRID search when queries contain exact strings such as part numbers, because it adds a raw-text search to the vector search. Use a reranker model to reorder retrieved passages by relevance to the query. Use query decomposition when one question covers several things, because it splits the question into sub-queries before retrieval.
Search type
A knowledge base query can use semantic search, which searches only the vector embeddings, or hybrid search, which combines the vector search with a search of the raw text. If you set nothing, Amazon Bedrock picks the strategy for your vector store.
Set it in retrievalConfiguration.vectorSearchConfiguration.overrideSearchType as HYBRID or SEMANTIC. Hybrid search works only with Amazon RDS, Amazon OpenSearch Serverless and MongoDB vector stores that contain a filterable text field. With any other store, the query uses semantic search.
Example: sales staff ask for part HX-4410-B and get chunks about similar parts. Hybrid search finds the exact string while natural language questions keep their semantic matches.
Reranking
A reranker model scores each passage against the query and reorders them. You can retrieve fewer but more relevant results, which can lower the cost and latency of the generation call. Reranking works only on text.
There are two ways to use it. Call the Rerank operation directly with the query and a list of documents, which works for passages from any source, such as an Aurora pgvector table. Or add a reranking configuration to a Retrieve or RetrieveAndGenerate call on a knowledge base, where the reranked order overrides the knowledge base's default ranking.
Query decomposition and result count
Query decomposition breaks a complex query into smaller sub-queries, so more than one search can run against the knowledge base. A question that compares two products becomes one sub-query per product. It is set in a RetrieveAndGenerate request under orchestrationConfiguration.queryTransformationConfiguration with the type QUERY_DECOMPOSITION.
A query returns up to five results by default. numberOfResults sets the maximum, and fewer can come back. With hierarchical chunking, numberOfResults counts child chunks, and children that share a parent come back as one result.
Where the exam catches people
Believing a reranker fixes missed exact identifiers: a reranker only reorders what retrieval returned, so a chunk that was never retrieved stays missing. Hybrid search adds the raw-text match.
Believing hybrid search works with every vector store: it needs RDS, OpenSearch Serverless or MongoDB with a filterable text field, and otherwise falls back to semantic search.
Believing you need a knowledge base to use a Bedrock reranker: the Rerank operation takes inline documents from any source.
Believing a higher numberOfResults makes a comparison question cover both products: more passages can still all come from one product. Query decomposition searches for each part of the question.