import{s as oe,n as se,o as re}from"../chunks/scheduler.505acc25.js";import{S as ue,i as me,e as o,s as i,c as j,h as fe,a as s,d as n,b as l,f as le,g as N,j as r,k as U,l as pe,m as a,n as B,t as I,o as J,p as K}from"../chunks/index.fbb49fb4.js";import{C as de}from"../chunks/CopyLLMTxtMenu.564b44fd.js";import{H as ge}from"../chunks/Heading.511e0027.js";import{E as ce}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.8c19e80e.js";function he(Q){let u,b,$,M,f,C,p,H,d,D="In this unit, we’ll be taking a look at how we can use Agentic RAG to help Alfred prepare for the amazing gala.",T,m,V="<p>We know we’ve already discussed Retrieval Augmented Generation (RAG) and agentic RAG in the previous unit, so feel free to skip ahead if you’re already familiar with the concepts.</p>",k,g,X=`LLMs are trained on enormous bodies of data to learn general knowledge.
However, the world knowledge model of LLMs may not always be relevant and up-to-date information.
<strong>RAG solves this problem by finding and retrieving relevant information from your data and forwarding that to the LLM.</strong>`,G,c,Y='<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/llama-index/rag.png" alt="RAG"/>',R,h,Z="Now, think about how Alfred works:",P,v,ee="<li>We’ve asked Alfred to help plan a gala</li> <li>Alfred needs to find the latest news and weather information</li> <li>Alfred needs to structure and search the guest information</li>",q,w,te=`Just as Alfred needs to search through your household information to be helpful, any agent needs a way to find and understand relevant data.
<strong>Agentic RAG is a powerful way to use agents to answer questions about your data.</strong> We can pass various tools to Alfred to help him answer questions.
However, instead of answering the question on top of documents automatically, Alfred can decide to use any other tool or flow to answer the question.`,E,x,ne='<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/llama-index/agentic-rag.png" alt="Agentic RAG"/>',O,A,ae="Let’s start <strong>building our agentic RAG workflow!</strong>",S,L,ie="First, we’ll create a RAG tool to retrieve up-to-date details about the invitees. Next, we’ll develop tools for web search, weather updates, and Hugging Face Hub model download statistics. Finally, we’ll integrate everything to bring our agentic RAG agent to life!",z,_,F,y,W;return f=new de({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),p=new ge({props:{title:"Agentic Retrieval Augmented Generation (RAG)",local:"agentic-retrieval-augmented-generation-rag",headingTag:"h1"}}),_=new ce({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/en/unit3/agentic-rag/agentic-rag.mdx"}}),{c(){u=o("meta"),b=i(),$=o("p"),M=i(),j(f.$$.fragment),C=i(),j(p.$$.fragment),H=i(),d=o("p"),d.textContent=D,T=i(),m=o("blockquote"),m.innerHTML=V,k=i(),g=o("p"),g.innerHTML=X,G=i(),c=o("p"),c.innerHTML=Y,R=i(),h=o("p"),h.textContent=Z,P=i(),v=o("ol"),v.innerHTML=ee,q=i(),w=o("p"),w.innerHTML=te,E=i(),x=o("p"),x.innerHTML=ne,O=i(),A=o("p"),A.innerHTML=ae,S=i(),L=o("p"),L.textContent=ie,z=i(),j(_.$$.fragment),F=i(),y=o("p"),this.h()},l(e){const t=fe("svelte-u9bgzb",document.head);u=s(t,"META",{name:!0,content:!0}),t.forEach(n),b=l(e),$=s(e,"P",{}),le($).forEach(n),M=l(e),N(f.$$.fragment,e),C=l(e),N(p.$$.fragment,e),H=l(e),d=s(e,"P",{"data-svelte-h":!0}),r(d)!=="svelte-y9578v"&&(d.textContent=D),T=l(e),m=s(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),r(m)!=="svelte-sml7hr"&&(m.innerHTML=V),k=l(e),g=s(e,"P",{"data-svelte-h":!0}),r(g)!=="svelte-140qrhf"&&(g.innerHTML=X),G=l(e),c=s(e,"P",{"data-svelte-h":!0}),r(c)!=="svelte-kysd50"&&(c.innerHTML=Y),R=l(e),h=s(e,"P",{"data-svelte-h":!0}),r(h)!=="svelte-aqkixd"&&(h.textContent=Z),P=l(e),v=s(e,"OL",{"data-svelte-h":!0}),r(v)!=="svelte-1j2u100"&&(v.innerHTML=ee),q=l(e),w=s(e,"P",{"data-svelte-h":!0}),r(w)!=="svelte-kv63c9"&&(w.innerHTML=te),E=l(e),x=s(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-1srircl"&&(x.innerHTML=ne),O=l(e),A=s(e,"P",{"data-svelte-h":!0}),r(A)!=="svelte-ipidlv"&&(A.innerHTML=ae),S=l(e),L=s(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-aaolqu"&&(L.textContent=ie),z=l(e),N(_.$$.fragment,e),F=l(e),y=s(e,"P",{}),le(y).forEach(n),this.h()},h(){U(u,"name","hf:doc:metadata"),U(u,"content",ve),U(m,"class","tip")},m(e,t){pe(document.head,u),a(e,b,t),a(e,$,t),a(e,M,t),B(f,e,t),a(e,C,t),B(p,e,t),a(e,H,t),a(e,d,t),a(e,T,t),a(e,m,t),a(e,k,t),a(e,g,t),a(e,G,t),a(e,c,t),a(e,R,t),a(e,h,t),a(e,P,t),a(e,v,t),a(e,q,t),a(e,w,t),a(e,E,t),a(e,x,t),a(e,O,t),a(e,A,t),a(e,S,t),a(e,L,t),a(e,z,t),B(_,e,t),a(e,F,t),a(e,y,t),W=!0},p:se,i(e){W||(I(f.$$.fragment,e),I(p.$$.fragment,e),I(_.$$.fragment,e),W=!0)},o(e){J(f.$$.fragment,e),J(p.$$.fragment,e),J(_.$$.fragment,e),W=!1},d(e){e&&(n(b),n($),n(M),n(C),n(H),n(d),n(T),n(m),n(k),n(g),n(G),n(c),n(R),n(h),n(P),n(v),n(q),n(w),n(E),n(x),n(O),n(A),n(S),n(L),n(z),n(F),n(y)),n(u),K(f,e),K(p,e),K(_,e)}}}const ve='{"title":"Agentic Retrieval Augmented Generation (RAG)","local":"agentic-retrieval-augmented-generation-rag","sections":[],"depth":1}';function we(Q){return re(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ye extends ue{constructor(u){super(),me(this,u,we,he,oe,{})}}export{ye as component};
