[KongchangAI]
· 4 min read· 2,018 words

Getting Started with AI Agent Development: The Four-Component Loop That Takes AI from Chatting to Doing

Getting Started with AI Agent Development: The Four-Component Loop That Takes AI from Chatting to Doing

Breaking down the definition, four components, common misconceptions, and applicable boundaries of AI Agents to build a judgment framework.

Based on the first six episodes of an Agent tutorial, the article answers "why AI can only chat but not work." The core definition is: an Agent is a large-model-driven system that can autonomously decide the next step and change the external world through tools, with each qualifier excluding hard-coded programs, pure conversation, and pure text output. The four components are model, tools, memory, and planning: judgment relies on the model, action relies on tools, not forgetting relies on memory, and order relies on planning. The article emphasizes the most frequent misconception is thinking the model calls tools itself; in reality, the model only outputs structured requests, and the outer code does the actual execution. The dividing line between an Agent and a workflow is who decides the next step. Tasks with fixed steps and predictable results are more economical with a workflow, and poorly performing Agents often fail at one of planning, memory, or tools.

Why does your AI only chat but never actually do anything?

Many people encounter this scenario when they first use a large model to look up information: you ask it about a company's revenue last year, and it confidently gives you a number—but then tacks on a disclaimer at the end: "This data may not include the latest fiscal year; please verify against official financial reports." This isn't the model being modest—it's that its knowledge was frozen the moment training finished. According to a demonstration in a tutorial series by a Bilibili creator, an ordinary chatbot can only "recall" answers from its training data, whereas an Agent will proactively call search tools to look things up, run calculations, and generate tables.

This gap is the dividing line between "can chat" and "can get things done." Based on the first six episodes of that tutorial, this article breaks down the core definition of an Agent, its four major components, and common misconceptions, helping you build a judgment framework that won't go out of date.

We asked it this question

What exactly is an Agent: a one-sentence definition and three exclusions

The tutorial offers a restrained definition: An Agent is a system driven by a large model that can decide for itself what to do next and change the external world through tools. It's not a long sentence, but every word excludes an old paradigm.

"Driven by a large model" excludes hard-coded program branches—in the past, programmers defined step one, step two, step three in advance; now the model autonomously chooses the path at runtime. "Decide for itself what to do next" excludes pure conversational systems, which are also model-driven but only decide what to say, not what to do. "Change the external world" and "adjust based on results" exclude those tool-people that can only output text and cannot actually execute anything.

In plain terms: you give it a goal, it figures out how to get it done, it corrects itself when it goes wrong, and it stops when it's finished.

The four components: model, tools, memory, and planning—none can be missing

There's a formula circulating in the industry: Agent = Large Model + Memory + Proactive Planning + Tool Use. This framework can be traced back to a 2023 academic paper that broke the Agent into planning, memory, and tools, with the LLM as the upper-layer主体 (main body). The tutorial ties the four components together with the task: "Help me book a high-speed train to Shanghai next Wednesday, window seat, for company reimbursement."

Model: making decisions under uncertainty, not memorizing facts

The model plays the role of "the boss" in an Agent and must do three things: understand what the user actually wants, decide which tool to call next, and judge whether the results are sufficient. Its value isn't in how many facts it remembers—knowledge-base systems can do that too—but in making judgments when faced with ambiguous requirements.

Which date exactly is "next Wednesday"? Are the only window seats A and F? Does company reimbursement mean an invoice is needed? If you try to enumerate these implicit conditions with if-else, the combinations are endless. The tutorial's exact words are "an obedient version that exhaustively enumerates everything—you can't anticipate all cases," so the judgment must be delegated to the model.

Memory: layered management of short-term conversation and long-term archives

The model itself has no memory. What we call "remembering the previous sentence" is actually you sending the previous conversation content to it again. Short-term memory is the context of the current conversation; long-term memory is user profiles retained across sessions, extracted facts, and a searchable document library.

If memory isn't handled well, the Agent feels like it's meeting you for the first time every round. The tutorial gives a painfully relatable example: the user says "Help me book a high-speed train to Shanghai next Wednesday," but the Agent replies, "Where would you like to go?"—it's not that it's stupid, it's that you didn't pass the memory along.

We also need an invoice for that

One unavoidable term to add: Context Window. It refers to the upper limit of tokens the model can receive in a single call, and short-term memory lives inside it. Once the number of conversation turns increases and tool return results grow longer, the context expands rapidly, and when it hits the limit you must make trade-offs.

There are three common approaches: sliding window (keep only the most recent N turns), summarization compression (have the model summarize early conversation into a paragraph), and retrieval-based memory (store history in a vector database and recall relevant snippets based on the current question). This also explains why "memory" is an independent engineering problem in an Agent rather than a built-in model capability—the model is stateless on every call; it only knows what you pass to it. Pass too much and you exceed the limit and dilute the focus; pass too little and you get the awkward "Where would you like to go?" from the article.

Proactive planning: able to break down tasks and also able to backtrack

The ticket-booking task doesn't directly call the order API; it first breaks down into five steps: search train schedules, compare times and prices, confirm window seats, place the order, and issue an invoice. More critically, "backtracking": if it finds that next Wednesday's tickets are sold out, the plan must be able to change to Tuesday, Thursday, or a different mode of transport, rather than stubbornly proceeding to a failed order.

The word "proactive" is the dividing line between an Agent and a fixed workflow. A workflow is a path a programmer hard-codes in advance; an Agent generates the path at runtime. The difference isn't about who's smarter—it's about who decides the next step.

The tutorial mentions ReAct as the key paradigm for understanding "planning + looping." Its full name is Reasoning and Acting. Its core is to alternate the model's reasoning (Thought) and actions (Action) within the same context: think one step, call a tool (Action), get an observation (Observation), then think the next step, looping until reaching the final answer (Final Answer).

ReAct's value lies in binding "thinking" and "doing" together: pure reasoning easily fabricates, while pure execution lacks error-correction ability. Because each round's thoughts, actions, and observations remain in the context, failure causes are traceable and debuggable—which is why it has become the default structure for most hand-written Agents. Understanding the ReAct loop means understanding what "the model decides the next step" looks like at the code level: a while loop + one model call + one tool dispatch.

Tools: the hoe that determines the ceiling of capability

Search, calculation, code execution, calendar access, database queries—these tools are the interfaces through which an Agent interacts with the external world. The tutorial's analogy is vivid: a human needs a machete to cut down a tree, and an Agent needs the right tools to complete its tasks; without tools, many things simply cannot be done.

Is it lacking planning?

The most frequent misunderstanding: the model only comes up with ideas; the code does the work

This is a point the tutorial repeatedly emphasizes: The model does not actually call any tools. What it outputs is just a structured sentence—"I want to use the search tool with these keywords and date range"—and what actually executes is the outer layer of code, which finds the corresponding function, runs it, and stuffs the result back into the model.

It's like a boss telling a secretary, "Xiao Zhang, go book the tickets." The boss only issues the request; the one doing the real work is Xiao Zhang. The model is the boss who comes up with ideas; the code is the secretary who does the work. Mixing this up will cause you to stumble later when writing loops, connecting APIs, and managing context.

One sentence summarizes the division of labor among the four components: judgment relies on the model, action relies on tools, not forgetting relies on memory, and order relies on planning. Only when all four are present plus a loop is it a complete Agent.

I'll review it all again

One more term to add: Function Calling. It refers to the model being trained to output a structured JSON in a conventional format, like {"name": "search", "arguments": {"query": "Shanghai high-speed rail", "date": "2025-01-08"}}, rather than natural language sentences. The model itself has no network or database permissions; it is only responsible for expressing "which tool I want to call and what the parameters are" in a machine-parsable format. The outer code parses this JSON, uses the parameters to execute the real function, and then stitches the return value back into the context as a new message.

This mechanism is the prerequisite for an Agent to be able to "act": without structured output, the code would have to guess intent from natural language, which is neither reliable nor automatable. For this reason, the clearer the tool description (name, purpose, parameter schema), the lower the probability that the model chooses the wrong tool or passes the wrong parameters—a tool definition is essentially API documentation written for the model to read.

The boundaries of an Agent: which tasks are worth making into an Agent

The acceptance criteria set by the tutorial are worth remembering for every developer: without using any framework, you can still write a system that calls tools, can loop, can manage context itself, and can judge which tasks are worth making into an Agent and which are fine with a fixed workflow.

Many poorly performing Agents on the market often lack not model capability, but rather poor planning, poorly managed memory, or incomplete tools. Conversely, if your task steps are highly deterministic and inputs/outputs are enumerable, a fixed workflow is the more economical choice. Agents are suited for tasks where the path is uncertain, adjustments are needed during execution, and interaction with the external world is required.

This is also the core logic of the tutorial's "12 videos, 4 stages" course plan: first understand what an Agent is and what types exist (such as ReAct, plan-and-execute), then lay the engineering foundation (connecting models, understanding tools, managing context), then hand-write a ReAct loop from scratch, handle async and streaming, multi-turn dialogue and multimodality, and finally move toward engineering deployment and framework selection.

FAQ

What's the difference between an Agent and a chatbot? A chatbot ends after one Q&A, with answers coming from training data; an Agent loops through "decide—call tool—observe result—decide again," with each step's result traceable and verifiable.

Can you write an Agent without a framework? Yes. The tutorial itself uses no framework for the vast majority of its content, with the goal of first understanding the loop principle and later using frameworks to improve development efficiency.

What tasks should not be made into an Agent? For tasks with fixed steps and predictable results, a workflow is lower cost and more controllable. An Agent's value lies in handling uncertainty.

One-line Summary

Breaking down the definition, four components, common misconceptions, and applicable boundaries of AI Agents to build a judgment framework.

Paragraph Summary

Based on the first six episodes of an Agent tutorial, the article answers "why AI can only chat but not work." The core definition is: an Agent is a system driven by a large model that can autonomously decide the next step and change the external world through tools, with each qualifier excluding hard-coded programs, pure conversation, and pure text output. The four components are model, tools, memory, and planning: judgment relies on the model, action relies on tools, not forgetting relies on memory, and order relies on planning. The article emphasizes that the most frequent misunderstanding is thinking the model calls tools itself; in reality, the model only outputs structured requests, and the outer code does the actual execution. The dividing line between an Agent and a workflow is who decides the next step. Tasks with fixed steps and predictable results are more economical with a workflow, and poorly performing Agents often fail at one of planning, memory, or tools.

#AI Agent#Agent development#large language model#ReAct#Function Calling#context window#Agent vs workflow#tool use
Share:

Related articles