Photo by @samthewam24
Agentic AI is one of the most (over)used tech terms of 2026.
There is an explosion of articles and YouTube videos about Agentic AI. Even though there is a lot of content, finding quality learning content is not easy.
I wanted to learn what the concepts and ideas about Agentic AI are, beyond all that hype.
What does "Agentic" mean?
In what way is it different from normal programming, or from simply calling LLMs?
How can Agentic AI help us?
These were some of my questions, so I did what I usually do when I don't understand something: I studied it.
I took Andrew Ng's Agentic AI course on DeepLearning.AI.
In this post I share what I learnt.
A single LLM call is not Agentic AI
Most people use LLMs through their chat interfaces, such as ChatGPT or Claude: you ask a question and the LLM replies.
As developers, we can do the same from code: call the LLM through an API, send a prompt and get a response back in a few seconds or minutes.
I’ve done it with the Anthropic API. It’s pretty simple, especially if you use a library. If you're a Rubyist, check out the official anthropic gem to query the LLM. You can find a library for the most popular languages and LLM providers.
Useful, but that alone doesn’t make a system agentic: it’s one question and one answer.
An agentic system works more like a loop. Your program calls the LLM, then looks at the result and decides what to do next:
- it calls a tool
- it calls the LLM again
Several steps, each one building on the previous one.
Sometimes your code decides the next step, and sometimes the LLM does.
Andrew explains this with a clear example:
imagine asking someone to write an essay from the first word to the last in one go, without ever going back. That’s what we do when we send a single prompt. Of course, nobody writes well like that.
A person makes an outline, does some research, writes a draft, then rereads it and fixes it. An agentic workflow works the same way.
Andrew also prefers the adjective “agentic” to the noun “agent”. Instead of arguing whether something is really an agent, he sees systems as more or less agentic.
Think of it as a scale. On one end, you, the developer, write every step in code, and the LLM just does the writing. On the other end, you hand the LLM a goal and some tools, and it figures out the steps on its own.
A simple agentic system: a research assistant
Here is a simple example, similar to the research agent I built in the course labs.
The goal is to create a report on a certain topic. This is what the system does:
- Draft. Your code sends the user's question to the LLM and asks for a first draft.
- Reflect. Your code sends that draft back to the LLM with a new instruction: review it, fact-check it, say what's missing or poor.
- Search. To fact-check, the LLM can ask to use a web search tool, so it doesn't rely only on what it learned during training.
- Rewrite. Your code sends the draft, the critique and the search results back, and asks for an improved version.

Every arrow is a line of your code. The LLM never runs the search itself: it asks, and your code runs it.
The important bit for you as a developer: the LLM isn't in charge of the whole flow. It is your code that decides the steps.
You pass the output of one call to the next, and you decide when it's finished.
The LLM does what it's good at: reading, writing, judging text.
Your code does the programmatic part: control flow, calling APIs, querying data.
Reflection
Step 2 is reflection, one of the main patterns in the course. Given the result of the first query, you ask the LLM to reflect on it.
This step is very simple to implement, and it improves the quality of the report a lot.
Andrew points out that reflection works even better with external feedback: search results, or the error message from running some code (in the case of agents writing code). The reason is that the LLM isn't just re-reading its own words. It's checking them against something real.
Tools
On its own, an LLM can only produce text. It can't search the web, read a database or send an email, for example.
Tools give LLMs the power to act.
There are two different patterns to connect the tools with the LLM:
1. Tools you code
This is how a classic tool works:
- You write a normal function, for example
search_web(query)orget_order(order_id), with a clear name and a good description. - You pass the list of tools to the LLM together with the prompt. In the course they use aisuite, which builds the tool description automatically from the function's name, parameters and docstring.
- The LLM doesn't run anything. It replies with a request: "please call
search_webwith this query". - Your code runs the function and sends the result back to the LLM. The LLM can then answer, or ask for another tool.
You know exactly what each tool does. The LLM only chooses which one to call and with which arguments. It's safe and predictable, but limited: the LLM can only do what you've anticipated (coded).
2. Code the LLM writes
The second approach is much more powerful, riskier and less common in production apps, at least for now.
Instead of calling existing functions, the LLM writes the code itself, and your system runs it. The response is code.
In the course there's a lab about a small sunglasses shop. The user asks something like "do you have round sunglasses under $100 in stock?". The LLM writes Python code that queries the shop's inventory, and the system executes that code and returns the result.
This is very powerful. LLMs are good at writing code, and one piece of generated code can replace dozens of small tools (functions) you'd otherwise have to write in advance.
But it's also risky: you're running code nobody has reviewed. It could delete data or do something unexpected. That's why Andrew recommends running it in a sandbox, an isolated environment where it can't damage anything.
Error analysis
An LLM doesn't give the same answer every time (it isn't deterministic), but you can still follow good engineering practice.
The course spends a whole module on error analysis.
The process is simple:
- Build a small set of test cases (evals), for example 20 research topics.
- Run your agent and measure the output.
- Read the traces, the output of each step, to find which step is failing: the search query, the draft or the reflection.
- Fix that step and run the evals again.
Andrew says this process is what separates the teams who build agents well from the ones who just tweak prompts and hope.
This part kind of reminds me of the unit tests and E2E tests I write in my work as a developer.
Why Agentic AI isn't just hype
After the course, it was clear to me that Agentic AI isn't a replacement for programming. It's a new way of building software, where LLMs and classical programming work together.
The code I write follows rules, runs the same way every time, and is easy to test. But it struggles with anything fuzzy: understanding a free-text question, summarising a document, judging whether an answer is good.
LLMs are the opposite. They're great with language and ambiguity, but they can be inconsistent, and they can't act without tools.
Put them together and each one covers the other's weakness. Your code gives the structure, steps, tools, data, and limits. The LLM gives the flexibility, understanding, writing and deciding. In other words, LLMs empower classical programming.
Things that used to be impossible, or would have needed countless rules and edge cases, become a few prompts and a few functions.
If you want to learn more, I recommend Andrew Ng’s Agentic AI course. It’s practical: the labs are in Python and use only a small library (aisuite) instead of a framework, so the details aren’t hidden.