登录
立即咨询

语言选择

谐云 谐云
在这里探索云原生
AI共生时代来袭,是时候该懂RAG了
2025年04月09日

检索增强生成(Retrieval Augmented Generation),简称 RAG,已经成为当前最火热的LLM应用方案。RAG是一种结合信息检索与文本生成的技术框架,旨在通过动态引入外部知识库,提升大语言模型(LLM)生成答案的准确性、专业性和时效性。同时RAG是解决大模型幻觉问题,提升数据安全,降低知识局限性的重要手段。

RAG 起源与发展

RAG的概念最早由Patrick Lewis及其团队在2020年的论文《Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks》中提出。其核心目标是通过结合外部知识检索与大语言模型(LLM)的生成能力,解决LLM的知识局限性与幻觉问题。

“RAG研究技术树”涵盖预训练、微调和推理三个阶段。随着大语言模型(LLMs)的兴起,RAG研究早期聚焦于利用LLMs的上下文学习能力,主要集中在推理阶段。后续研究逐步深化,将RAG与LLMs的微调紧密结合。同时,研究者也在探索通过检索增强技术优化预训练阶段的语言模型。

                                                             RAG研究的技术树

图片来源:Retrieval-Augmented Generation for Large Language Models: A Survey

检索增强生成(RAG)与检索增强大型语言模型(RA-LLMs)各类方法的系统性归类(核心设计焦点、提出时间及影响力)

图片来源:A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Models

RAG 框架

RAG(检索增强生成)的基本框架可分为两个核心阶段:知识库构建和知识库应用,其架构设计旨在通过动态检索外部知识增强大模型的生成能力,同时解决数据时效性、安全性与幻觉问题。以下是其核心流程与技术要点:

知识库构建阶段:

1)数据准备与处理

数据来源:整合多格式数据(如PDF、数据库、网页、图像等),覆盖结构化与非结构化数据。

数据清洗:过滤噪声(如特殊字符、重复内容)、提取元数据(文件名、时间等),确保数据质量。

文本分割:根据语义完整性或固定长度分割文本,以适配嵌入模型输入限制。例如,按段落分割或滑动窗口分块。

2)向量化与存储

嵌入模型:使用如Sentence-BERT、OpenAI Embedding等将文本转化为高维向量。

向量数据库:将向量存入数据库(如FAISS、Milvus),支持高效相似性检索。

 

知识库应用阶段:

1)用户提问与检索

查询向量化:将用户问题转化为向量(与知识库构建使用相同嵌入模型)。

语义检索:通过余弦相似度等算法从向量库中召回Top-K相关文本块。

重排序优化(可选):引入交叉编码器(Cross-Encoder)对候选结果二次排序,提升相关性

2)提示工程与生成

上下文注入:将检索结果与用户问题拼接为Prompt。

大模型生成:调用LLM(如GPT-4)生成答案,并限制输出格式以提高事实性。

RAG 范式发展历程

信息来源:AGENTIC RETRIEVAL-AUGMENTED GENERATION: A SURVEY ON AGENTIC RAG

五、RAG优点

RAG(检索增强生成)技术通过结合检索与生成能力,显著提升了AI模型的实用性和可靠性。

1)知识动态更新与时效性

实时信息整合:RAG无需重新训练模型,即可通过更新外部知识库获取最新数据;

跨领域知识扩展:支持多模态数据源(文本、图像、音视频等)的检索与融合。

2)精准性与可信度提升

减少幻觉现象:通过引用来源明确的权威数据(如专利库/法律条文),降低编造风险。
可追溯与透明性:回答中明确标注信息出处,用户可直接追溯原始数据,增强信任。

3)成本与效率优化

支持模块化架构,检索器与生成器可独立升级。无需重新训练千亿参数大模型,只需构建专属知识库。

4)安全与场景定制化

数据权限管控:通过知识库权限分层(如仅开放公共政策库、限制内部机密数据),实现敏感信息隔离

垂直领域深度适配,可针对行业需求定制检索策略

5)生成质量增强

逻辑推理能力强化,多语言与多模态支持

六、RAG企业应用场景

RAG技术正成为企业智能化转型和人工智能升级的核心力量。从精准解析产品手册实现秒级响应,到动态检索私有文档消除AI“幻觉”;从零成本更新知识图谱,到突破关键词匹配实现语义级问答——RAG以“检索+生成”双轮驱动,让机器真正理解业务逻辑。更值得期待的是,多模态扩展能力已打破数据边界,用户仅需一张图片、一段语音,即可触发“以图搜文”“语音溯源”的智能交互。拥抱RAG技术,让智能系统成为业务发展的智慧伙伴。

添加评论
谐云
2025年04月19日
I'm really impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you customize it yourself? Either way keep up the nice quality writing, it抯 rare to see a nice blog like this one these days..
添加回复
谐云
2025年04月19日
添加回复
回复:Hi, i think that i saw you visited my site thus i came to “return the favor”.I'm trying to find things to enhance my site!I suppose its ok to use some of your ideas!!
添加回复
回复:This information is invaluable. Where can I find out more?
添加回复
回复:Wonderful blog! Do you have any suggestions for aspiring writers? I'm hoping to start my own website soon but I'm a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many choices out there that I'm completely confused .. Any ideas? Many thanks!
添加回复
回复:Thanks on your marvelous posting! I quite enjoyed reading it, you are a great author. I will always bookmark your blog and will come back very soon. I want to encourage you to definitely continue your great posts, have a nice weekend!
添加回复
回复:I'm impressed, I have to admit. Rarely do I encounter a blog that's both educative and entertaining, and let me tell you, you have hit the nail on the head. The issue is an issue that too few folks are speaking intelligently about. Now i'm very happy that I came across this in my hunt for something relating to this.
添加回复
回复:Having read this I believed it was very enlightening. I appreciate you taking the time and energy to put this article together. I once again find myself spending a significant amount of time both reading and posting comments. But so what, it was still worthwhile!
添加回复
回复:Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You definitely know what youre talking about, why throw away your intelligence on just posting videos to your blog when you could be giving us something informative to read?
添加回复
回复:Every weekend i used to pay a quick visit this site, because i want enjoyment, for the reason that this this web page conations really good funny information too.
添加回复
回复:Terrific article! This is the kind of info that are meant to be shared across the web. Shame on Google for now not positioning this publish higher! Come on over and talk over with my website . Thanks =)
添加回复
回复:This website was... how do I say it? Relevant!! Finally I have found something which helped me. Kudos!
添加回复
回复:Its not my first time to visit this website, i am visiting this site dailly and take nice data from here everyday.
添加回复
回复:Hi there every one, here every person is sharing such know-how, so it's good to read this website, and I used to pay a visit this website everyday.
添加回复
回复:fantastic points altogether, you simply received a brand new reader. What may you recommend about your put up that you simply made some days ago? Any positive?
添加回复
回复:I am really loving the theme/design of your site. Do you ever run into any internet browser compatibility issues? A handful of my blog readers have complained about my website not working correctly in Explorer but looks great in Opera. Do you have any suggestions to help fix this problem?
添加回复
回复:If you wish for to get a great deal from this post then you have to apply these methods to your won website.
添加回复
回复:Hi there! This is my 1st comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading your articles. Can you suggest any other blogs/websites/forums that go over the same topics? Thanks a ton!
添加回复
回复:Your style is really unique in comparison to other people I have read stuff from. Many thanks for posting when you've got the opportunity, Guess I'll just bookmark this site.
添加回复
回复:I read this piece of writing fully regarding the difference of most up-to-date and preceding technologies, it's amazing article.
添加回复
回复:Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.
添加回复
回复:Good day I am so thrilled I found your blog, I really found you by mistake, while I was searching on Bing for something else, Anyways I am here now and would just like to say thanks a lot for a fantastic post and a all round interesting blog (I also love the theme/design), I don’t have time to go through it all at the minute but I have bookmarked it and also added in your RSS feeds, so when I have time I will be back to read more, Please do keep up the awesome work.
添加回复
回复:You could certainly see your skills in the work you write. The world hopes for more passionate writers like you who aren't afraid to say how they believe. All the time follow your heart.
添加回复
回复:Hi there! Someone in my Myspace group shared this website with us so I came to take a look. I'm definitely loving the information. I'm bookmarking and will be tweeting this to my followers! Exceptional blog and great design.
添加回复
回复:My brother suggested I might like this blog. He was totally right. This post truly made my day. You can not imagine just how much time I had spent for this information! Thanks!
添加回复
谐云
2025年04月19日
添加回复
谐云 CpjJwWHV
2025年04月19日
555
添加回复
gBqsPxAZ回复CpjJwWHV:555
添加回复
gBqsPxAZ回复CpjJwWHV:555
添加回复
gBqsPxAZ回复CpjJwWHV:555
添加回复
gBqsPxAZ回复CpjJwWHV:555
添加回复
回复CpjJwWHV:
添加回复
回复CpjJwWHV:
添加回复
谐云 CpjJwWHV
2025年04月19日
555
添加回复
gBqsPxAZ回复CpjJwWHV:555
添加回复
gBqsPxAZ回复CpjJwWHV:555
添加回复
gBqsPxAZ回复CpjJwWHV:555
添加回复
gBqsPxAZ回复CpjJwWHV:555
添加回复
回复CpjJwWHV:
添加回复
回复CpjJwWHV:
添加回复
回复CpjJwWHV:
添加回复
回复CpjJwWHV:
添加回复
回复CpjJwWHV:
添加回复
申请合作咨询
您可以通过此表单填写您的合作意向,我们将会尽快与您取得联系!
或拨打电话0571-87607309
*姓名:
*手机:
*邮箱:
备注:
备注:
登录
登录
注册账号 忘记密码
注册
{{ code.btn }}
注册
立即登录 忘记密码?
忘记密码
{{ code.btn }}
确定
立即登录 忘记密码?
立即咨询