12 lines
5.5 KiB
JavaScript
12 lines
5.5 KiB
JavaScript
import{c as a,Q as e,j as t,m as i}from"./chunks/framework.BPKcPtvA.js";const c=JSON.parse('{"title":"What Is an AI Agent, Really?","description":"","frontmatter":{},"headers":[],"relativePath":"blog/posts/what-is-an-agent.md","filePath":"blog/posts/what-is-an-agent.md","lastUpdated":1780488472000}'),n={name:"blog/posts/what-is-an-agent.md"};function o(l,s,h,p,r,d){return e(),t("div",null,[...s[0]||(s[0]=[i(`<h1 id="what-is-an-ai-agent-really" tabindex="-1">What Is an AI Agent, Really? <a class="header-anchor" href="#what-is-an-ai-agent-really" aria-label="Permalink to "What Is an AI Agent, Really?""></a></h1><p><strong>June 2, 2026</strong></p><p>An AI agent = LLM + Tools + Loop. If any of the three is missing, it is not an agent.</p><h2 id="the-three-components" tabindex="-1">The Three Components <a class="header-anchor" href="#the-three-components" aria-label="Permalink to "The Three Components""></a></h2><p><strong>LLM</strong> — The reasoning engine. Given context and available tools, it decides what to do next. The LLM is NOT the agent. It is the brain of the agent.</p><p><strong>Tools</strong> — The capability surface. Functions the agent can call: read files, run commands, search the web, query databases. Each tool has a name, description, and input schema.</p><p><strong>Loop</strong> — The autonomous decision cycle. Think (LLM decides) leads to Act (tool executes) leads to Observe (result comes back) leads to Repeat.</p><h2 id="what-each-combination-gives-you" tabindex="-1">What Each Combination Gives You <a class="header-anchor" href="#what-each-combination-gives-you" aria-label="Permalink to "What Each Combination Gives You""></a></h2><table tabindex="0"><thead><tr><th>Combination</th><th>Result</th></tr></thead><tbody><tr><td>LLM only</td><td>Chatbot</td></tr><tr><td>LLM + Tools (no loop)</td><td>Augmented inference</td></tr><tr><td>LLM + Loop (no tools)</td><td>Talking to itself</td></tr><tr><td>LLM + Tools + Loop</td><td>Agent</td></tr></tbody></table><h2 id="the-loop-in-pseudocode" tabindex="-1">The Loop in Pseudocode <a class="header-anchor" href="#the-loop-in-pseudocode" aria-label="Permalink to "The Loop in Pseudocode""></a></h2><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">messages </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [system_prompt, user_request]</span></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">while</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> True</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> response </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> llm.invoke(messages, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">tools</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">tool_definitions)</span></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> response.is_final_answer:</span></span>
|
||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> print</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(response.content)</span></span>
|
||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> break</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tool_name </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> response.tool_call.name</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tool_args </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> response.tool_call.args</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> execute_tool(tool_name, tool_args)</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> messages.append(response)</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> messages.append(result)</span></span></code></pre></div><h2 id="common-misconception" tabindex="-1">Common Misconception <a class="header-anchor" href="#common-misconception" aria-label="Permalink to "Common Misconception""></a></h2><p>"The model is the agent." No. The model is the brain. The agent is the whole system: brain plus tools plus loop. A better brain helps, but better tools and a better loop help more.</p><hr><p><em>From Module 1 of the <a href="/">Agentic Engineering Course</a>. The full module includes your first lab: building a single-tool agent from scratch.</em></p>`,15)])])}const g=a(n,[["render",o]]);export{c as __pageData,g as default};
|