A product catalog RAG system stores items with metadata: category (string), price (float), in_stock (boolean), and release_date (ISO date). A user query is 'Show me affordable in-stock cameras released this year.' The retrieval pipeline currently embeds the full query and performs ANN search. Results include expensive cameras, out-of-stock cameras, and cameras from prior years. What is the most effective retrieval architecture?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — a is correct because pre-filtering with hard metadata constraints (in_stock=true, release_date within current year) before ANN search is the appropriate pattern when filter conditions are hard constraints that a matching result must satisfy. Applying these as pre-filters ensures the ANN search only scores documents that are eligible, so the top-k results are guaranteed to satisfy the constraints.
Full explanation below image
Full Explanation
A is correct because pre-filtering with hard metadata constraints (in_stock=true, release_date within current year) before ANN search is the appropriate pattern when filter conditions are hard constraints that a matching result must satisfy. Applying these as pre-filters ensures the ANN search only scores documents that are eligible, so the top-k results are guaranteed to satisfy the constraints. The semantic component ranks eligible items by relevance to 'cameras' and implicit affordability signals. B is wrong because post-filtering after ANN retrieval risks dropping below a useful number of results when the filtered-out fraction is large; if only 5% of products are in-stock 2026 cameras, top-20 ANN retrieval may return only 1 qualifying result. C is wrong because encoding numeric metadata into embedding vectors causes the embedding model to conflate price proximity with semantic similarity, degrading the model's ability to distinguish between product categories; metadata and semantics should be handled separately. D is wrong because pure keyword search for category identification misses synonyms and category variants; hybrid retrieval combining both is superior to replacing semantic search entirely.