chapter seven

7 Retriever: Returning more relevant results

 

This chapter covers

  • How the “scaling wall of context” and computational costs limit an agent's ability to process vast amounts of data
  • Using the Retriever pattern to enable selective attention, bridging the gap between external data and focused, actionable context
  • The structure and operation of Retriever instances, consisting of query processing, search execution, and result post-processing
  • How Retriever impacts agent design, including improved grounding, reduced hallucinations, and material cost savings
  • Common Retriever variants for balancing semantic and keyword search, and for active query refinement.
  • Retriever in action in automated insurance adjudication, technical support routing, and dynamic few-shot exemplar selection

7.1 The pain point:

7.2 How the Retriever pattern works

7.2.1 Tradeoffs

7.2.2 Implementation sketch

7.2.3 When and where to use Retriever

7.2.4 How Retriever works with other patterns

7.3 Retriever pattern variants

7.3.1 Resampling retriever

7.4 Illustrative Applying the Retriever pattern: use-case examples

7.4.1 Context-aware assistant

7.4.2 Hybrid RAG for technical support

7.4.3 Dynamic few-shot exemplar selection

7.4.4 Semantic tool selection

7.5 Summary