我们探索了改进 RAG 的各种方法:更好的分块、添加上下文、转换查询、重新排名,甚至纳入反馈。但是,如果最好的技术取决于所问问题的类型呢?这就是自适应 RAG 背后的想法。
源代码
https://github.com/CrazyAndy/rag-all-techniques/blob/main/app/11_adaptive.py
我们在这里使用四种不同的策略:
- Factual Strategy: Focuses on retrieving precise facts and figures.
事实策略: 专注于检索精确的事实和数据。 - Analytical Strategy: Aims for comprehensive coverage of a topic, exploring different aspects.
分析策略: 旨在全面涵盖一个主题,探索不同的方面。 - Opinion Strategy: Tries to gather diverse viewpoints on a subjective issue.
观点策略: 试图就主观问题收集不同的观点。 - Contextual Strategy: Incorporates user-specific context to tailor the retrieval.
情境策略: 结合特定于用户的上下文来定制检索。
大家一起来讨论