New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Messaging Mini apps - Bot, Agents & Frames - ETHGlobal San Francisco 2024

ETHGlobalThu, Oct 9, 2025, 12:00 AM

Join us for a workshop with Fabri Guespe from XMTP titled, "Messaging Mini apps - Bot, Agents & Frames." MessageKit https://messagekit.ephemerahq.com/ An open SDK for building messaging mini-apps that run in apps built with XMTP. Simplifies the process of building messaging bots on XMTP. With its robust set of tools and integrations, you can quickly create bots that can handle integrate web3 primitives like on chain transactions, mints, games, groups and smart wallets. This workshop took place at ETHGlobal San Francisco, a 3-day hackathon held from October 18 to 20, 2024, which brought together web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com

Transcript

[Music] hey hi everyone I am fabri from the company epimera epimera is known as the parent company now of XMP but not only x&p we also have the app it's called Converse which was uh released very recently we acquir converse like in March and we made it open source so now it's we are building like the whole mess messaging stack uh in the open soon to be decentralized so we started with the protocol now we are moving into the app just to a wait for users to interface with a protocol and for yeah for context x&p is an encrypted into a messaging protocol between what addresses this address is being ebm for now everything is of chain so uh messages are stor of chain and we are running five nodes right now and eventually the nodes are going to be decentralized and run by Community node operator but today we are going to be talking about message kit message kit is um the first piece of the puzzle of the messaging open platform so message kit is meant to write the way of AI agents Bots automating accounts so is you can think of message as a small SDK for building apps that you can uh these apps could be Bots or agents that can be um used through messaging apps that work with xtp like coinbase wallet or Co Commerce so um we are we as x&p protocol we already have 2 million activated identities uh on the evm network so it's probable that you have if you have a friend that have a ens domain uh you it's probably that you can send a message to him and he's going to receive it even in Commerce or coin wallet now hey now talking about comerce um as a sell it's on the App Store it's was released recently if you want to download it now from the App Store this is a QR code this is going to allow not only to chat between users but it's um also available for creating group chats and messaging Bots and agents that like we are going to test right now okay let's go into one of the demos of message kit if you go to the to the message kit docs you will find a very simple CLI command so if I if I run this command is going to prompt me fre examples these fre examples are documented here as well we have one that is a GM bot it's going to only reply GM then there is a one to one that uh shows me options and the user has to select those oams and then there's a group chat bot that you can tag inside the group chat and can perform actions with the context of having more users interacting inside the conversation so in this in this case let's say I want to create a GM bot uh GM test and that's it I have already one created with my my private key so I'm going to open it now and this is the structure of a simple bot again this bot is going to use one identity which is a EVN address so I'm I'm sending the private key as a parameter and that's the only thing that this B needs once you um install the packages and run the bot in development this is going to start what we call an xntp client this client now has uh the inbox ID which is like the unique identity inside the messaging protocol xtp the account address associated with this identity um each identity could manage multiple addresses and the installation ID because everything is encrypted to end uh messages are only decrypted on device so uh is they are not available U remotely in any way and everything is encrypted end to end so let's say we have this bot now on the on the right I'm handling comers Mac client we have a Mac client too this is also this is also going to work for example with comes wallet or any any inbox that uses xtp in the background so if I want to send an address to this but again this this box will also work for ens domains um this is going to open up a chat and I can say hi and this is a very simple GM example the B is replying this is all the call that you need for creating a a bot on top of the xntp protocol using message kit now let's go into one more uh a little more complex so this is a one-on-one example again the gold is still although it's more complex it's still very simple uh I'm using I use csor for basically building all this stuff so it's very it's very easy it's very easy to create like a conversational Dynamic so let's try this one Bev is also has the same private key from my wallet address so I'm going to keep using this one on the right um hi so this Bard now triggers options and is going to be listening for which option do I select so I want info here's the info and I want to subscribe and I just subscribe and what he doing this B is subscribing me actually to a Rish database this R database was one that I picked but you can think of an example like this for managing subscriptions and then of course once you have the user you can send uh notifications through xntp and they will receive re it in their ens addresses or wallet addresses in com wallet in Commerce um so yeah you can think also XMP for engagement or reaching users for their addresses um okay this is still simple stuff now let's go so here we and this is the crown this is an example cron that will send one message a day for the subscribers and if I want to unsubscribe this is going to remove my address from the database and the red is middleware also very simple everything is documented here in the one to one example uh again the structure of the message kit boards it's an index file which handles all the all the logic and then we will have like different handlers or middleware code also ready to copy paste so now let's get into a group example these all count from the CLI starter so I I'm just using pre-created ones and now we're going to introduce what is called uh commands and through commands we are also going to learn what's intent what's intent at least in the in the context of of message kit so let's trigger this group bot this group bot is going to be um handling different interpretations of what the users are doing so in this case I'm going to create a new group I'm going to send this address to the group sorry new group address add this address in this case I'm just I'm going to add myself this is my my mobile identity um next I can set the name of the group okay we have now created a group this is using MLS for encryption so everything is encrypted into to end one thing that you will encounter today is that if you join a group after it was created you're not going to be able to see messages before you joined uh because there is no message history because everything needs to be encrypted on device uh we are working on that but that's something that you may encounter as you start using in Commerce um okay so if I say hi nothing will happen in this case because if it's a group um you need to prompt the bot explicitly we don't want we don't want Bots to be listening to every message in every group chat so for that you will need to create what we call a the command file so the command file is going to declare explicit commands so in this in this example that is also documented here I have um the like six use cases so how to use an agent that is AI powered how to do tipping um how to trigger a game how to trigger frames that trigger transactions uh doing a split payments and also like managing a loyalty program inside the grip chat so let's see um each command each bot will be declared here each bot has its own commands and these commands also have predefined parameters so the the the message kit is going to be handling the passing of the commands uh so it needs to know if it's a username a string a number and so on so let's start um with simple stuff so if I want to say I'm also going to use bow and Alex these are like test users for the demo they are not in the group but I want to say TP bow 20 so what's happening here now this message goes is logged because tip is in one of the triggers the trigger is explicit it so now the meas is logged and what happened here the logic from tipping I'll see it in one of the handlers so basically here it says if the text starts with tip um do something I'm not transferring real tokens here but this sent me a DM so from a group chat this has sent me a one-on-one message notifying me that I just sent 20 tokens in total or even I can say um tip B and Alex 100 this is going to be 100 each so I send 200 tokens again this is just a an example but showcasing commands and showcasing that the B can also message you uh send you at DM now let's see what else we can do we have one command that is decare as an agent so this will trigger basically shbd now agent tell a joke now the agent is going to be replying to the group why the web fee developer always carry a pencil and a paper because they never wanted to lose their right access so that is supposedly a really funny joke from the demo um so now you can you can start uh to think about infinite use cases right how you put AI inside the group messaging and what other things can happen question or after yeah yeah sure um does it does the AI agent can you give it like context of the entire conversation we are um we are thinking about that so for now we we have what what we call guidelines for building responsible bots so because you may be in a group I may add an agent to the group we may be friends but maybe you don't know even the developer of the bot or uh if the bot is like good quality or has bags or what he's doing with information so we are not encouraging uh the Bots to handle every message in the context uh in the conversation so that's why you need to explicitly tell agents to tell joke if I say tell joke the message is not going to be filtered through through message kit nothing happens um so yeah but if I prompt it explicitly can I give it access to all conversation I had before can I say look at everything we talked about and yeah okay again you could do that at the protocol level um but yeah that's a that's a tricky question thank you I mean you could but we are not encouraging it because it will read messages from all the users right in a one-onone yeah you could just download the whole message history and do whatever you want uh you can that do as well as in a group but yeah personally I've been trying to think about when would you want to use all the messages and I haven't come out with any good ideas I have some good ideas you have good ideas okay let's CH let's TR um okay what else games so if you are familiar with farcaster frames comerse also um is compatible with them and maybe you heard about the game wle so but first let's see I want to trigger the help command because games has um the game command handles a help that is going to suggest me which games can I play so wle and Slot okay I want to play slot okay there it is um yeah just a funny example of playing slots let's see if I'm lucky no okay and then the world of game which I would love to play it but uh it may take us some time um let's try it really quick I always do this two War starters any suggestions in the meantime someone has questions yes yeah cont gas yeah so inside the boot this is node back end these are deployed let's see how they are deployed um this is using R well as you can see I have a couple of BS and let's say so yeah it's just deploying from the GitHub repo what I was trying to say is that from this back end if you have the private keys of a wallet you can do anything that you want right okay that there is no restriction at least from the message kit side as long as you have the wallet and we are soon going to be integrating smart accounts into comerse so then you may be uh it's going to be possible to to perform actions for the user uh but right now you will need to perform actions from a wallet that you have the access or private key yeah you can fetch smart contract info do whatever transfer fans um and then the vot to communicate status or whatever you want okay let's um okay that was um yeah we saw some a couple of examples so let's return to the presentation and do I need to deploy it on Railway or I could deploy it on my own server you can deploy it anywhere yeah yeah I I'm using Railway because it's super fast but yeah and I also can create like a r database very easily uh yeah but any any back end will will work um so by building message kit and building with a ey we are trying to figure out um how we can yeah give structure to all of these how agents are operating now and as maybe you've seen open I the road map to AGI it was first uh conversational Bots second is reasoning and the third one is Agents so this is something that is going to be get more interesting really really soon um so there are three stages of intent the first one is explicit intent so SL commands as we' seen you can declare them the user can use them uh maybe you have background in Discord or telegram I do um I always like to play around with commands and as we' seen you declare the commands very explicitly um and then you can handle so message kit is going to pass the parameters and here you get to amount token from and token to uh ready to use now natural language now let's say we want to swap one UCC to e place now the prompt is not super strict so so this may this make uh this is not like a literal Command right the the AI needs to pass this command so what's happening here um I'm using simple prompts as example the prompts The Prompt is hey if you receive this um string prompt that is requesting a swap you need to parse it as a strict command and this strict command now is um useful for message kit and this is going to be trigger like you know like in a recursive wave so message is going to be triggering the command to itself now let's let's take a look at that this is swap [Music] board okay chat with swap Buton so nothing nothing is going to happen here now if I say swap swap one e to use the pleas and now this is triggering a frame and the frame already knows that is one e one isdc and these are all parameters sent via uh get parameters so the URL you're going to find that these parameters are emed embedded into the URL and the cool thing about this is that so on the left I have the way to parse a command but how do we parse the natural prompt so this small Handler is going to use the system prompt and it's going to return me a slash command and and as you can see in this log the intent was this is what the B return an intent message that starts with a slash and then if I just run intent to message kit now goes through itself goes through the swap Handler passes the commands and Returns the goal that was the URL of the frame so this is the second level intent any questions so far is it possible to generate a private key for a XMP B like on initialization yeah sure yeah yeah how do you using a c or traditional hex address yeah yeah so you pass the private in the in the variable right yeah in this example they are using it um I'm only using one from the M file but you could create you could send the key here as a parameter and I could send private key and send a custom private key like my key one and then I can create many of these and each one to have its own private key but but it would be deterministic right like uh if I pass a seed I'd be able to uh get a private key right I don't want it to be DET to get a a private key for from a SE uh I haven't done that like in code I guess yeah I guess yeah that should be straightforward and then that the thing that the seed generates you will need still to get the private key for sending it here um okay so that was second stage the reply starts with the slash command then triggers intent and the third one is uh reasoning so this this agent is going to have more things to play with I'm going to run NS agent here and in this example we are the bot knows free commands so check is going to check for the domain register if we want them to if the B wants to register in domain and information about the domain and again a simple prompt that is going to interpret whatever the user says and this prompt is different because it's going to allow me to uh this this prom can reply more than one message so it could reply please let me check and then actually check it and then send you even the response of that so let's see how that could work okay if you you want to know how this continues yeah just in the good staff no worries okay um that was the last level of intent this is using also shortterm memory uh that makes the B work uh better and yeah that was message kit powered by ephemera x&p and Converse so happy to see you at the booth if you have any questions um and yeah thank you [Music]

Automatic transcript — names and jargon may be misspelled.