Mastra Hackathon, Performance AI tool, Sales compensation agent
Today we talk about the MASTRA.BUILD Hackathon, we discuss workflows vs. agents, we bring on a hackathon participant to show of a web performance AI tool and finally work with a community member to build a sales compensation agent with Mastra.
Episode Transcript
hey everyone welcome to Monster Live I'm Shane I'm Abby And today we are going to talk a little bit about the Monster Hackathon that's going on right now Monster Build And we're going to bring on a few guests One uh person is going to talk about what they're building during the hackathon And then we also have someone who's going to learn alongside us Uh we're going to we are
going to uh work with him to see what he can build in you know maybe half hour 45 minutes Yeah I'm pretty stoked about that We actually uh met uh this guy at a random was a bar in the dog patch Old factory brewery Yeah Solid brewery by the way You know where where they were serving pizza They were serving pizza Not not
their pizza We had to bring in pizza But that was a the random AI events that you you know that you are part of Yeah Like like we said in like a couple streams ago like if you want to eat for free in San Francisco go on Luma look up any AI event that starts at 6 PM and you will you know you know on Twitter all
these people are like I'm I'm living off 1,500 bucks Like I feel like that's how you do it you know yeah Yeah It's like it's like you used to be like ramen profitable It's like pizza profitable You just profitable just eat pizza for free in San Francisco Yeah We have zero burn and our groceries come from uh AI meetups Yeah At least five days a five meal You can get five solid meals a week minimum Yeah dude
Maybe more Yeah And then you go dumpster diving with the other fools in this Yeah Yeah I mean I I don't know if they're quality meals A lot of carbs and but you know you get some you get some uh some good pizza some bad I guess depends on the the quality of the meetup Yeah I judge meetups by the quality of the
pizza that they provide Yeah like the better the pizza the more that they understand the trope and then like the more they invest in like good stuff So I feel like people should just have better pizza Yeah for sure Um well as we sometimes say we are we are not sponsored but if we were we're sponsored by Principles of Building AI Agents I got my book back here Obby did you bring
one with i know you're not at you're not at in the the Palace of the Dog today I'm not in the Palace of the Dog Let me double check if I got my book of mastra on me You need need to have always have to carry the book of master Uh oh I don't Dude how am I going to You You are not prepared You're not prepared You failed You failed the test today You
failed the test Um yeah Uh but we are all admirals of AI as we like to say And so we're going to try to convert a few more people at least Huey as when he joins later We're going to be building We're going to talk through his use case he has some ideas of things he wants to build with Maestra and we'll just you know try to help help him out and you all can hopefully if
you're not familiar with MRA learn alongside him and use the chat for questions whether you're on YouTube or X or LinkedIn wherever you're seeing this you can make a comment at you know to the chat and we can pull it up and see what you know what you all are asking or what what you want to yeah what do you want to see from what we're
But what what else is on your mind dude what What do we We had a new release today right we had a new release today I'll kind of go over that real quick Um let me find my screen here Um yep Before I like so first I want to show off um we get a lot of questions about like how our release process works or when do you when can you expect
releases and stuff and so Monster right now is pre 1.0 So we're in a like we we do follow Sever as much as we can but you know we are pre 1.0 So essentially we're in like technically anytime can be a breaking change We try not to but this is kind of what it was So we release alphas every day I think we're about to
release another alpha from some fixes that just happened Um so the alpha channel is pretty much the daily channel You'll get updates for every PR that we merge We publish alphas for them Um if you need fixes they're usually in there And if you need us to fix anything or we broke some or there's a bunch of bugs we'll fix it there And then on Tuesdays which is today we do a stable
release We could do a stable every day if we wanted to but it's good when you're engineering team moving at a pace to have like some type of stab like day where you're going to make a you know draw a line in the sand and say "Hey this is what we're going to put out today." So that's pretty much how it
works If anyone wants to I'll put this in our stream here If anyone wants to read this so we don't have to answer questions about it It's right here And um yeah so the highlights of this release there are two main highlights that I really want to talk about Um one is we have MCP support in MRA like MCP server support in MRA So you can build MCP servers attach them to
the Monstrous server and then deploy them to the cloud provider cloud provider that you want which is dope You can kind of collect all your MCP servers together deploy them and if you're using SHTTP we also support SSE but if you're using all those you can then pretty much deploy MCP servers and then use them in your editor or MCP clients So that's one
that was pretty sick And then the second one up to note is we added runtime context to the playground So runtime context is a huge feature for us where you can do dynamic things uh and agents and tools and stuff So the problem is we added runtime context people started using it but then if you go to master playground runtime
context is empty So if you made assumptions in your application you want to test them how do you do that so we added like a little runtime context playground thing where you can add context and then you can you know run actions in there So those two things should improve quality of life for a lot of people Uh what do you what about you
Shane any excitements from this release today yeah I mean we did ship uh we didn't we ship you can pass a workflow to an agent that went out That's a good one too You can pass workflows to agents That's like a small thing because you could always just wrap a workflow call in a tool and you could pass the tool to the agent So it wasn't like it was that much code but we just made it really
easy It it feels like feels more ergonomic when you can just like send create an agent and give them workflows and those workflows just show up basically as tools to that agent And so it allows you to kind of I don't know build some pretty interesting complex use cases where you can build we actually had we had office hours today
for the hackathon which essentially is just us hanging out in Discord uh in a chat and we had you know maybe dozen or so people join and just talk about some of the stuff they were building and one person just asked a question How can I get uh somehow decide between have some agent that decides between workflows
they wanted to almost like build it into the workflow And I said well now you can just create an agent pass the workflows to the agent in your system prompt basically write the routing logic and then let the agent decide which workflow to call based on whatever the prompt is whatever the condition is that would trigger that And that's kind of a nice
way to weave agents and workflows together So you can get the the best parts of a little bit more determinism with uh with workflows but still uh kind of weave agents into the mix Yeah like that actually brought up a second thing that's happening in Discord right which is once you have like a top level agent
and you have workflows running that may call sub agents you want to merge the stream that you're giving your user right like you let's say you're doing a stream and use chat or something All these workflows are running agents too and you want to like hook into the main stream in your UI So we're going to like we're going to work on that kind of
coming up I can actually show So Ward Ward has been Ward the farmer If anyone doesn't know Ward he's a farmer He's like the top level of the engineering food chain Yeah As we've learned I don't uh was it Goosewin made a had a tweet where basically said above principal engineer is farmer right so you eventually just you grow past principal and you become a farmer So that was Ward's trajectory Yeah So for us we've
we have like we don't have let me share my screen real quick Um so we have this draft PR that we're working on right now for workflow streaming So like workflows if you look at the agentic landscape right it's all like assistant uh bots or chat bots and chat UIs but how do you chat with the workflow it's not really the same thing right um the AIS SDK has this thing
called the data stream protocol which we also use and so we're trying to like form that protocol into our workflows that way when you have you can have workflows events in the data stream you can also call sub aents and then those would come into the data stream and you know here also I'll put this in the reream so if people want to read it they
can but this is kind of like the next thing we're trying to get going which is you know one can you stream workflows and then what's the UX around that like what does the UI look like when you interact with their workflow because it's not necessarily a chat maybe it's like some Tanstack form or some or whatever and then I don't know so we got to talk to people who are smarter than us about
that yeah definitely and we do have a special guest so we have two special guests today as I mentioned for those of you that have joined in since we started You I'm Shane this is Obby We're from Maestra We are talking about the hackathon that's going on right now Go to master.build if you you haven't
already You can still sign up It's going on all week So it's only Tuesday There's still a lot of time to sign up and get submissions in But we're having uh and I am going to try to pronounce your name correctly but I'm bringing you on So you definitely correct me if I mispronounce Venicious is actually in the hackathon
building something and so wanted to come in share what uh what's getting built and we will then uh learn a little bit about it see how uh how it's getting built and how we can maybe help or if nothing else get some feedback from those of you that are watching So let's bring let's bring him on Hello Hello Hello Thank you for having
me It's a thanks for being very nice to be here Um and thank you for organizing the hackathon as well It's quite brilliant an opportunity to bring the community together Um yes So I'm Venicious and I am building um you you can call it like an AI dev tool Um so it it serves as a both as a knowledge assistant and also um as a as a dev tool that it's a reimagining of how you know
a performance dev tool could look like when you put you know AI and agents as you know main stage and main driver So let me share the screen Yeah So we're going to get get to actually see it That's cool That's awesome This is like a show and tell Yes So I've been using Mastra um to as a main driver So I tried out a lot of
different frameworks uh before before landing on Mastra and I wanted to make sure that I was using the best tool for the job so to speak Um so this is built with master and built with Verseli SDK and also next Um it's based off of a fork of mine of ChromeDev Tools to read um the trace files So let me drag a trace here
um into this So I'm just dragging a standard you know Google Chrome trace And what you have right off the gate is suggestions um based on one of the endpoints from the assistant So there is um several assistants built with master and there are several workflows and it's built on top like it's built to kind of emulate a
mixture of experts like architecture where you have different experts and different workflows based on what kind of topics I'm trying to answer Um so it's been built with that purpose Um and we have and then you have here um right off the gate because this is built as you know reducing the friction and lowering the barrier of entry to users
that are trying to solve problems with per about performance but they don't necessarily you know they they don't necessarily feel comfortable on going to the performance tab and you know trying to understand a flame graph and all that kind of stuff So right out of the gate you have based on what you know the
agent sees on the trace you see some recommendations from what you can answer or what you can ask the agent So he sees that you know LCP is a big problem for this trace and it also sees uh um you know rendering paths and as a problem Let me grab another one Let's see let me see here So if if I can I'm trying to
you know bring as little of a dev tool as as possible into this So I'm generating some stats based on the trace that I see some histogram based on activity within the trace and also you can um just change different navigations because within the trace you can have more than one and then here you see different uh um recommendations for that
So so I can try to see what how can I improve my inp based on this So it will run the the workflows on uh and it will try to assess what kind of uh um option should it should the agent you know provide So it can just oneshot an answer like it's trying to do here um based on on overall knowledge around um a certain topic but I can also ask it to analyze
the trace How about the MP score on the trace so it's going to analyze the trace and generate a report So it will build grab uh relevant information from the trace give to the master agent and run a specific workflow to give insights based on this um this trace So it will try to understand you know basic basic values from the from the metric specific So as you can see here I I have it's still
going on the generation of the reports There you go So I as you can see I have 285 milliseconds for this INP score and you know it try to give overall recommendations and also uh give specific recommendations based on what it says on that trace file So the specific moment in time the interaction happened how the interaction loop would look like inside of a trace you know a quick snapshot of the call stack and
some observations that it can uh get out of that call stack So you know what uh what kind of p emerging patterns there are So it says here that um I have an nextjs recursion loop of sorts So I could try to fix that Um yeah and I mean can also ask for the deep research Can you research on the topics on the um
recommendations given and you run a you know deep research form of analysis So grab whatever he has learned and execute um some research like it's not it's very it's rudimentary uh right now of course but um you know the basics of the workflow is already in place so it's is it will uh come up with a plan and execute on that plan um for both for researching and gathering
different URLs and ranking them and also analyzing them to generate a report Yeah this is this is really cool dude This is dope Yeah this is really cool I I uh I have so many questions We are not gonna have time for all of them but we have like five minutes Anything else that you wanted to show before I just pepper you with questions because the like ultimately I want I want to know
like dude how'd you build this like let's talk about it I think that's what that's what the audience I'm speaking through the audience The audience wants to know Yeah All 76 of them Yeah All Yeah They want to know how you could how they could build something not exactly like this but something like this So first of all anything else you want to
show before we start hammering you some questions um yeah I mean this is the the gist of the project Um it will generate reports and generate insights based on trace data to help you uh developers solve performance problems right and also it serves as a knowledge assistance through the DIP research So you can you know come up with different uh research plans based on what you have learned and
what the agent has learned whilst analyzing different traces Um yeah this is this is what uh what I have for now Very cool Yeah All right So first first question can how do people access it is this is this something that they're going to be able to download and try out where is it going to live yes Right now I have um I have a a uh um a page up So
agent so I can put it here on on the chat Hang up Yeah If you you should be able to hopefully just drop it in the chat And for some reason my chat is not working Um can you drop that in the chat Obby mhm Yeah So it has a wait list and I'm going to be opening for for you know broader access um very very soon I'm I'm
starting to just you know prepare the release because there are different workflows that I need to plan and and you know working with with the the this complex you know attribute I'm right now building attribution models to in order to extract information out of the trace build attribution models before handling stuff to to the agents to gather better
insights because I've done a lot of experiments on just extracting raw data out of trace and handling to the to the agent and that does get you far but like it gives you very generic stuff So building attribution models that connects it serves as a proxy between raw data and the agent extracts a lot better information out of it What model are you using i'm using Gemini Very cool
I had a feeling you were using Gemini for some reason You know it's just I had a feeling because I'm using I'm I'm using uh Chrome Dev Tool source code So I' I've extracted um parts of the of the trace engine internals from ChromeDev tools in order to and generate the standard standard libraries or JavaScript libraries out of it Um and that's kind of what it powers um the
main intelligence of it all Um so in order so I felt like you know I'm building a lot of stuff also based on how Google Chrome is building AI So because I'm extracting a lot of stuff from straight from Google Chrome source Um so I felt like might as well just use Gemini as on top of it Makes sense Yeah
I mean obviously you have the you have the long context windows as well which is probably helpful if you're sending you know depending on the types of data you're sending into the context Uh how are you yeah how are you weaving in between workflows and agents that that's something that we constantly get asked You know is this an agent is this a
workflow is it an agent that calls a workflow is it a workflow that generate calls calls back to the agent so I'm just curious can you give us the high level of like maybe one interaction like how how it works so people as they're kind of architecting they can think through okay that makes sense Yes So as
I mentioned briefly I'm kind of modeling this um to express the overarchitecture very similar to how um mixture of experts um the model architecture looks like So it it kind of becomes uh like there is an initial stage within it which is um as just a small assistant that will try to become like it behaves like the router within the mixture of
experts and that will help me uh bring the right heristics in place to trigger workflows or agents based on that Um and then of course I have different uh agents that serves as what I what uh what I can you know create experts based on right So when you think about the expert within the the mixture of experts
so different agents will serve as experts and then the expert tasks to execute becomes workflows that can also trigger different experts So if I'm trying to find um a very specific information about you know networks So I have also like I didn't get to show but like I I also have reports for LCP which is all about networks uh uh uh entries
and you know for that I have a specific you know routine to to extract information out of a workflow within uh vital analysis with from the trace there is a specific um also a system that is ran within that workflow That's awesome Yeah we're like uh sorry one second We are trying to build this into like an abstraction which we had started called agent network which is purely calling
other agents in this uh you have like a routing agent and all the other agents as tool calls but there are there's some pitfalls in just doing that blindly right so there's like should be some structure in between like maybe like you know the whole routing to handoff is like such a deterministic thing but the steps themselves like who knows what's going to happen in there and then like how do you know the task is actually done right so you have like
mini little like fact check assistant or solution complete type of assistance that you'll need Yeah And especially you need to run like complex workflows that are essentially tool calls and stuff I love how you like kind of like all these processes are happening I like how you weaved it all together into the UI so it makes sense Um that's dope Yeah I mean
the the generity generative UI is kind of where I'm leaning on Um because it starts like since there is so much power baked in behind the curtain I felt like I could enable the overall interface to be as simple as possible and then utilize leaning on generative UI to to just generate bits of information and UI as required you know and it becomes less intrusive because when you are trying to
analyze a trace within dev tools if you're an expert that's fine but like when you're not that's a lot of noise and a lot of friction and you just don't know what you're looking at and what you're searching for And that's kind of what I wanted to get on to the smallest possible subset of UI Awesome work man And thank you for coming on the stream That was amazing Yeah My pleasure For those of you you
know that want to agent.perflab.io Go ahead and uh check that out And Shane and I are not judges so we're not biased by anything Yeah We don't get we don't get to judge Yeah And but if I were to judge I wouldn't say anything right now Yeah Yeah I mean yeah it's very very strong contender Uh which is is great to uh great to share and again
thank you for having me Yeah Yeah Yeah Appreciate you coming on and we are looking forward to uh seeing what more you get done this week and also looking forward to seeing if you uh make the podium at the awards ceremony on Friday But yeah it was great chatting and yeah just looking forward to seeing seeing how it all comes together Yeah happy to
be here Yeah take care All right take care Thank you All right that was pretty sick So what what are you thinking chat all 94 of you Yeah you what do you think of that uh we have another guest and this one is going to be a little bit different We're going to actually spend a little time kind of going back to the
basics and starting to just think through like how are we how can we build a master agent and so I'm excited for this one too because this is going to be I think really helpful for people who've been trying to figure out how to get started in this AI world right in this world of building and deploying and productionizing AI agents And so with that
hey what's happening hey guys how's it going it's it's going that's great Yeah I guess first question Can you tell a little bit just about yourself and what has kind of interested you in Ma and what we're going to try to do today so I guess that's three questions in one Not to put you on the spot Sure Let me know
if I miss anything So my name's Huie I've been a webdev for over 20 years now Um I moved out here to California But um what I'm interested in using Maestra for is over the last few years I've been working as a sales compensation um in that field which is really a lot about you know taking in information from people and
then building out some sort of structure so that you can go and calculate and make it be flexible and adjusted for when business needs change So one of my um I I I started bu I was using this tool and then I started building some extensions on top of it and then now I'm like you know this really could just be
an agent that you ask it you know it asks you questions you give it answers it asks more clarifying questions and you can get to probably 80% of a working tool right um I love the simplicity of of Mashra I'm trying to but I need a little bit of help because like you it's uh I think for a web dev you know there's a lot of different moving pieces right in in an agent and um so that's
kind of like why why I was uh joining you guys today so that maybe we can go through some of that There was a third question I have missed I think you got it I I was more uh yeah your background what you you know why why we want to build something and then I guess maybe we can talk a little bit I guess Abby you have any
questions before we just actually jump in and start building something together No let's do it Okay Yeah That's what we like to do around here for for everyone here You know we got 100 people watching Thanks for tuning in live We just had a really cool demo uh from the hackathon Someone that's building for the master hackathon Make sure to go to
master.build if you are interested in joining the hackathon It is not too late Yeah So please go to master.build join us keep start building come to our discord and we can build something cool But Huie I know you had a couple of ideas for what you might be interested in in doing We have probably 40 minutes or so to try to get try to do
some damage Uh what kind of damage can we do okay How about we put it to a vote and see what the audience thinks Yeah Okay So this is uh Yeah Putting the audience on the spot I like it So audience interaction for the hundred of you watching across you know whether it's YouTube LinkedIn X wherever you are just post a comment What are what are
our options what are we choosing from all right So option one would be we we do a basic startup setup with with MRA and then we you guys help me figure out where what prompts I need to work on um what the tool calls I think I got a little bit there so that we can walk through that and you can tell me where
uh I'm on track or I'm off base Option two would be we can we can like I haven't done this yet but I keep thinking that Masha might be something that we could embed into a Chrome extension and something that um could be the basis for you know a lot of other tools that we can create So that one is going to be a sort of like nothing there
We'll have to build from scratch and and talk about it But do the audience have any any preferences all right So here's our options Let's we can do a basic MRA setup Option one drop in the chat if you want to see us just spend some time going through a simple master agent working with some tools But isn't it more to Huey's business case
though it's not just a basic setup right aren't we going to do something yeah there be more than a basic setup Yeah Yeah I So how do we do what sell option one Huey we we're going to give the chat a little time Sell sell guys can think about it and I'll give you some background maybe on option one Um so
sales compensation is something that every single business probably does and as companies get larger they're going to they're going to use some sort of system right to help them calculate their commissions That's that's you can you can use Excel you can use Google Sheets you know whatever you can use access databases So this particular field has
gone through you know there's been a lot of vendors software that have tried to make this um make a platform for it right however the challenge with this is that every industry is different and even if you create a tool for something if you're not an expert in that tool it's going to it's going to be hard for
you to use it right so you always have to find somebody that who's an expert or train them and that's what the difficulty is and uh with with AI nowadays and with MRAA and if you not necessaril but with AI like you should be able to create a more interactive right more um there we go sales tool um so like the idea is that this tool will
be an agent that we would host on the cloud master cloud and you would go sign in ask it question tell tell it about your commission plan It will extract that information out for you It will create a basic um you know Q&A sort of like thing that you can say hey do this for me right potentially you can also end up doing a lot of workflows and
saying like hey I have this person these are the things that I go through to calculate their commission payout Um like there's some deterministic stuff and there's some like agent LL LLM stuff that we could that we could be helpful So we got a couple couple votes but we're going to have to I think we just
get to make the call So you know do the basic setup first We can do the Chrome extension later That's one option Or E Eag Eigor says uh just go right to two Okay Well maybe we can keep the first part short and then we just say like here's give me some of the pointers that you guys I Yeah I think we we should
start with let's start with the basics because you you haven't you've spent a little time with MRA right but I would would say you you'd probably agree you're not an expert and so maybe that's for the audience who's looking and considering building Why don't we just start with the basics and then if we
have time we'll go from there or if we don't get to it maybe that's a that's a a future live stream Let's build a Chrome extension So I think we we have options There's a lot to discover in just this beginning phase of like Yeah Like to even we can prototype this very quickly though 100% Yeah Show my screen
Yeah Do you want Yeah You want to drive we'll uh we'll watch it And now we're we're about we're ready to vibe So let's uh let's play some vibes and share your screen and definitely bump up the clicks on that one Yeah Yeah You're gonna have to take it up a few clicks Uh so for those of you just joining us you joined late Uh we had we talked about the Monster Hackathon talked about
the Monster release we had a special guest come on and share what they're building in the hackathon And now Hueie is here He is going to be kind of walking through building his first agent with MRAA or at least starting from kind of the basics and saying how do we give a agent some sales tools That's his
background He he wants to learn how to how to build an AI agent that can do uh automate some of these sales tasks Yeah perfect We're going to help him out and you know feel free to drop messages in the chat and let's build Yeah So what do we have what we have so far right now is basically the the masher create and then um I've added this tools section here for myself to
call and then that's pretty much it Starting pretty bare bones here Let's take a look at the agent and look at like the wisdom prompt or the instructions All right So there's a system prompt here I'm given a very simple one Um your helpful sales commission agent that helps analysts with tasks Primary function is to
understand the user's request and provide the appropriate response When responding keep responses concise Use the get employees tool get opportunity tool and get plan tool to fetch employee opportunity and plan details Cool Okay And like have you run this agent yet yeah So I've I've got the get employee tool set up which um here is what that looks
like So we start with this I'm importing my for my API key and then the tool definition here we're passing in like an employee ID name and email Um and the output schema actually I think is incorrect currently But all we're going to do here is make a API call to the backend for the tool that I use Sweet Can you can you explain
what captivateiq.com is yeah Cute for people that are not familiar for people that are not familiar they're actually which is actually so I think a lot of people if you're not in the industry you will not be familiar with the tool um but they're also actually another I'm pretty sure they're a YC uh company as well from 20 end of 2017 beginning of 2018
and they're a no code solution to doing this um sales compensation right and it gives you the ability to import data from different data sources Gives you a chance to make transformations on um spreadsheets So they're similar to Captivate like they're sim similar to like Google Sheets You've got you can define your uh transformations and joins
It's kind of more like a database almost in that sense But um at the ultimate end of it it you take data in go through a bunch of logic and you get some output for how much people are being paid Cool So you got the get employee working and did we get the server running so we could ask the agent to fetch some employee details yes So let me share this Are we in a sandbox or something or
is it okay to like yeah Yeah You're not going to leak any you're not going to leak uh your your favorite employees compensation or something right i will not So yeah this is my sandbox where I can do my development work in and we don't have to worry about it So this is um this is running with the agents I can
go to the cap agent here Yeah I will see Yeah Can we maybe do a quick zoom it's a little bit at least on my go Absolutely That's a little bit better Yeah Is there a way to get rid of this uh stuff on the right no you can like scroll it a little bit maybe Or otherwise we don't have that Here we go Oh you can only go bigger Make it bigger not smaller Uh you know we we will uh we'll take some notes
That's a good note Oh there That one works There we go That'll help That helps a bit Yeah Um so I have a sample user Can you tell me a bit about Char Charles or maybe it's Charlie Kim and so this is an API tool call right and it's getting it's getting the information there It's got hey I got the phone name I got the email their particular role so this information is
actually coming from the response and I haven't given it any like formatting it information right yeah you're just returning the full data and that's that cool yeah so this here is there a way to share a second screen plus screen share no okay I'll have to go back to the other screen I think Yeah I don't Yeah
unfortunately I'm not sure you can share two different screens at the same time Yeah it's okay We'll figure it out We're you know we're we're all learning here Yeah So this response I'm just returning directly It's actually a um it's formatted a little bit differently It does not look like this output schema
Yeah So smart enough to to format it still for the response because that output schema is more for you as a developer Okay Yeah that's good to know Uh because AI doesn't really give a I mean it does It cares more about the input schema but it cannot control what you return Yeah Yeah You you basically have to it's like a contract you have to satisfy right it's like is kind of the
goal of it is like you you should try to satisfy that contract and then the AI can then take that return data and do things with it I'm curious in this particular case I this is fetching employee details right it's asking for this information how would I modify this so that I don't need to pass in like any of these informations these all these are all marked optional right now
do you need to like how do you how would you fetch it if it didn't pass it in then so if I don't pass in anything it should give me back a list of all the employees right and my pageant for sure Would that be this tool or should we make a list employees tool let's do that Just going to make a copy of this
one See cuz what we could do right so let's say let's let's work backwards So let's say we have a list employees tool We can see like hey can you check if Charlie Kim is in my uh list and then pull up his record for me like casual like that You know what I mean and that would be safe Yeah And it it it should be able to
weave the two together right so calls the list then says yes Calls the employee Yeah That's actually one of the use cases I was thinking about because you could say "Give me information about Charlie." Or "Hey what was Charlie's last payout?" Yeah But you may have two or more people that are called Charlie So it could respond with this list first
and see Oh that's a good that's a good point Let's do something about it after you get this tool call written up Yeah I think you got to work on your instructions too Yeah Okay So I think that is that is it I'm going to actually now try to say hey oh you know what actually not yet So we created a new tool here for
the list but we haven't imported this list back into the agent at all Right So exactly Yeah It's like you've done you've done this before You you you you're you're familiar You're get you're getting familiar Running it to it Okay here we go There it is Get employee list tool And then because I have not exported it from the thing
here Yeah you can tab tab to victory Tab to victory dude All tab to victory That's what that's what we do around here Uh so one one thing that would be Yeah Once you pass it in to your agent one thing that would be kind of interesting is I guess here's my question you know for you How do you test this what's your method for testing
so I know what my method is but I'm just want to know it's nice to hear from new users like how do you how do you go about testing that tool i would I think my current test game is go to the agent and chat Yes Okay So like I know Abby you're a big like just test kind of guy but the playground makes it kind of nice so you don't have to even do that anymore So could we go to the playground
and just like run test this tool in isolation and then we'll we'll test if the agent actually calls it Yeah I like to divide and conquer right start with just making sure the the tool is giving the right information and then we'll we'll test the agent So if you actually go I suppose if you refresh this page get employee list is in the tools on the
right you can click on the bottom right or you can go to tools Yeah either way So list tool Yeah So we have we do have to pass in the input which what was the structure of that it's actually just an empty empty um nothing I didn't have any any input So let let's go back to your uh go back let's go back to the code and just look at the input schema Make sure that did
we pass was it just completely empty or did we pass an empty object just to make sure I think it was completely empty So get employees list Oh I've got an error here Does this expect anything can we scroll down the object i guess Yeah Yeah I mean if you remove input schema what happens and then I don't know what's your get
employee list Yeah it doesn't expect that anything now My tools get employ So hold on a second Tools get employees list tool Okay I can submit now So let me share that So essentially if I had something there it's expecting some sort of data and then now it's Yeah sure If you had a input schema let's say you asked for a name you wanted to like a search string or
something it would give you the field that you could then test That way you're kind of you're kind of the the AI agent in this case testing it right and you know maybe we uh broke something Did we break something dude we might have a UI issue here Maybe Yeah This is why we do a lot This is why we do you know we do things live around So do this Hueie to to get around this So if you go back to your code just put
like Okay so that actually worked here It said get Charlie and it gave me Charlie Yeah If I just give it a blank it's actually giving me a list of 31 test employees that are in here Oh I see So it's already doing both It's already doing both because it's if you don't give it any any data there Um works Do we need both tools i would have both tools and I would make that get
tools thing required for those like parameters But I guess what I guess what you're saying is is there an employee ID API or is it always fetching a list and then you know filtering it yeah I think there is an employee ID API which then I would separate it for sure Yeah Yeah You you almost want like a lookup or a search Yeah Yeah And ideally that that search c can you pass in filters
into that search So you know that's almost like a like a s employee search tool We could you could pass in some kind of name or string or whatever and then from there if it found the if it because ideally you would want to like get the whole list without all the data if that's possible and maybe the API sometimes we're at the mercy of what the API provides Yeah So if the API just provides the list of all the objects
well then maybe it's just one tool call You just let them get everything But obviously then you have to think about like pageionating the API requests or the response and all that Yeah that's could get a So this is what the API looks like Let me share that real quick And this I may need to zoom in a little bit
Oh nice There's some filters Sweet Yeah So you have a list users create user get user update of delete and then for the list you can I think all of these are optional They're query parameters Um you can do offsets you can order if you needed to Then for the get user you will need to have the the user the employee ID or
the user ID and that's a required field Does Captivate have an MCP server i don't think so Um no no problem So we're essentially going to be creating one like to get all these tools together Yeah Yeah That's basically what we're what we're doing Yeah Honestly is this an you know and this probably exists like there there's I know there are people working on basically open open
API specs to MCP servers or open API specs to basically like tool calls There's obviously like SDKs you know for a lot of these APIs as well that take open API specs and give you uh you know JavaScript TypeScript SDK for it as well So there are there are some tools we could pull in here But it's also it's kind of nice sometimes just yeah this is
a good learning because if you were to so for example if you were to take the open API spec and then translate it into tools or MCP like like that would work probably but maybe not all parameters are make sense for the LLM Um some are like human parameters you know Yeah um depending on the API but kind of like if you were to do this migration path of like bringing your API into this LLM
world you're kind of doing what we're doing which is taking each endpoint and seeing like okay what does the tool version of this look like what are the parameters okay I need to encode those as my input parameters and then you can actually you know have the LLM actually access it properly right so I think what we can let's keep going with our stuff because what we really need to do after this is to like take
our API docs and make all the tools right and then test the tools make sure they all give data then we give the agent the tools and then now you have all the APIs that you could call and then you're kind of doing a lot better Let's just do something in here And and for those of you that just joined us or that have joined us in the last you know last few minutes we are
building out an example uh kind of like a sales tool agent with MRA So Hue's come on to basically learn Maestra with us and try to build an agent So we are kind of partway through that where we have an agent that has access to some tools using uh Captivate IQ's API and now we're trying to add some more tools to this agent and test them and see what kind of yeah what kind of uh interesting
things we can get this agent to do Let me try something different and just share my entire screen on the my secondary screen so I don't have to keep toggling back and forth on this stuff Yeah Um see if I move this over here and then I move this over here Okay So let me And we still only see Yeah if you maybe reshare screen over there Okay So now if I go to this we're
good We're in All right Um we've got the list here If we go back to this we should be able to reload and check the list tools Dummy doesn't do anything Ah okay It's working So we don't Yeah Input It's uh it's not The UI is a little broken but okay Um and we gave this to our agent already We did Cool Let's go uh ask it to list some employees real quick
Um in the agents view in this No yeah if you actually go to the agent Yeah let's just see See that okay it's picking the right tool Calling it right tool All right Treat list includes details scenario Would you let me specific they'll be more specific Maybe just say give me all the first names or something if we have this is gonna be interesting what
happens here So I'm I'm interested to know if it go if how it works This is basically we're like zero shopping it Oh there we go We have all the first names of the different people in here That's it That's interesting So it didn't call the tool again right if you look does he do you have memory in but but if you look it it appears that memor is not added based on the message at the bottom of the screen Right agent
will not remember that That's why I was saying this is going to be interesting That's true So you know that's you know interesting How how do you know if it called it or not well it should tell you Well I guess you can go to traces Let's see Maybe you don't have storage turned on potentially Maybe Let's talk about
Let's Let's do that Let's turn that on so that we can know Yeah how it's uh what and are you using I guess another question are you using a recent version I'm assuming of master right like the last but probably not so maybe we should do an update update should we update master quick and then that might fix some I don't know how old it looks a little old I don't know if
it's a little old could be just a couple weeks but we we move fast around here so I don't know all right how what would I run here let's go to your package JSON and see uh modules you have Nice And I also see you have a package lock and this is actually this came up in office hours earlier You have a
package lock and a PMPM lock So are you are you wanting to use PMPM or npm i don't have a preference Use MPM Use npm I was going to say use PMP Oh use whatever you want actually But I would just get rid of one of them So we just got it And that way boom You know we we might need to rerun like PNPM install but we'll want to do some
updates as well Okay So here do I just go into terminal and just do an update on this i would do PNPMi and then you know all the Monstra packages So you do at Mostra core and then do at boot at latest at the end Yeah that that way you're getting the making sure you're getting the newest version You basically want to do that for all you want all your packages to be Yeah So you see you went from 08
0.8.2 but you do want to do it for all your MRA packages So I would just do it to for atmoscmemory and then just MRA And that way you know they're all using the same version essentially the same from the same release just in case there were some like dependencies Do I also just do at Maestra no just MRA No just MRA by itself
Okay got it And let's There we go Himu from the chat Yo what's up thanks for tuning in watching us build uh MRA sales tool agents Let's see what breaks Nothing broke dude That's dope In memory deprecation warning Nice That's good too Uh well it's not good but it's good that it it showed up Uh we are changing We have a big breaking not breaking change It is a breaking change but May 20th
we're kind of changing some internals So we gave people a deprecation warning so you know when that happens Um but people will still be surprised So yeah Well we are we are announcing it here Please up please upgrade if you haven't upgraded in the last month Please check your you know the the CLI the terminal for deprecation notices
And we got Biniac He's signing out Good night dude Yeah See you dude Thanks for joining Okay so you see we got a little improved UI That's how we know it's uh it's fresh Get the fresh UI here I can see what it's called and everything Okay And the trace is here as well All right Okay Let's fetch list We can fetch the list
We can get the employee ID But now we got to be like Charlie Kim Actually can we ask if Charlie Kim or works at the company real quick just to see okay Well that's good Hey ask if Shane Thomas works there because it should be no Okay Not that I'm aware of Yeah Hell yeah Maybe no Because once you add those filters right to the list view the
list query that you have you can it'll be like Shane at MRA is at this thing It'll be no right and then you can do like a filtered list query Yes If you match the API So that's dope Okay So now let's figure out what Charlie Kim's up to because that fool needs some money right Ultimately ultimately sales people like to get paid Yeah They they love getting paid Okay If you move then
okay so maybe we need a separate tool that says how much does this person is this person getting paid so we look at the list of APIs that are available to us we already have that on get employee or is that a looks like payouts payouts looks like a separate API endpoint okay okay so but if we get the employee information I imagine we get the ID from there we can look up that you know that
person's payouts that's yeah so yeah the the agent will like look up Charlie and then it'll ask for the payouts once we have the payouts to this may be where we need to start actually talking about some workflows because the APIs as provided by the company does not have hey for this employee give me their payouts right you can see here this payout is giving us a list of payout
dates payout summaries uh commissions plans per groups and all this other other information if we needed to get that information we would have to make a few calls And then in order to construct like another call to go and fetch the actual payout So this is I'm getting excited just talking about it Let's So this this is where you can like actually for those of
you just tuning in this is a really interesting dilemma right you're trying to do do something that the API doesn't allow you to do Couple ways that I could I could see that if I were building this I would I could approach it First you just give the agent all the tools and you tell it how to look up that information That's risky You might get
the right answer some of the time Maybe it doesn't always give the right answer Mainly because you probably gave it a whole bunch of other tools And so now you're saying if you need this information do these three steps Piece the information together where if you know it's always you're basically just wiring up specific APIs That's where yeah you could just wire up a simple
workflow that says look up payout for employee and then it runs a couple API calls and just returns the final you're basically kind of like building a a flow for the agent to a workflow for the agent to just call So Hugh Hugh if I'm understanding this correctly like we're going to ask the agent like "Hey I need the payouts for Charlie." But what it
has to do it has to like kick off like five API calls to assemble the results that will then make the call to then get Charlie's payout So essentially what we want the agent to do is like pay out call the payout workflow and at the end of it is Charlie's payout that I'll get back Yes Okay let's build that Um that
sounds like a pretty sick Let's build example and we can we can test out the handing off workflows to agents as well Yeah So so we have about 10 minutes and so we got do the first step Yeah So let's get this work we I think we can build this simple workflow get a part of the workflow working Okay So go to
workflows index and I would just delete all this because this is like some weather stuff that we bootstrap like literally kill all of it All right Yeah Yeah We'll start start fresh Also we'll use new work plus so you can like uh get rid of everything in this honestly in this let's import it's a import brack you know like object import new workflow
and it's capital N and then it's from MRA core slashworkflows V-NEX which on and V-NEX has a capital N I believe Yeah great And so oh sorry We're going to uh import the function called create workflow It's sorry instead of new workflow That was my bad It's called create workflow It makes me feel better that you make that this isn't all from memory Obby You actually made a mistake because I'm like
how are how the hell do you remember this like I need I need the docs pulled up so I I know how to like actually walk you through this And then you need a second function called create step that is uh you can just do comma on line two Dope And then let's create our workflow We can name it like const or
whatever you want to name that thing Dope Um I think it takes an ID instead of a name Is it just a string for the ID Yeah And then I believe description is cool Uh what is it and it needs an input schema See what is it complaining about input schema Just like tools have an input schema workflows have an input schema You'll need to Where would that go
just here Yeah Yeah Yeah There you go Input schema you get Zod in Zod involved And so yeah it should just be Yeah Z.Object And then I guess we only need what got an extra special guest here Yeah So I mean I guess we would want anything that we would potentially be searching right anything that Oh this is a cat today It wouldn't be It wouldn't
be a MRA live stream without a a pet or an animal right well yeah Yesterday was wards goats and horses Today we got cats All right chat That's that's you know if you if you want to jump on a live stream and uh build something and also you got to bring an animal That's you know you gota you gota show us how you built it or show your screen and show an animal
That's what parameter we need for this workflow Just employee ID employee Yeah we're going to need employee ID Make it required dude Save that Cool Oh you can just draw I think by default it's required Yeah if you just Okay Um we also need like a payout date Okay And then uh would I need to have a plan no
because it can try to determine what which plan it is That should be enough information Let's just say that's what it is Now we need an output schema What does the workflow return at the end payout ID We don't need to pay out IDs So let's do Okay maybe this one is just not optional This for the output Yeah I don't know how well it does with
that I guess be fine Yeah deter if it's deterministic because we're just calling APIs I don't know Maybe it maybe be optional Could be fine Cool To uh pay out currency Okay let's ditch those steps on line like all those steps on line 17 like we don't need that Yeah Cool So now you have like the top of the workflow Let's create the first step So what would be the first step of this
process so we would need to grab a list of the commission plans and then figure out oh actually we need to figure out um let's do this figure out where which plan the employee is in Figure out um the IDs for those plans period groups Yep Get the commission rate Oh look at that It's filling everything out for me Tab tab Damn AI is tight
All right let's Okay let's do that So let's do the first step and what I like to do So let's do like cons you know whatever we want to name it like find plan or get employee plan That sounds pretty good Okay And all that sounds pretty good I was going to do I clicked I clicked instead of tapped Oh it was there Tab for victory Okay
cool That looks good and then execute We'll have context there so don't listen to it But also let's just keep this as it is We'll keep the mock data so we can get the plumbing in together On the next line you're going to do whatever you named your workflow I forget what it was called Payouts workflow Yep Yeah Let's like
start writing payouts workflow dot then uh then And then at the end of this you're going to do do commit which is like saying that this is the workflow and then that is it complaining about the step here the property it's the output So you know like the workflow we we specified that the output schema has to have like all those fields above If you scroll up we said that it has to have payout
date payout ID payout currency right in a workflow the last step is the results So right now our last step doesn't have that So for the sake of Yeah we could just do we could like mock out all this It got the output scheme Okay good It's starting to learn it Learn you Sky is alive Okay So let's see now What is it complaining
about input schema is incompatible What was the input schema to employee plan okay Do we also need the the input is missing the period group ID I believe Yes Uh get employee plan output Okay So the workflow is like the entry right and then the first step is like the input has to be to match right that has to go into the input here Employee ID there's no payout date So this input this needs to have payout
date here Yes Hey look at that Yay Okay so now we got this you know workflow Let's export it at the top Like export the pay payouts workflow const at the top I think where we wrote it Um we can just do it on line five Sick Let's go to our agent now and let's type workflows in our cap agent Yeah right under tools
Come on Okay Come on Tab We got We're trying to tab to victory here Sometimes you just got to write stuff It's annoying That's how spoiled we are now Yeah Yeah What you remember when like remember when you guys were using like Sublime and back in the day and there was no tab anything you just Yeah I will still like I will still sometimes just open things up in in Vim for quick edits and then I'm like what am I doing
i still use Vim Yeah I mean it's I enjoy it but it's nostalgia What's the complaining about uh can you do like one of those like restart the TS server type deals yeah I mean it's like command shift P Maybe command shift P is on like mod Yeah command shift P and then restart You just got it restart Yeah there it is And
we'll see if like usually whenever I install a bunch of modules I always lose my TS server Yeah you basically got to restart It looks like it uh we can get rid of that MCP stuff for now because we're not using it And I Yeah And I think it again we've changed the changed it slightly since when you originally started this but it looks like
it was kind of working I didn't see there All right But then we we uh we should get rid of those other agents we're not using to clean up the workspace a little bit If you scroll up like this MCP personal assistant thing this is a real project now We don't need the weather agent anymore We we've graduated beyond we graduated we'll bring back later too
Yeah Our our agent is doing sales now Yeah Sales commission at least Uh it's helping with sales commissions Okay So this is the grand finale of what we're about to do Also I think you have the tools to make this thing dope too But um Okay What we need to do is we need to ask the agent to look up Charlie Kim or
like I want to ask the agent does Charlie Kim exist if he does exist then give me his uh details and give me his payouts right so we'll see how it goes This will not work because we don't have enough But I'm going to be passing out the the fake data Yep he exists Great Here's his information New is inactive in the system Hey we didn't tell it anything about this inactive thing
Okay All right I would have to give this information Do I just give it as some sample data yeah Well yeah because it's all fake right now So say Yeah is bar and is Well I think was was it group ID is there a thing yeah Is I don't think it's going to call it properly but that's fine Oh didn't really qualify Also do we I don't Does the workflow not
show up under tools in the if can you uh refresh yeah let's refresh the page once just to see You scroll down on the right maybe And if we go Yeah if we go to workflows that your workflow shows up right no we didn't add it Uh we didn't do that We added it to the agent but not to the master Not to the master thing That's okay That shouldn't matter That shouldn't matter If you go back
uh do we have any errors in our server is that why or I mean yeah we did do some updates So I wonder like we can get rid of those other agents and because any of those other agents that we got rid of we can probably just get rid of Yeah we got to clean clean up the index file Missing export Yeah Yeah for for those of you that just joined we're about to wrap up here but Hiwee has joined Abby and I to build a I
guess a sales commission agent or sales uh compensation agent So we've been working on that We're almost getting to the aha moment It's not done of course There's way more to do but we're getting close All right Oh all right Some warnings Yep There it is Okay we should call it through our agent though Yeah Yeah Let's see if we can go back to the agent And
on the right you scroll down on the right column thing There's our work right Let's just do a a brute force It's like hey call payments payouts workflow Workflow I guess I don't know Whatever we named it Yeah Let's just see if it'll call it and plug up date Yeah Okay It's giving us the right information here Pretty sick Pretty sick
Okay So it's Oh employee ID received a string Oh because we gave it like a date It's It's using this and it's not formatting converting it to date I think you have to coersse it in zod or we just say string or what is I don't well we're faking things now so it doesn't really matter but if we go to our um workflow and wherever we did the
date thing I think we could do like a dot cose yeah it' probably be the initial up yeah in that in that step is it before the we would need it in the workflow input schema right yeah but also I think it's like let me look up how zod works Coerc that might be Yeah I mean it's a function What's it doing does not exist on I think it's do
Z.co date or something maybe I don't know actually Let me double check that It's balancing What What are the odds it works first try zero never does All right let's try it then You want to make a bet i'm feeling I'm feeling good about this one I do feel good about this one All right now take How hard would it be for us to add like automatic history so we're testing this So easy Let's go back
But let's do that Let's go back to the code We'll add some memory Oh Um okay Let's do that the app agent Nope that's not it You have memory already at the top there I did have memory here I would Yeah you can keep all this Uh I don't know I would instead of like just comment out all the parameters and we probably don't want to like introduce
all this randomness right now Yeah I would just just do like you can just do like an empty new memory right And that'll give you the the kind of sensible defaults We can of course do more but it's good to start with the basics and then Yeah So you do memory colon new memory empty like that Yeah Just do new memory and then we can Yeah And then just nothing Yeah Just
like an empty object All right Here we go It's being too smart What's the issue here memory is not mash memory New memory Do I have am I importing memory from master memory yes that's right Um because we need what lib SQL now Oh we need we need storage on our MRA class huh technically Technically you shouldn't
actually Yeah Um if you omit those brackets in there like you just do naked like that Does anything different happen no H what did we screw up resolution node What the heck is that it's the storage that's going on in there Okay let's we'll fix this Can you um go to your terminal and install um mpmi yeah pmppm Sorry MVMI at
mastrabsql And then here I'll give I'm going to paste this in our I'll place this in our private chat You can use this as your memory Uh yeah Yeah we don't that Yeah So if you grab that let's just use that I think I ran into this actually but felt like I found a way around it There we go We're still having this issue Oh wait Where's new memory needs
to be there still Oh is it just storage oh no No Should be memory and then you just need new memory and then wrap that wrap that in an object I think Himanu could be correct because we were coming from MPM and PMP So let's try his suggestion and let's delete the node modules folder because we just up should
for your information we just upgraded everything before we did all this So remove the node modules folder Yeah And I got to sign off here in like three minutes So I might have to dip And Obby you can wrap this thing up I also have to dip So yeah we we three minutes to succeed We have we have three minutes to
figure this thing out And if we don't uh we will uh have to revisit For those of you that just joined us we are building a sales compensation agent with MRA right now and running into you know some familiar or maybe not familiar type errors Some typical TypeScript Look at that Hey but we also No now there's more No Yeah it's just a symptom
of a disease Yeah it fixed one thing Doug You know maybe we do have an issue that we'll take a look at but let's see if the server starts at all Well it's just a TypeScript freaking error That's great You have chat history now If you say hello it'll like start a chat As you can see got a new thread on the the left
there All right And when after we run this and it works because it's going to I have faith Payouts workflow All right That that was the mic drop moment We obviously have some TypeScript issues we got to work out Uh for those of you that just that have joined thanks for watching We hopefully you learned something you fixed some errors
alongside of us uh and we appreciate you uh checking out the live stream Make sure to go to master.build if you want to hack alongside of us this week We have a hackathon going on all week long so it's not too late to sign up and get into the Discord Huey thanks for jumping on and being brave and just sharing your screen and building So I know that's sometimes challenging but it it was a
lot of fun It was a lot of fun Thank you guys for having me Yeah Thanks for being here All right dude Let's wrap this thing up Thanks for everyone We're the ad we are all the admirals of AI Thanks for joining Um we will see you soon I head to Japan tomorrow I will probably have a live stream with Coney in Japan Yeah the live stream schedule's going to be a little weird the next uh month probably
Yeah just because we will uh we will uh probably be doing some more separate live streams So you'll get to see you either Obby with with maybe Tony on our team or me with some special guests We have some really cool special guests coming on throughout the week more hackathon participants We have you know we're going to be talking about some AI
security be talking about another hackathon that we're not doing but someone else is hopefully joining and talking about more hackathons that you can participate in But we will see you all next time
