前言
继上一篇文章AI系列:大语言模型的RAG(检索增强生成)技术(上),这篇文章主要以LlamaIndex为案例来实现RAG技术。如对背景知识感兴趣,请移步大语言模型的RAG(检索增强生成)技术(上)。
什么是LlamaIndex?
从LlamaIndex官网,可以找到如下的介绍:
LlamaIndex is a framework for building context-augmented LLM applications.
LlamaIndex provides tooling to enable context augmentation. A popular example isRetrieval-Augmented Generation (RAG)
which combines context with LLMs at inference time. Another is
finetuning.
翻译成中文:
如LlamaIndex 是一个用于构建上下文增强型大型语言模型(LLM)应用的框架。
LlamaIndex 提供了工具来实现上下文增强。一个流行的例子是检索增强生成(RAG)
,它在推理时将上下文与大型语言模型结合起来。另一个例子是微调(finetuning)。
LlamaIndex为实现RAG技术提供了很多工具,详细信息可以参考官网。这里列出了一种实现方式,跟下方的代码示例相匹配,图示如下: