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