Skip to content
S4E14 AI Agent Building in Action episode artwork

Nov 26, 2024 30 min

S4E14 AI Agent Building in Action

from Invisible Machines podcast by UX Magazine Hosted by Invisible Machines

What’s it like to build an AI agent? Daniel Lametti, Associate Professor of Psycholinguistics at Acadia University, Visiting Fellow at the University of Oxford, and Senior Academic Advisor to OneReach.ai, returns to Invisible Machines to demonstrate how easy it can be to create and iterate on AI agents. Like other In Action episodes, you’ll watch as we walk through the practical realities of building these systems. This time, see how professor Daniel Lametti creates an objective-based AI agent that helps users craft and send emails. Though he’s hesitant to think of himself as one, conversational technologies have made Daniel a deft software developer. In this In Action episode, Daniel shares his experiences building AI agents with Robb and Josh. The trio discuss and show how coding languages are moving further into the background as machines become more adept at communicating in human language. Follow Daniel Lametti’s work: https://psychology.acadiau.ca/daniel-lametti.html Learn about orchestrating AI agents for your team: https://onereach.ai/ai-agents/?utm_source=soundcloud&utm_medium=social&utm_campaign=email_agents_in_action_episode&utm_content=1 #AIPodcast #TechPodcast #InvisibleMachines #AI #ArtificialIntelligence #AIAgents #AgenticAI #GenerativeAI #LLMs #ConversationalAI #InAction #NoCode #Automation #DigitalTransformation #NaturalLangiageProcessing #Email #SoftwareDevelopment #FutureofAI #UXDesign #MachineLearning #AITech

Episode details come from the podcast's RSS feed.

Embed this episode

Ready to play

S4E14 AI Agent Building in Action

0:00 30:21
of matches

Transcript Auto-generated, may contain errors

Welcome to Invisible Machines, a podcast where we explore the expanding world of AI agents and conversational technologies. I'm Josh Tyson, co-author of Age of Invisible Machines, a bestselling book all about the agentic approach to automation and the pursuit of organizational AGI. I'm joined each week by Rob Wilson, CEO and co-founder of OneReach.ai. Rob and I wrote Age of Invisible Machines over countless hours of conversation, much like the ones we have each week on this podcast. Rob has spent decades researching and deploying conversational technologies, and Invisible Machines is where we share big ideas with fellow AI insiders. We're continuing these conversations in partnership with UX Magazine because attention to experience design is critical to the proper deployment of AI agents or invisible machines. Today, we're excited to bring you another in-action episode with Daniel Lametti, Associate Professor of Psycholinguistics at Acadia University, Visiting Fellow at the University of Oxford.

and senior academic advisor to OneReach.ai. Within a mere matter of months of tinkering with AI agents, Daniel has put himself in position to update his title to psycholinguist and software developer. Using low-code conversational building tools, he's been able to create a whole host of agents, including a basic one that operates around the objective of writing and sending emails. In this inaction episode, Dan shows us how he built this agent, first setting its objectives and then creating a task flow connecting it with an email client. We also spend some time here talking about the diminishing role of coding languages in a world where machines...

can communicate in human language. As with all of our inaction episodes, this one is a visual demonstration of agentic software. Daniel shares his screen as he walks us through this agent build, and we recommend watching it on the Invisible Machines YouTube channel. Also, Daniel was on campus at Oxford when we recorded this episode, and you'll hear some occasional academic reverie just outside his door. So enjoy this lively inaction episode with our friend Daniel Lemetti.

Invisible Machines is produced for UX Magazine in partnership with OneReach.ai. Named a leader by every major analyst group, OneReach.ai's generative Studio X platform was built specifically to facilitate the no-code orchestration of AI agents. GSX is trusted by global giants like PepsiCo, PwC, Deloitte, and DHL, but anyone can experience the level of agent orchestration we talk about on this podcast through interactive demos at OneReach.ai. Now, on with the show. All right, well, Dan, we're really excited to have you back on the show to walk us through AI agents doing some email work for us. You know, I think we've talked a lot on this show and we talk a lot in our book about the power of AI agents operating our software for us, but it's really impactful, I think, when we can see what that looks like. And I think email is a great place to start because...

No one really seems to look forward to checking their inbox or responding to emails and dealing with that mess every morning. So let's take a look at how AI agents might change that experience. You're especially interesting to talk to you about this stuff because you don't think of yourself as a developer, even though over the past several months, you've been developing a lot of software. And I think that's happening by virtue of how much easier it has become to essentially write software conversationally. What kind of impact does that have on the way you look at technology and the way you look at sort of your capability as a human with good ideas?

Yeah, it's, I mean, the changes that we've seen in terms of large language models enabling us to, you know, have effectively conversations with machines, with computers, and to build software through these conversations, you know, the change is remarkable in that we can produce apps, produce pieces of software just a lot faster than we would have been able to, you know, even a year ago or two years ago. And in this case, I was really interested in AI agents. I've been hearing this term everywhere, like AI agents. And as an academic, I want to know where this term originate from and what distinguishes an AI agent from, let's say, just like a standard large language model. So any interaction that you would have with ChatGPT. And so I dug around a bit and came across this 2023 preprint from researchers at Google on chain of thought prompting. And I know that, Rob, you're familiar with this, but the idea here, right, is that...

We're instructing a large language model to decompose problems into steps and to solve the problem one step at a time, kind of like how a human would solve a problem. And when we do this, when we prompt large language models in this way, we get responses that are just much more accurate, right? And this chain of thought prompting seems to be sort of... the idea that is really at the heart of an AI agent and that they're, you know, I struggle to use the word thinking because I'm a cognitive psychologist and I believe that, you know, thoughts are sort of complex things that exist in human minds that don't really exist in machines. But, you know, we can call it thought of a form. They're sort of thinking through the problem, you know, step by step to come to a solution. I mean, so there's an example in that paper. So pretty simple. You know, Roger had five tennis balls. He buys two more cans of tennis balls. Each can has three tennis balls. How many tennis balls does he have now? Right. And so, you know, a standard LLM.

would just give you the response 11, but an LLM instructed to solve this problem using chain of thought would actually break that down into, you know, Roger started with five balls. He has two cans of three balls each. So that's six balls. Five plus six is 11. The answer is 11. Right. And this just leads to more accurate responses generally from, from these models. So definitely a big step forward, I think in that these models and, you know, my students have heard me say this so many times, these models really struggle with things like logic and reasoning. And this is kind of like a step towards

LOMs that do logic and reasoning a little bit better. The trick of the human mind, which I maybe haven't seen replicated yet in AI, is that we can decide to sort of think about a problem in a more slower methodical way, as opposed to just giving them the quick answer, right? Whereas now we seem to have AI that can do one or the other, right? Just give you the very fast response or give you the sort of slower, more thoughtful response. But presumably that will change in the future.

Yeah. Thinking about, you know, what else does an agent need? Okay. So it needs chain of thought prompting. It also needs guardrails in that agents are highly focused on an objective of some kind. So solving a very specific problem, right? So I'm going to show you an agent that helps you compose an email and then actually sends that email. And as we'll see in the demo, it's highly focused on just doing that. Right. Whereas a standard large language model, like an interaction with chat GPT, you know, you can.

ask it to compose you an email and then ask it, you know, what the colors of the rainbow are and it will veer off in that new direction, right? An agent won't do that. So that's important because, you know, if we want, I think like the most effective use cases of these AI are highly specific, right? So like focused on specific tasks that they're sort of built for. And so having agents that, you know, have these guardrails and can do very specific things is really important.

you know the third component in addition to chain of thought in addition to you you know focus a focused attention on problem is that uh agents can initiate real world actions right which again your standard chat gpt uh large language model can't can't do um and so my sort of journey into agents started with building an agent that helps users compose and then actually sends an email for them why that use case um you know as we were discussing at the start right email management is like a major problem for most people um it's a problem in academia but i've also seen a lot of students using chat gpt to compose emails for them um you know some of my colleagues are doing this as well uh and you know you have to copy and paste the the message right from the chat gpt window into your email client wouldn't it be cool if an agent could just do the same thing and then just you know send the email drive your email client for you right drive the software for you um and so that's kind of uh where my agent journey started i wanted to build an agent that would help you compose um

and then send an email let's do it let's take a look okay so uh we're in the agent builder in the in the one reach gsx platform um and there's a bunch of tabs here and you know really the key tab is the objective so what's the what's the purpose of this particular agent And I've simply given it some instructions that it's a polite AI that helps users compose persuasive emails. You know, it starts with a particular message every time. Hi, I can help you write email. What kind of email would you like? And then it asks the user for some information, such as, you know, the presuppient's name and email address to sort of fine tune the email before collecting all of the required information to actually send the email. So this is the agent's objective. And as we'll see in a second, it'll be hyper-focused on this particular objective.

Now, agents also have actions, so skills that they can perform in the real world. This particular agent has two actions. So it has the functionality of being able to have a conversation with the user, like a standard large language model. This is the say action here. And it also has the send email action. And say is really just like if they go off script. It's like people playing break the AI. Ultimately, like, what's the meaning of life? And so it doesn't just, you know, break. It just accommodates patiently, unlike me.

And then steers you back towards the objective. Exactly. Relentlessly and politely. Yeah. And then we have the send email action. And, you know, what this action does, it doesn't actually...

send the email. We actually do that in a separate process, but it collects all of the required information from the interaction to then drive the sending of the email through an additional step. And I'll show you that in a second. But let's just take a look at how this agent behaves. So in the right panel here, we can interact with it to test whether the objective that we set is actually being followed. And so we can see the initial message here. Hi, I can help you write emails. What kind of email would you like? So let's do something basic like I'd like my roommate to do the dishes.

Right. So a problem that we've encountered at some point in our lives, probably. In this case, it's gotten so bad that you have to send an email. That's right. Yeah. Well, this is like, you know, we're in, you know, it used to be when I was in university and when people would write this on a sticky note, right? Passively, aggressively leave it like on the fridge. But now you can- Yeah, so most of my friends received these, didn't send these, but yeah, I get it. Right. Yeah, exactly. Yeah. And so let's just take a look at, you know, what it produced in response. Okay. So I'd like my roommate to do the dishes.

And so we can actually see the thought process here. So chain of thought prompting leads to this intermediate thought. The user wants to draft an email requesting their roommate does the dishes. I will create a polite and persuasive email for this request. So it's using actually language from the objective itself. And then you get a draft of the email down here. Here's a draft of your email. Subject line, quick reminder about dishes. And then there's some information that we have to fill in. But the email looks pretty reasonable. Very friendly.

Yeah, it would really help keep the space clean and enjoyable for both of us if you do the dishes. So this looks pretty good. Let's add some information so we can say my roommate's name is Josh. Sorry, Josh. For the record, I don't mind doing the dishes. And so now if we can give us some more information, my name is Dan. And if we wanted to, at this point, you could even add, like, hey, maybe mention that doing the dishes can be a very calming exercise. Yeah.

I like it. Yeah, there'd have to be a couple of slots in here, a human in the loop, you know, because it won't add profanity. And that's probably required to actually get them to do the dishes. So you have to be like, okay, before I send this, please fill in the spaces for profanity because I can't. I love it. Here we've got Josh's suggestion added here. You know, doing the dishes can actually be quite calming in addition to keeping the space clean.

So that looks good. And, you know, we can, again, what makes this an agent is that it's really focused on this particular task, right? So if I asked it some random question, like, you know, what's 2 plus 2, it should recognize that this isn't related. right, to the question, to the objective. And so you can see this thought process here. The user is shifted to a math question, which doesn't relate to drafting an email. And so I'm going to gently, you know, maneuver the user back to the objective here, which is what it did. So just to recap, we have an agent here that has an objective, and that objective is to help users compose persuasive emails. The agent has...

Two actions. So an action called say that just involves the conversation, the interaction where the email is actually crafted. And then a sent email action, which involves extracting the information from the conversation that allows the email to be sent. So for instance, the body of the message. We're basically just training an agent right now. We're just using natural language instead of code. We're just training it, telling it what we want it to do and what its objective is. And that's it. It's almost too simple. Like people.

We'll look for the complexity. It's just not there. There isn't. That was it. Yeah, exactly. Training it, ironically, almost was as hard as writing an email. Yeah. Yeah, no, exactly. And, you know, there's a few more steps to actually get this, like, working within an application, and we'll look at those in a second. But, you know, the functionality of the agent is fully working. So it's asked for the draft again. So show me the draft again.

Okay, and so that looks good. Now, it doesn't have all the information that it needs to actually send this email, right? It doesn't have an email address. So if I say send it, it should recognize that and ask for the email address. Yeah. And so, you know, here it's recognized that it needs Josh's email address to actually send this email to somebody. Right. And so. Now in bot orchestration, if there was another Omni data agent that knew Josh's email address, they could have asked that first. Yeah. And then if the system, if in the digital twin, it had an email address, we're just probably confirmed with you instead of asked you to type it in.

Exactly. Yeah. And, you know, I could have also provided it with access to my inbox, right? Like all of my, you know, prior email exchanges with Josh, and then it would hopefully infer, right? That, you know, oh, is this the Josh that you're wanting to send this email to you and then, you know, suggest an email address. So that's functionality that could be added. And it's, you know, when you think about it, like if you were thinking about this problem one or two years ago, it...

would have seemed very complex, right? A very complex problem to solve. Having an AI that can do this and then perform an action and also have access to external databases. But it's really not that hard now with agents. You can build these AI very quickly. And this is a basic one. I mean, again, people think like this is complicated, but it's not because this could easily be, and maybe we'll show this in future episodes, but this could easily be evolved into taking accounts, all of your past interactions with Josh.

uh when constructing this email being like okay this is the third time i'd ask you in the last three months about the dishes like this this is all possible it's just um it's just iterating uh and and giving it that access through that history which you know it has if it's sent all three of them i think a lot of people over complicate this idea of software really not realizing that most of the time it's just an interim communicator it's just facilitating communication between one or more people you know and it's At some point, it just stores it and then sends it on. So there's data in and then there's data out. And so at some point, AI, as long as it can take the data in and structure the data out, it can replace a lot of the software we have. Yeah. No, exactly. Okay. So just to finish off this interaction, just give it a fictitious email here, josh.smith at, let's go with hotmail.com just to be old school. And it has everything that it needs now.

And so it actually performs the action. And, you know, when I say perform the action, the email isn't sent yet, but it's extracted all the information required to send the email. And importantly, from a programming standpoint, right, it's put the information into variables, right? So we've got the body of the email here, the sender's name, the receiver's name, the receiver's email, and the subject client. And these are all individual variables that we can then, you know, insert into our email client to actually send the email. So why don't we jump over to this? I think it's also important to, like, point out that a lot of this...

interaction with our old software, like that JSON and the object, the data object, and all of this is sort of an interim step, right? If our email client just spoke natural language instead of this cryptic JSON language, it's almost like Shakespearean, having somebody from that time having a conversation with us today, or we need a translator. But if our backend systems just spoke in natural language, this would even be easier. In fact, you could say our old software is what makes building agents. even marginally more complicated. If it wasn't for that, if it wasn't for interacting with these old systems and these old systems were AIs, this would even be easier. Exactly, yeah. That's a great point. There's a code step here, right, that wouldn't be required if computer programs just interacted using... Just had LLMs, yeah. If they all had their own ability to talk. Yep. Okay, so let's go over to the actual conversational flow and we can look at how this is inserted.

into a flow so that we can actually send an email and have like a working application. And so if you're not familiar with conversation design, a conversational flow is just sort of the path of the interaction. And what's nice about agents is that they make flows very simple. So if I was to build the same application using older conversation design methods, the flow would look much more complex. But here it's quite simple. We kick off the interaction, we say what kind of interaction we want. In this case, it's a rich web chat, so a texting-based interaction.

And we have our agent here. This is our email agent that we built in the agent builder. And then off of the agents, right, we have our two actions. So we have our say action. This is the loop that basically allows us to build the email. And then we have our send email action. And so that feeds into a step in the flow that actually...

you know, fills in the information required to send the email. So we can now, with like the agent inserted into a flow that actually like commands the action, we can take a look at the application itself. So the chat, where the action lives. All right, Dan, let's take a look at the user side of this experience. All right, so let's go with something sort of more abstract here. So Josh didn't do his dishes again. Classic Josh. Always letting us down with the dishes, Josh. Sorry, guys.

I was so caught up in an agent building, I just don't know what happened. So it's asking me if I'd like an email to address Josh about doing the dishes. See? Yes. And it's funny how in demoing us, we immediately go to asking it to send an email. But really, that's how we would say it to each other. Josh didn't do his email, like his dishes. Yeah. And then it's asking me for some information here. So my name, Dan, Josh, and I'll give Josh my email address.

And any specific message to include, the dishes are okay. There we go. Nice. Look at that. It's super important to realize that the message began with Josh didn't do his dishes. There was no request, just a statement. Yeah, and because it's focused on...

Dish doing, right? It sort of knows to ask, like, oh, are you requesting that Josh do his dishes? Right. So we see that these guardrails are really context as well. They help beyond just keeping it in line. We realize it also allows it to make assumptions about things you want to do. Why would you be talking to it since it's the email agent? It would assume that you're saying this for a reason. That's why it didn't just console you.

Oh, and that's just how we work as humans. And that's huge. You didn't have to pre-program it in any way. It just got that. Here we have the email in my inbox. And, you know, I sent this from a Blackmail account just because it's fast to set it up that way, but this could easily be set up. So this seems that Dan does not have an AI. Yes. He's still old school using an inbox. Yeah, exactly.

So yeah, so that's just an example of a very simple AI agent that does a very simple chore, which is helping us compose an email and then send it. But we know with enough emails from our AIs to Dan, Dan will be saying, I need to get an AI to respond to these. We can see that proliferation of AI through this channel. It's like different from the fax machine where you needed another fax machine. You can ask your AI to remind Dan once a week about the dishes. At some point, Dan will get his own AI.

to respond back and then they'll have a little AI spat between them. Back and forth, yeah. All right, Dan, well, thanks so much for showing us this stuff today and we'll look forward to catching up with you again soon here on Invisible Machines. Awesome. All right. Well, thanks for hanging out with us again here on Invisible Machines. Don't forget to like and subscribe wherever you get your podcasts. Always remember that you can watch this podcast, too, on our Invisible Machines YouTube channel. Head over to uxmag.com. We have a podcast page there where you can explore our back catalog and you can look at episodes centered around popular topics. Many, many thanks to our incredible production team here in the U.S. and in Ukraine, Elias Parker, Michael Lifinoff, Allison Harshberger, Alas Lesarenko, Vira Pakhodkov, and Darina Moskovchuk. Till next week. Owagi.

Frequently asked questions

How long is this episode of Invisible Machines podcast by UX Magazine?

This episode is 30 minutes long.

When was this Invisible Machines podcast by UX Magazine episode published?

This episode was published on November 26, 2024.

Is there a transcript available for this episode?

Yes, a full transcript is available for this episode. You can read the complete transcript on the episode page.

Can I download this Invisible Machines podcast by UX Magazine episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.