- Newest
- Most votes
- Most comments
Thank you for reporting this issue. Based on the configuration you've shared, it appears you're experiencing a conflict between query decomposition and metadata filtering in your Knowledge Base retrieval setup.
Query decomposition is a query expansion technique that breaks complex queries into targeted sub-questions to improve retrieval effectiveness. However, when combined with metadata filters, there may be challenges in how the decomposed sub-queries interact with your filter conditions.
When you enable query decomposition, the system transforms your original query into multiple sub-questions. If your metadata filter is restrictive (filtering on a specific key-value pair), it's possible that:
- The decomposed sub-queries may not align well with your filtered dataset
- Each sub-query is being evaluated against the same filter, potentially resulting in no matches for some sub-questions
- The orchestration layer may be failing to aggregate results properly when filters are applied to decomposed queries
Your workaround of removing query decomposition is a valid approach, especially if your queries are relatively straightforward and don't require decomposition. Alternatively, you could consider:
- Adjusting your metadata filter to be less restrictive (if appropriate for your use case)
- Using query decomposition without filters, or filters without query decomposition
- Increasing the numberOfResults to ensure sufficient chunks are retrieved for each sub-query
- Testing with different query formulations that may work better with your filter constraints
This appears to be a configuration interaction issue rather than a bug per se, but it's valuable feedback for others implementing similar retrieval patterns with Knowledge Bases.
Sources
Evaluate and improve performance of Amazon Bedrock Knowledge Bases | AWS Machine Learning Blog
RetrieveAndGenerate - Amazon Bedrock
Relevant content
- asked a year ago
