{"type":"excalidraw","version":2,"source":"https://AwesomeSystemDesign.dev","elements":[{"angle":0,"strokeColor":"#628572","backgroundColor":"#edf5ee","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-1"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-1"}],"updated":0,"link":null,"locked":false,"id":"shape-0","type":"rectangle","seed":41,"x":30,"y":30,"width":462.94636,"height":68,"customData":{"revealStep":1}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-1"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-1","type":"text","seed":114,"x":50,"y":52.3,"width":422.94636,"height":23.400000000000002,"fontSize":18,"fontFamily":1,"text":"Improve Retrieval by Transforming the Query","originalText":"Improve Retrieval by Transforming the Query","textAlign":"left","verticalAlign":"middle","containerId":"shape-0","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":1}},{"angle":0,"strokeColor":"#a68a53","backgroundColor":"#fff7e6","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-3"}],"updated":0,"link":null,"locked":false,"id":"shape-2","type":"rectangle","seed":187,"x":30,"y":123,"width":588.3401200000001,"height":293.40000000000003,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-3","type":"text","seed":260,"x":50,"y":141,"width":548.3401200000001,"height":257.40000000000003,"fontSize":18,"fontFamily":1,"text":"Technique 1: HyDE (Hypothetical Document Embedding)\nUser query: \"refund policy for EU\"\nStep 1: Ask LLM to generate a hypothetical answer\n→ \"The EU refund policy states that customers in the EU\nare entitled to a 14-day cooling-off period under the\nConsumer Rights Directive. Full refunds are provided...\"\nStep 2: Embed the hypothetical answer (not the query!)\nStep 3: Search with this embedding\nWhy: Hypothetical answer is closer in embedding space to\nactual answer chunks than the short query is\nImprovement: +5-15% recall vs raw query embedding","originalText":"Technique 1: HyDE (Hypothetical Document Embedding)\nUser query: \"refund policy for EU\"\nStep 1: Ask LLM to generate a hypothetical answer\n→ \"The EU refund policy states that customers in the EU\nare entitled to a 14-day cooling-off period under the\nConsumer Rights Directive. Full refunds are provided...\"\nStep 2: Embed the hypothetical answer (not the query!)\nStep 3: Search with this embedding\nWhy: Hypothetical answer is closer in embedding space to\nactual answer chunks than the short query is\nImprovement: +5-15% recall vs raw query embedding","textAlign":"left","verticalAlign":"middle","containerId":"shape-2","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#9180ac","backgroundColor":"#f4effb","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-3"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-5"}],"updated":0,"link":null,"locked":false,"id":"shape-4","type":"rectangle","seed":333,"x":30,"y":441.40000000000003,"width":592.0034800000001,"height":223.20000000000002,"customData":{"revealStep":3}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-3"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-5","type":"text","seed":406,"x":50,"y":459.40000000000003,"width":552.0034800000001,"height":187.20000000000002,"fontSize":18,"fontFamily":1,"text":"Technique 2: Multi-Query Expansion\nUser query: \"refund policy for EU\"\nLLM generates 3 alternative queries:\n→ \"What is the return policy for European customers?\"\n→ \"EU consumer rights for product refunds\"\n→ \"How to process refund for EU-based order\"\nSearch with all 4 queries → union results → deduplicate\nImprovement: +10-20% recall (catches different phrasings)","originalText":"Technique 2: Multi-Query Expansion\nUser query: \"refund policy for EU\"\nLLM generates 3 alternative queries:\n→ \"What is the return policy for European customers?\"\n→ \"EU consumer rights for product refunds\"\n→ \"How to process refund for EU-based order\"\nSearch with all 4 queries → union results → deduplicate\nImprovement: +10-20% recall (catches different phrasings)","textAlign":"left","verticalAlign":"middle","containerId":"shape-4","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":3}},{"angle":0,"strokeColor":"#6577aa","backgroundColor":"#eef1fc","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-4"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-7"}],"updated":0,"link":null,"locked":false,"id":"shape-6","type":"rectangle","seed":479,"x":30,"y":689.6,"width":610.18672,"height":153,"customData":{"revealStep":4}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-4"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-7","type":"text","seed":552,"x":50,"y":707.6,"width":570.18672,"height":117,"fontSize":18,"fontFamily":1,"text":"Technique 3: Contextual Compression\nAfter retrieving chunks, extract only the relevant sentences\nfrom each chunk (not the entire 512-token chunk)\n→ Less noise in LLM context → better answers\n→ Fewer tokens → lower cost","originalText":"Technique 3: Contextual Compression\nAfter retrieving chunks, extract only the relevant sentences\nfrom each chunk (not the entire 512-token chunk)\n→ Less noise in LLM context → better answers\n→ Fewer tokens → lower cost","textAlign":"left","verticalAlign":"middle","containerId":"shape-6","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":4}}],"appState":{"viewBackgroundColor":"#fbfbf8","gridSize":null},"files":{}}