Agent Workbench - Ep 1 - The AI Agent
Loading YouTube video...
Video ID:SDPofVdfmg8
Use the "Analytical Tools" panel on the right to create personalized analytical resources from this video content.
Transcript
Hi everyone, Thiago here. I'm an
outsystems architect and an agentic
architect and today we are going to
start exploring agent workbench. But
just before going there and start doing
practical things and talk about the
different parts of it. Let's start by
the definition of what an AI agent is.
And the reason I'm doing that is because
I I I see a bit of a a challenge on
everyone to know exactly what should be
the scope of an AI agent, right? Because
so far we have human agents, so far we
have automation, but now we have this
new player in the market, the AI agent
and not every use case should be given
to an agent. So let's explore what an AI
agent is and let's finish here with a
more target sense of what should be a
correct use case for an AI agent. So
let's do this
starting with a very simple question.
What is an AI agent?
And to start with this, let me first
show you here an image. So most of you
are already familiar with this, right?
So this is chatupt
and a lot of us use this uh some in a
daily basis, others when they need
something specific, right? But what I
want to ask you guys is do you think
that chachip is an AI model or an AI
agent?
And to answer this, let's start start
first by an AI model. So what is an AI
model? The AI model is the foundation of
an agent. So this means that the AI
model is a closed box with a very
complex algorithm inside to take
decisions. And this algorithm is mostly
made out of uh really complex neural
networks. uh you might heard already
things like transformers
uh and things like that. So it's a very
complex algorithm and the only thing
that he does is to receive a set of
inputs in this case tokens in a form of
text right and based on the input that
he receives he and based on the train
that he got from huge amounts of data he
calculates that the best uh or the most
suited next token to give is the word
blue. And then if we concatenate this
and give it back to him, the sky is
blue. He calculates again the next word
and gives the end. And we do this until
we consider that we arrive to the end of
the answer. So you can see that an AI
model is a static thing, is a
an isolated thing. It does not have
memory. He does not have tools in the
way that we are normally
giving them nowadays to agents, right?
He is just a very complex algorithm in
the box. And if you guys want uh there
is a really cool visualization, a 3D
visualization of uh some AI models um in
this link. I will put it also on the
description so you guys can go there and
see a bit more in detail what an AI
model is. But now let's go into the
agent. And this is a tricky thing
because
despite the fact that all of this hype
nowadays makes us think of an agent has
an AI thing, right? In reality, agents
already exist has a concept since the
70s when we started first to have
multi-agent systems uh used for example
in factories in robotics. Um so since
that moment that there was this concept
of an agent and an agent is an entity
that has the capability of reading from
the environment
of making decisions based on that and
then taking actions.
So if you have a piece of code or an
entity anywhere in the world that has
these three characteristics. So it's
something that can read from the
environment. It can make the decisions
based on some decision maker algorithm
and then take actions. This means that
you have an agent, right? So this means
that for us to have an AI agent, the
only thing that we need to do is to take
this middle part the that we have that
we call the decision maker, right? And
replaceer replace it by an AI model. And
by doing that if we complete the concept
of having different types of inputs like
user input uh giving a database uh
information or giving a web page and we
also give him the capability of in
taking actions upon the environment
right like giving responses or calling
tools to write on databases run logic
whatsoever. So this means that we are
facing an AI agent.
So
if we want to look into an AI agent, an
AI model and compare it for example with
ourselves, this means that having an AI
model is the same thing of us having a
brain. If we look it in our brains
alone, they cannot do much, right? Only
our brains or our brains alone cannot
interact with the environment. They
cannot take action upon the environment.
They can make decisions but they cannot
do anything rather than making those
decisions. Right? To do this a brain
needs to have inputs. He needs to have
eyes. He needs to have ears. He needs to
have uh nose so that he can get data
from the environment. And at the same
time he also needs to have the
capability of acting upon the
environment right he needs to have a way
to command our arms to move to touch
right but he also needs or um he can
also use the mouth for us to talk like
I'm doing right now. So if we combine
our brains with all our body including
sensors and actuators
we have an AI agent. So in this case as
humans we are also a type of agent right
because we also have a brain has a
decision maker we also have sensors to
read from the environment and we can
also act upon the environment. So we are
indeed a type of agent.
So
so far we talked about this difference
between an AI model and an AI agent,
right? So if we look again to the first
question of is chat GPT an AI model or
an AI agent. If you guys notice nowadays
when you are using CHP you can see that
he has the capability of reading
different sources of information. So you
can give him documents text but you also
can tell him to fetch web websites
information. Um right so he has
different types of inputs to read from
the environment but he also has
different outputs. He can also um call
tools. He can also generate code and run
that code. So in reality when we talk
about CH GPT we are talking about an AI
agent.
So chat GPT is in fact an AI agent
because if we realize from it it has all
the capabilities to be considered
according to a definition an AI agent.
Now
we talked about what is an AI agent,
right? But in reality, we know that he
can act upon things. He can read from
the environment. But where can we use an
AI agent? So let's look into a typical
scenario of an enterprise, right? So
imagine that we have a business and that
business uses or has a CRM application
or a CRM domain, an HR domain and an ERP
domain. And for each one of these
domains, they have a set of applications
with screens. They have background logic
and they have their own databases and a
set of APIs. Right? So you can imagine
this as being an outsystems environment
but also any other technology stack. So
this means that we can look into the
different layers that the agents can be
implemented right. So considering an
agent something that reads, thinks and
acts, right? So we can look into the
different layers and starting for
example with the layer from the UI. We
can have a chatbot for example that is
implemented in a web page or a web app
and we can talk with him using text.
This is a very common use case that we
see nowadays. But we can also have an
agent that is inside a certain process
or in on the server side in the
background
uh logic of the application and
performing all sorts of proactive
activities. He can be for example an
employee validator or an onboarding
agent here for the HR system. And then
we can also have an agent that it's not
on the database because it's not
possible to have agents on the database
but he can be specialized in reading
data fetching data from the database
with the goal of validating that data
checking the health of the data making
fixes and so on. Right? So we have here
in these three layers but then we can
also have an agent coming from the
outsides right because the fact that we
expose APIs to the exterior this means
that we might want also to give the
capability of external agents to act
upon our systems right so we can also
have an external agent contacting our
systems and at the same time we can also
have an agent and fetching data from our
systems to produce other effects outside
the scope of these three applications.
So when you see we can indeed deploy
agents in a very huge stack of
possibilities. We are not just talking
about having a cute chatbot uh on the
the web pages. We are talking of full
stacks of agents that can really
automatize, improve and make our life
better.
So
we talked about what an AI agent is. We
talked about the places where he can be
put. Now let's see what type of tasks
should we look into it. And the reason
to do this is because not all agents
should be treated in the same way. Not
all AI agents are a generic universal AI
agent. It always depends on the use
cases. And if we look into the three
aentic layer coverage, you can see that
it is very common in a business that
converts or wants to convert into an
agentic uh architecture. It is very
common to have these layers of agents
where we have personal assistants that
are really close to the user and they
are uh more targeted to uh talk with the
the with the user and to build a
relationship with the user. So they need
to be uh more conversational models. But
we then have the business agents and
these business agents they are indeed
experts in a certain domain and they
should work under the hood in the
background uh improving things
automatizing and so on. And these two
agents they are completely different in
the way we build them. And if you want
to know more about it, you can check my
previous videos about the the the three
agentic layer coverage and the way we
can build these agents.
But now
going again to the tasks
there was there was a study performed by
Deote in 24 that they uh evaluate
hundreds of thousands of tasks in
governance and their goal was to try to
classify the tasks based on what task
should be mostly given to humans
AI or automation
And so they analyzed the tasks and they
created three dimensions on those tasks
and they started with the first
dimension of creativity difficulty. So
the meaning the capability of towards a
certain task be creative about it and
come up with new solutions new ways of
completing that task. Then we have the
context variability. And this context
variability is the capability for us or
the agent to adapt
the to the task to the environment and
perform accept changes or variations
that might be required to complete that
task. And finally, precision. So the
effectiveness
or the accuracy that you can complete a
certain task using the less amount of
resources.
So in this triangle
what we notice is that before this new
era of AI there was a really clear way
of separating human work from machine
work. So if we were talking more about
precision, it was all about automation,
right? Making things work almost 100% of
the time. But if we were talking about
tasks that require creativity or uh
variability, adaptation, we were talking
about human domain. But then with the
evolution of AI, we start having more
and more modules and more and more uh
complex algorithms that could approach
and could give some creativity
capabilities and s some adaptation
capabilities. And then
large language models appeared. And this
completely shift the way we looked
before into human work and machine work.
Because with large language models and
the different types of models that
started to appear underneath it, we
start noticing that they were really
useful for tasks more on the human work
side. And this brought a new era to gen
generative AI. So this means that in the
initial triangle
defined by these three uh dimensions of
a task, we can give automation or we can
give tasks that require really good
precision mostly to automation. So we
are talking about um things that cannot
fail. um if they are repeated 1,000
times they cannot fail. So we are
talking about robots. We are talking
about deterministic codes, deterministic
algorithms, right? But humans they are
they still domain the area of context
variability and creativity. So for jobs
that rec require really social
interaction
um or really complex physical tasks,
those still are still done by us human.
But then we have here this middle of the
triangle and here is where tasks that
require somehow of a precision but they
also require some good adaptation and
creativity they lie into gen AI or
generative AI use cases. So we are
talking about summarize, we are talking
about uh compare specifications
uh comprehensive
tasks, explain uh subjects uh and for
example generate codes and functions. We
saw that AI is handling that really
well. So this is really important when
we are thinking about the use cases we
want to solve by building agents in the
agent workbench because we should always
ask ourselves if the task that we want
to solve if it is a task that requires
adaptation and creative creativity or if
it is a task that is just precise is
deterministic and there is a mathemat
mathematical way of doing it without the
need of adaptation
and this could change completely the way
we look into a use case and know if it
is a use case for an agent or not. So
let's now look into some examples
to see if you guys can uh answer
correctly if it is a good use case for
AI or not.
So let's check the first case. I want to
build a ticket support agent that reads
help desk emails and based on those
emails he can create the tickets on the
ticketing system so that he can fill the
title, the date, the priority, who asked
for uh for help and the description.
So we have an agent that reads an email,
digests that information, and then
using somehow a tool or logic, he
creates a ticket with a defined
structure.
If you answered this has a good use case
for an AI agent, you are right because
the most important characteristic here
is that we are asking the agent to read
something that is unstructured
that is the email. Right? There can be a
lot of different ways to write an email
about a ticket asking help. So indeed
the agent needs to adapt the the
situation to the text that he is
reading. Right? So this is a really good
use case for an AI agent. But also a
very important thing is that we are
asking him to read something
unstructured and then convert to
something structure. Convert to a sort a
sort of a structure. If we look into our
systems that has a title attribute, a
date, a priority uh request and a
description. So this is also a very good
use case for uh AI, the conversion of an
unstructured data to structured data.
Now let's look into the second case. I
want to build a data validator agent
that receives a JSON
and checks if the fields on that JSON if
they have the correct data format and if
they have for example if it is a text if
they have a length below 500 characters
and if the validation of that data went
well he stores that result the JSON in a
database.
Is this a a an AI use case or not?
If you answered that this is not an AI
use case again you are right. And the
biggest reason we are considering this
is because all of the actions that we
are asking the agent or not to do, they
are deterministic. So let's see for you
to check if a certain attribute
has the correct data format. You have
lines of code that can do that. Check if
it is a text. check if it is a number.
Right? Also to check if a certain text
field has a correct length,
it's also a deterministic line of code.
You use in case of out systems, you do a
length of the fields and you check if it
is below a certain value.
And then finally, if everything is okay,
you are saving a record in the database.
that is also deterministic because you
are using a crude action to do that. So
you see all the actions that we are
asking here for the agent to do they are
deterministic. They don't need any
adaptation. There are lines of code that
can do that directly. And because there
are lines of code that can do that
directly that is more effective because
that is more precise. It's it's faster.
It requires less processing power. So it
is better to simply use automation.
Let's now check the third use case.
So I have or I want to build a medical
advisor agent. So I want an agent that
picks the full historical data of a
certain patient and based on that data
and based on all medical knowledge in
terms of the of all books all sorts of
information that exists he builds a
report and he sets a group of actions uh
treatments and appointments for that
patient. Is this a use case for an agent
or not?
So, this one is more tricky because to
simply start this with a yes or no,
we have a yes, but the reason for that
is because this is a very huge use case.
Just imagine for example this scenario.
In this first case, if you wanted to
train a human to be able to do this,
most likely in one week you would be a
you would be able to have someone have
already a human doing a good job in here
in picking an email and then filling a
ticket. Right? So we are talking about
of one week of on boarding right and the
reason for that is because the tasks are
quite simple or the amount of
information is not big. In this third
case,
if you wanted to have a human to be able
to do this,
they exist nowadays. They are called
doctors and they need to study years and
years and they need to continue be and
be continuing learning new uh skills and
new information because this is a very
huge and complex task to do, right? for
you to be able to check all the history
of a patient. So we are talking about
reports, we are talking about
information from exams and um even for
example if there is IoT devices uh like
a heart device. So we are talking about
a lot of data but also about a lot of
medical knowledge right if we see all
the books all the
gigabytes of information we might be
talking in terms of medicine it is a lot
to process it's a lot of text so this
means that yes you can build an agent to
do this but it will be very difficult
for you to have an agent
that is really effective in this
situation. It will be really likely if
you just give him the information and
ask him to do something and uh receive
the results from it. It's very likely
that he will not be effective. He will
not give you good results in terms of
quality. So how do you fix this? You
break into smaller use cases. So you
could have for example an agent that is
only job is to index the huge amounts of
medical data that exists from the
outside and to use for example a rag
system to retrieve contextualized
information and then to summarize it
that information to a second agent and
then you could have a second agent that
receives the data from a patient
receives gives the summarized
information from the other agent and
then based on that probably he can
already do a better job. But even so it
might be required for you to even break
this into a bigger team of agents. So
yes, it's possible but it's not easy.
Fourth case, build an a an ebam
validator agent. So, I want to have an
agent that picks a set of transactions
from a certain business and validates if
the eban is a valid number and if so, he
updates the status of the transaction to
verify it.
Is this an AI agent use case or not?
So
if you took the example from the second
case and if you know in fact how an EBAN
is verified, you might notice that no,
this is not at all a use case for an
agent. And the reason for that is
because the EBAN validation is a
deterministic piece of logic. So it
follows certain rules. He sums numbers.
It checks characters in certain
positions, but all of those operations
are deterministic. So this means that
most likely you already should have a
library, an orange ball somewhere that
could do that in the deterministic way.
Finally,
the last case, a similar one, but let's
check here. I want a financial
transaction agent that again picks a set
of a transactions from business and
verifies if the data is correct of those
transa transactions. So if it has an if
the is valid uh if it has a date um if
the date is in the past if it has a
description and so on.
And he also verifies in the description
if there is enough information to track
uh track that transaction to a certain
operation to a certain order. So it
checks if the it has the necessary
details about the product and the store
and other details that might be
necessary and if so he puts the
transaction into the status of verified.
So in here what should be the correct
answer? Is this a a good use case for an
agent or not? This might be similar to
the use case for but there is a small
difference is that we are asking the
agent to verify the description and
check if there are some conditions in
that description. And that description
is in an unstructured information,
right? Because we might have a store
that puts first the product name, then
the the name of the store. We might have
another store that puts first the name
of the store uh including the address
and then the product name, full name.
You might have another store that just
checks uh if or just puts a product code
and the name of the store. So there can
be a very very different uh very many
different and structured ways of filling
the description. So in this case we do
need adaptability right. So just because
of this small condition this means that
we cannot do all of this using just
lines of code and deterministic
u functions. We need indeed to have an
agent and yes there will be a mix of
validations that can be done by code and
should be done by code. So the agent
should have the capability of giving
that information to an orange ball to a
certain logic to verify what it is
deterministic. So to check the check if
the fields are in the correct format and
so on. But then he also needs to do on
his own not giving to a certain piece of
code he needs on his own to validate if
the description is wellmade or not.
So this is indeed a use case for an AI
agent.
So after these use cases, let's recap
here what we did. So today we talked
about the difference between an AI model
and an AI agent. After that we picked
this concept of an AI agent and we
aligned the different layers that we
could introduce AI agents in web
applications, right? So we are we could
be talking about the UI layer logic or
more close to data or even to allow
consuming or exposing APIs for agents.
But then we finished this by also
analyzing the different types of tasks
that we can have and what are the better
tasks that are suited for AI use cases.
I hope that this video could help you um
depreciating the different scopes that
we can have and this is really important
because
due to that if we deliver
uh better AI use cases, more suited AI
use cases, we ensure to our clients and
to our projects, we ensure that
outsystems stays a good quality AI
powered low code platform that can
deliver not only applications but
agentic functionalities to the business
uh and the issues that we want to solve,
right? But at the same time, we are
starting to have a lot of agents in the
forge, right? Everyone is doing uh their
part to start working with the community
and start working together developing
agents. So it's also really important
that we start from the beginning knowing
what should be a real concept of an AI
agent so that we can have indeed better
quality of agents in the forge. I hope
that you like this video. Let me know in
the comments if you have questions about
this and have a great day.
Analytical Tools
Create personalized analytical resources on-demand.