import{s as ue,f as ce,n as pe,o as de}from"../chunks/scheduler.37c15a92.js";import{S as ge,i as we,g as o,s as a,r as D,A as ve,h as s,f as n,c as l,j as he,u as O,x as r,k as R,y as xe,a as i,v as K,d as N,t as Q,w as V}from"../chunks/index.2bf4358c.js";import{H as Y}from"../chunks/Heading.8ada512a.js";import{E as Le}from"../chunks/EditOnGithub.9958bcdc.js";function ke(Z){let m,T,y,A,f,C,h,ee,H,u,te="Welcome to this second unit, where <strong>we’ll explore different agentic frameworks</strong> that can be used to build powerful agentic applications.",P,c,ne="We will study:",F,p,ie='<li>In Unit 2.1: <a href="https://huggingface.co/docs/smolagents/en/index" rel="nofollow">smolagents</a></li> <li>In Unit 2.2: <a href="https://www.llamaindex.ai/" rel="nofollow">LlamaIndex</a></li> <li>In Unit 2.3: <a href="https://www.langchain.com/langgraph" rel="nofollow">LangGraph</a></li>',I,d,ae="Let’s dive in! 🕵",U,g,E,w,le="An agentic framework is <strong>not always needed when building an application around LLMs</strong>. They provide flexibility in the workflow to efficiently solve a specific task, but they’re not always necessary.",j,v,oe="Sometimes, <strong>predefined workflows are sufficient</strong> to fulfill user requests, and there is no real need for an agentic framework. If the approach to build an agent is simple, like a chain of prompts, using plain code may be enough. The advantage is that the developer will have <strong>full control and understanding of their system without abstractions</strong>.",S,x,se="However, when the workflow becomes more complex, such as letting an LLM call functions or using multiple agents, these abstractions start to become helpful.",q,L,re="Considering these ideas, we can already identify the need for some features:",G,k,me=`<li>An <em>LLM engine</em> that powers the system.</li> <li>A <em>list of tools</em> the agent can access.</li> <li>A <em>parser</em> for extracting tool calls from the LLM output.</li> <li>A <em>system prompt</em> synced with the parser.</li> <li>A <em>memory system</em>.</li> <li><em>Error logging and retry mechanisms</em> to control LLM mistakes.
We’ll explore how these topics are resolved in various frameworks, including <code>smolagents</code>, <code>LlamaIndex</code>, and <code>LangGraph</code>.</li>`,W,$,z,b,fe='<thead><tr><th>Framework</th> <th>Description</th> <th>Unit Author</th></tr></thead> <tbody><tr><td><a href="./smolagents/introduction">smolagents</a></td> <td>Agents framework developed by Hugging Face.</td> <td>Sergio Paniego - <a href="https://huggingface.co/sergiopaniego" rel="nofollow">HF</a> - <a href="https://x.com/sergiopaniego" rel="nofollow">X</a> - <a href="https://www.linkedin.com/in/sergio-paniego-blanco" rel="nofollow">Linkedin</a></td></tr> <tr><td><a href="./llama-index/introduction">Llama-Index</a></td> <td>End-to-end tooling to ship a context-augmented AI agent to production</td> <td>David Berenstein - <a href="https://huggingface.co/davidberenstein1957" rel="nofollow">HF</a> - <a href="https://x.com/davidberenstei" rel="nofollow">X</a> - <a href="https://www.linkedin.com/in/davidberenstein" rel="nofollow">Linkedin</a></td></tr> <tr><td><a href="./langgraph/introduction">LangGraph</a></td> <td>Agents allowing stateful orchestration of agents</td> <td>Joffrey THOMAS - <a href="https://huggingface.co/Jofthomas" rel="nofollow">HF</a> - <a href="https://x.com/Jthmas404" rel="nofollow">X</a> - <a href="https://www.linkedin.com/in/joffrey-thomas" rel="nofollow">Linkedin</a></td></tr></tbody>',J,_,X,M,B;return f=new Y({props:{title:"Introduction to Agentic Frameworks",local:"introduction-to-agentic-frameworks",headingTag:"h1"}}),g=new Y({props:{title:"When to Use an Agentic Framework",local:"when-to-use-an-agentic-framework",headingTag:"h2"}}),$=new Y({props:{title:"Agentic Frameworks Units",local:"agentic-frameworks-units",headingTag:"h2"}}),_=new Le({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/en/unit2/introduction.mdx"}}),{c(){m=o("meta"),T=a(),y=o("p"),A=a(),D(f.$$.fragment),C=a(),h=o("img"),H=a(),u=o("p"),u.innerHTML=te,P=a(),c=o("p"),c.textContent=ne,F=a(),p=o("ul"),p.innerHTML=ie,I=a(),d=o("p"),d.textContent=ae,U=a(),D(g.$$.fragment),E=a(),w=o("p"),w.innerHTML=le,j=a(),v=o("p"),v.innerHTML=oe,S=a(),x=o("p"),x.textContent=se,q=a(),L=o("p"),L.textContent=re,G=a(),k=o("ul"),k.innerHTML=me,W=a(),D($.$$.fragment),z=a(),b=o("table"),b.innerHTML=fe,J=a(),D(_.$$.fragment),X=a(),M=o("p"),this.h()},l(e){const t=ve("svelte-u9bgzb",document.head);m=s(t,"META",{name:!0,content:!0}),t.forEach(n),T=l(e),y=s(e,"P",{}),he(y).forEach(n),A=l(e),O(f.$$.fragment,e),C=l(e),h=s(e,"IMG",{src:!0,alt:!0}),H=l(e),u=s(e,"P",{"data-svelte-h":!0}),r(u)!=="svelte-hlqese"&&(u.innerHTML=te),P=l(e),c=s(e,"P",{"data-svelte-h":!0}),r(c)!=="svelte-5kufvb"&&(c.textContent=ne),F=l(e),p=s(e,"UL",{"data-svelte-h":!0}),r(p)!=="svelte-1l0szbw"&&(p.innerHTML=ie),I=l(e),d=s(e,"P",{"data-svelte-h":!0}),r(d)!=="svelte-1r1x28z"&&(d.textContent=ae),U=l(e),O(g.$$.fragment,e),E=l(e),w=s(e,"P",{"data-svelte-h":!0}),r(w)!=="svelte-mk5673"&&(w.innerHTML=le),j=l(e),v=s(e,"P",{"data-svelte-h":!0}),r(v)!=="svelte-1xx3jm"&&(v.innerHTML=oe),S=l(e),x=s(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-1ew78qv"&&(x.textContent=se),q=l(e),L=s(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-tt5p1j"&&(L.textContent=re),G=l(e),k=s(e,"UL",{"data-svelte-h":!0}),r(k)!=="svelte-5jk7f0"&&(k.innerHTML=me),W=l(e),O($.$$.fragment,e),z=l(e),b=s(e,"TABLE",{"data-svelte-h":!0}),r(b)!=="svelte-nvr6w7"&&(b.innerHTML=fe),J=l(e),O(_.$$.fragment,e),X=l(e),M=s(e,"P",{}),he(M).forEach(n),this.h()},h(){R(m,"name","hf:doc:metadata"),R(m,"content",$e),ce(h.src,ee="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/thumbnail.jpg")||R(h,"src",ee),R(h,"alt","Thumbnail")},m(e,t){xe(document.head,m),i(e,T,t),i(e,y,t),i(e,A,t),K(f,e,t),i(e,C,t),i(e,h,t),i(e,H,t),i(e,u,t),i(e,P,t),i(e,c,t),i(e,F,t),i(e,p,t),i(e,I,t),i(e,d,t),i(e,U,t),K(g,e,t),i(e,E,t),i(e,w,t),i(e,j,t),i(e,v,t),i(e,S,t),i(e,x,t),i(e,q,t),i(e,L,t),i(e,G,t),i(e,k,t),i(e,W,t),K($,e,t),i(e,z,t),i(e,b,t),i(e,J,t),K(_,e,t),i(e,X,t),i(e,M,t),B=!0},p:pe,i(e){B||(N(f.$$.fragment,e),N(g.$$.fragment,e),N($.$$.fragment,e),N(_.$$.fragment,e),B=!0)},o(e){Q(f.$$.fragment,e),Q(g.$$.fragment,e),Q($.$$.fragment,e),Q(_.$$.fragment,e),B=!1},d(e){e&&(n(T),n(y),n(A),n(C),n(h),n(H),n(u),n(P),n(c),n(F),n(p),n(I),n(d),n(U),n(E),n(w),n(j),n(v),n(S),n(x),n(q),n(L),n(G),n(k),n(W),n(z),n(b),n(J),n(X),n(M)),n(m),V(f,e),V(g,e),V($,e),V(_,e)}}}const $e='{"title":"Introduction to Agentic Frameworks","local":"introduction-to-agentic-frameworks","sections":[{"title":"When to Use an Agentic Framework","local":"when-to-use-an-agentic-framework","sections":[],"depth":2},{"title":"Agentic Frameworks Units","local":"agentic-frameworks-units","sections":[],"depth":2}],"depth":1}';function be(Z){return de(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ae extends ge{constructor(m){super(),we(this,m,be,ke,ue,{})}}export{Ae as component};
