import{s as st,n as rt,o as mt}from"../chunks/scheduler.505acc25.js";import{S as pt,i as ft,e as s,s as i,c as B,h as ut,a as r,d as n,b as a,f as at,g as F,j as m,k as K,l as ot,m as l,n as N,t as Q,o as D,p as I}from"../chunks/index.b1175496.js";import{C as ct,H as gt}from"../chunks/Heading.eda51538.js";import{E as vt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.ea377ea6.js";function xt(J){let p,T,M,h,u,P,o,G,c,V="在本单元中，我们将探讨如何利用智能体增强检索生成（Agentic RAG）帮助 Alfred 筹备精彩的晚会。",R,f,W="<p>提示：我们已在先前单元讨论过检索增强生成（RAG）和智能体增强 RAG，如果您已熟悉这些概念可跳过本节。</p>",b,g,X=`大语言模型（LLMs）通过海量数据训练获得通用知识。
但其世界知识模型可能包含过时或不相关信息。
<strong>RAG 通过从您的数据中检索相关信息并传递给大语言模型，有效解决了这个问题。</strong>`,w,v,Y='<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/llama-index/rag.png" alt="RAG 示意图"/>',q,x,Z="思考 Alfred 的工作流程：",y,_,tt="<li>我们要求 Alfred 协助策划晚会</li> <li>Alfred 需要获取最新新闻和天气信息</li> <li>Alfred 需要整理和检索宾客信息</li>",E,$,et=`正如 Alfred 需要搜索家庭信息才能提供有效帮助，任何智能体都需要理解和检索相关数据的能力。
<strong>智能体增强 RAG 是帮助智能体解答数据问题的强大工具</strong>，我们可以为 Alfred 提供多种工具来辅助问题解答。
与传统文档自动问答不同，Alfred 可以自主决定使用任何工具或流程来回答问题。`,z,A,nt='<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/llama-index/agentic-rag.png" alt="智能体增强 RAG 架构"/>',k,d,lt="现在让我们开始<strong>构建智能体增强 RAG 工作流</strong>！",O,C,it="首先创建用于检索最新受邀者详情的 RAG 工具，接着开发网络搜索、天气更新和 Hugging Face Hub 模型下载统计等工具，最终整合所有组件实现我们的智能体增强 RAG 智能体！",S,L,j,H,U;return u=new ct({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),o=new gt({props:{title:"智能体增强检索生成（Agentic RAG）",local:"智能体增强检索生成agentic-rag",headingTag:"h1"}}),L=new vt({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/zh-CN/unit3/agentic-rag/agentic-rag.mdx"}}),{c(){p=s("meta"),T=i(),M=s("p"),h=i(),B(u.$$.fragment),P=i(),B(o.$$.fragment),G=i(),c=s("p"),c.textContent=V,R=i(),f=s("blockquote"),f.innerHTML=W,b=i(),g=s("p"),g.innerHTML=X,w=i(),v=s("p"),v.innerHTML=Y,q=i(),x=s("p"),x.textContent=Z,y=i(),_=s("ol"),_.innerHTML=tt,E=i(),$=s("p"),$.innerHTML=et,z=i(),A=s("p"),A.innerHTML=nt,k=i(),d=s("p"),d.innerHTML=lt,O=i(),C=s("p"),C.textContent=it,S=i(),B(L.$$.fragment),j=i(),H=s("p"),this.h()},l(t){const e=ut("svelte-u9bgzb",document.head);p=r(e,"META",{name:!0,content:!0}),e.forEach(n),T=a(t),M=r(t,"P",{}),at(M).forEach(n),h=a(t),F(u.$$.fragment,t),P=a(t),F(o.$$.fragment,t),G=a(t),c=r(t,"P",{"data-svelte-h":!0}),m(c)!=="svelte-acqz9p"&&(c.textContent=V),R=a(t),f=r(t,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),m(f)!=="svelte-nfng7s"&&(f.innerHTML=W),b=a(t),g=r(t,"P",{"data-svelte-h":!0}),m(g)!=="svelte-oqhrwa"&&(g.innerHTML=X),w=a(t),v=r(t,"P",{"data-svelte-h":!0}),m(v)!=="svelte-112ikv7"&&(v.innerHTML=Y),q=a(t),x=r(t,"P",{"data-svelte-h":!0}),m(x)!=="svelte-1icrhmn"&&(x.textContent=Z),y=a(t),_=r(t,"OL",{"data-svelte-h":!0}),m(_)!=="svelte-11v7oma"&&(_.innerHTML=tt),E=a(t),$=r(t,"P",{"data-svelte-h":!0}),m($)!=="svelte-d1rfjs"&&($.innerHTML=et),z=a(t),A=r(t,"P",{"data-svelte-h":!0}),m(A)!=="svelte-qrnqz4"&&(A.innerHTML=nt),k=a(t),d=r(t,"P",{"data-svelte-h":!0}),m(d)!=="svelte-gcvxuv"&&(d.innerHTML=lt),O=a(t),C=r(t,"P",{"data-svelte-h":!0}),m(C)!=="svelte-6ztjw6"&&(C.textContent=it),S=a(t),F(L.$$.fragment,t),j=a(t),H=r(t,"P",{}),at(H).forEach(n),this.h()},h(){K(p,"name","hf:doc:metadata"),K(p,"content",_t),K(f,"class","tip")},m(t,e){ot(document.head,p),l(t,T,e),l(t,M,e),l(t,h,e),N(u,t,e),l(t,P,e),N(o,t,e),l(t,G,e),l(t,c,e),l(t,R,e),l(t,f,e),l(t,b,e),l(t,g,e),l(t,w,e),l(t,v,e),l(t,q,e),l(t,x,e),l(t,y,e),l(t,_,e),l(t,E,e),l(t,$,e),l(t,z,e),l(t,A,e),l(t,k,e),l(t,d,e),l(t,O,e),l(t,C,e),l(t,S,e),N(L,t,e),l(t,j,e),l(t,H,e),U=!0},p:rt,i(t){U||(Q(u.$$.fragment,t),Q(o.$$.fragment,t),Q(L.$$.fragment,t),U=!0)},o(t){D(u.$$.fragment,t),D(o.$$.fragment,t),D(L.$$.fragment,t),U=!1},d(t){t&&(n(T),n(M),n(h),n(P),n(G),n(c),n(R),n(f),n(b),n(g),n(w),n(v),n(q),n(x),n(y),n(_),n(E),n($),n(z),n(A),n(k),n(d),n(O),n(C),n(S),n(j),n(H)),n(p),I(u,t),I(o,t),I(L,t)}}}const _t='{"title":"智能体增强检索生成（Agentic RAG）","local":"智能体增强检索生成agentic-rag","sections":[],"depth":1}';function $t(J){return mt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Mt extends pt{constructor(p){super(),ft(this,p,$t,xt,st,{})}}export{Mt as component};
