What is an AI Agent?
Artificial Intelligence is getting to the point of being so good, that you can give it a task like: "Develop a platform game like Metal Slug", and it will find the best way to get it done.
An Intelligent Agent in AI is a practical application of Large Language Models like GPT-4 (ChatGPT) that allow you to delegate and automate complex cognitive tasks.
Imagine that one day you have the idea to create the next best software; one that might end world hunger, or just be the next big thing on entertainment… but you have just basic knowledge in programming, zero graphic design capabilities and no idea about marketing whatsoever. 😓 Here is exactly where intelligent agents in Artificial Intelligence come into place and get the job done for you.
Just like if you were casting a magic spell, all you need to do is to enter your prompt (the goal), and the AI Agent gets it done for you.

AI Agents: a whole team to your command
With LLMs like ChatGPT, the interaction is step by step, meaning that you enter a prompt or ask a question, and you receive one answer. If you want to refine the answer or dive deeper on the topic, you have to keep on asking and interacting with the AI model. The difference with AI Agents is that you can ask themselves questions, break down complex tasks into multiple streams and validate if each and every step is optimized to the end goal (your initial prompt).
This comes in very handy for cases like the one mentioned above, where you want to develop a piece of software and you need a whole team for programming, testing, marketing, monetizing, and so on. In such scenario, one agent can act as the CEO, other as the programmer, other as QA, other as marketing, other as legal… (you get the point), and interact with each other at every step of the process until all of them deliver the final product. 🤯
One example of this is ChatDev, which is an Open Source project, and according to its creators:
The primary objective of ChatDev is to offer an easy-to-use, highly customizable and extendable framework, which is based on large language models (LLMs) and serves as an ideal scenario for studying collective intelligence.

How does an AI agent work?
Once you define the goal, the AI Agent starts an internal monologue with the LLM and validates its output to create a list of tasks that will be ordered and tackled one by one in order to achieve the final goal.
After the action plan is set in place, the AI Agent starts collecting information online and also from other models to get things done; like ChatGPT asking Dall-E for an image to use as a logo and Jukebox for an audio clip to be the jingle of your marketing campaign.
One important thing to keep in mind is that your AI Agent keeps track of all of the data collected and measures how far is still from the end goal, so it improves autonomously at each iteration based on its previous learnings.
Types of Agents in AI
Now that we know what is an Agent in Artificial Intelligence, let’s take a look at the most common types of AI Agents:
Goal-based agents:
Given a goal, they proactively set a long sequence of actions before deciding if the target was achieved or not, as they don’t always have all the information they need.
Simple reflex agents:
Based on if-then rules, this agents only succeed if they have all the information they need before starting their task.
Model-based agents:
Composed of a Model and an Internal State, this agents act according to the model they are using (like a set of rules) and adapt their state as they understand the result of their actions.
Utility-Based agents:
They keep track of a number as a measure of progress or efficiency, where for each action, the agent keeps track on what is the faster, safer and most convenient way to reach their goal.
Learning agents:
Leveraging on their memory and capability to adapt, these agents challenge themselves through 4 internal components: Learning element, Critic, Performance element and Problem generator. This complexity and feedback loop allows them to outperform the other types of AI agents.
How much does it cost to use and implement an AI Agent?

At the moment of writing, there are limited offerings on the market of AI Agents, but without a question, this niche of AI implementation is set to get a lot more private and open source implementations. We talked about the example of a developer that has the idea of creating an app and starts a group of AI Agents to build, test and market it for them, but this type of technology would fit organically as a keystone to improve the efficiency and revenue of existing companies.
Time to crunch some numbers:
An AI Agent like ChatDev can be downloaded and executed for free, but… it is necessary to map your OpenAI API key in it so it can be used. Let’s take a practical example checking the logs of a Flappy-Bird-like game built with ChatDev:
2023-26-07 12:15:48 INFO] [OpenAI_Usage_Info]
prompt_tokens: 1420
completion_tokens: 500
total_tokens: 1920
Cost per token (as of September 2023, using GPT-4 with 32K context):
Prompt tokens (Input): $0.06 / 1K tokens
Completion tokens (Output): $0.12 / 1K tokens
(0.06 x 1.42) + (0.12 x 0.5) = 0.1452 → $0.1452 🤯
Pretty sure this quick calculation makes you want to try it yourself and compare it with the price of what a Freelance developer (or group of developers) may charge you on Fiverr for the same trick, eh?!

Keep in mind that if you are skilled enough, you could tweak the software so instead of using GPT-4 via your OpenAI API Key, it reads a model that you already trained and fine-tuned according to your specific needs, so it could even run in a sandbox and without internet access. This means free, fully private and self improving according to your industry (banking, military, cybersecurity, etc…) 😉
If you find a Colab or repo that does that trick, remember that Sharing is caring ♻️
Conclusion:
AI Agents are like the Tony Stark’s Jarvis of Artificial Intelligence, and even though they are a relatively new technology, they already have the power to develop and optimize software like if that’s a simple task. How would you use an AI Agent today?