Agents seem to be everywhere these days đ¤
You open LinkedIn, and your feed is filled with agent-related posts.
Heading to Twitter for some funny memes? Yep, theyâre about agents too.
Ready to read some mind-blowing Medium article? You guessed it - agents once more! đ
Letâs face it, agents are one of the hottest topics right now, but letâs pause one second and ask: what exactly is an agent?
In this 5-lessons series, Iâll walk you through everything Iâve learned about agents, covering both the theory and practical implementation. To kick things off, weâll start with the fundamentals about agents and their basic components.
Ready to begin? Welcome to Lesson 0!
What is an Agent?
A few years ago, if you asked my about agents, the first thing that would pop into my mind was probably Agent Smith from The Matrix.
Fast forward to today, and thanks to frameworks like LangChain, LlamaIndex and CrewAI, anyone can build fully functional agents with just a few lines of code.
This is amazing, but it also comes with risks. The layers of abstractions can make it easy to lose sight of whatâs happening under the hood.
So, before we start creating our first Crews and LlamaIndex Workflows, letâs take a step back and try to understand what an agent really is.
Time for a a visual metaphor.
The Agentâs Brain
This might seem obvious, but itâs worth emphasizing: an agent is essentially a set of functionalities or abstractions layered on top of an LLM. Without the LLM powering it, the agent would be useless.
You can think of it like the human brainâif your brain were removed, youâd be out of the game (unless youâre some kind of zombie).
But sadly, a brain in a jar isnât enough.
We need ways for this âbrainâ to interact with the external world: to gather information, make plans, reason, and act.
Thatâs where the additional components come in.
The Agentâs Components
đ Planning Capabilities
The ability to break complex tasks into smaller ones, manage subgoals and even reflect on the results and do self-criticism (more on this in future lessons đ).
We humans are good at these tasks - well, maybe not so much at self-criticism - but how can we enable agents to do the same?
Thereâs a growing arsenal of techniques for planning and reasoning - expanding exponentially, I might add - but here are some interesting examples:
Chain of Thoughts (CoT)
Tree of Thoughts (ToT)
If you look at the diagram above, you might notice that the ReAct technique is missing! Donât worry, thatâs intentional, itâs just that I didnât want to spoil you the surprise đ¤Ł
ReAct is one of the most important planning techniques, and weâll dive into it in detail in Lesson 3, which covers the Planning Pattern.
đ Memory Capabilities
A key component of an agent is its memory.
The agent needs to be able to ârememberâ previous thoughts or interactions to plan, act on the external world or even have a simple chat with us! - imagine trying to have a conversation without recalling anything your interlocutor just said âŚ
We can divide memory into two groups:
đš Short-term memory
The most immediate memory, which for an LLM would be the context window.

đš Long-term memory
The type of memory the agent would need to retain information for a (potentially) infinite amount of time. Itâs also necessary for accessing information the LLM has not stored in its weighs.
Vector Databases such as Qdrant, Weaviate or Pinecone (among others) are good examples of these long-term memory solutions.
đ Tools
So, up to this point, we have an agent with memory and reasoning capabilities but ⌠what use would it be if it cannot interact with the external world? đ
With tools, the agent learns to call external APIs and services for retrieving information that is missing from the model weights (e.g. latest results of UEFA Euro 2024 â˝ ) and acting on external systems (e.g. adding rows to a MySQL database).
Weâll cover tools in detail in Lesson 2 of this series, where weâll even implement one from scratch! đŽ
To recap
As you can see, despite all the hype around these systems, agents are pretty simple! đ
All you need is an LLM as the âbrainâ, a mechanism to reason, a way to ârememberâ things and tools to interact with the external world!
If you like this post, I can assure you that youâll love the 4 posts that I have prepared for you. Code, videos, etc. All the resources youâll need to become an âagentic ninjaâ đĽˇ
See you next week friend! đ
Miguel
Good intro
Great job over here too Miguel!
Now I don't know what to do, learn a bit about mongoDB, reading docs about MLflow,Langchain and other solutions that we need and use nowadays, reinforce my current data science skills and move from there... I'm more lost than our agents without a brain hahaha đ¤Ż