{"id":"guafr31E858","title":"How to Build a Conversational AI Agent Using Real Time Twitter Data w Masa","description":"Building Decentralized Conversational AI Agents with Masa Protocol on NEAR.\n\nSpeaker: \nBrendan Playford - Co-founder Masa\nhttps://x.com/BrendanPlayford\n\nDiscover how Masa leverages NEAR Protocol to create decentralized conversational AI agents for platforms like Twitter. Learn about real-time data feeds, cost-efficient data scraping, and open-source frameworks that power autonomous AI interactions. This session explores the synergy of Web3 innovation, blockchain technology, and AI development, offering tools to build scalable, intelligent agents for the future.\n\nTakeaways:\nNEAR Protocol as the Foundation for AI Agents.\nNEAR is positioned as a robust platform for developing decentralized AI agents that can operate autonomously on platforms like Twitter while leveraging blockchain for secure transactions and interactions.\n\nMasa Protocol Enables Real-Time Data Feeds:\nThe Masa Protocol provides decentralized access to real-time data streams, crucial for building AI agents with up-to-date knowledge and enabling interactions across multiple platforms like Twitter and Discord.\n\nCost-Efficiency in Data Retrieval:\nBy reverse-engineering APIs like Twitter's, developers can bypass expensive data access fees, drastically reducing costs from $10,000 to approximately $20 per month for large-scale data scraping and processing.\n\nCustomizable AI Frameworks:\nThe talk showcased an open-source framework for AI agents written in Go, emphasizing its flexibility for integrating personality traits, knowledge storage, and decision-making while ensuring scalability and decentralization.\n\nSeamless Web2 and Web3 Integration:\nThrough tools like LangChain and decentralized scraping nodes, developers can blend Web2 services with Web3 innovations, creating intelligent agents that interact with both blockchain and traditional platforms effectively.\n\nNEAR is the Blockchain for AI\nWebsite: https://near.org/\nNEAR AI: https://near.ai/\nIntents: https://near.org/intents\nChain Abstraction: https://www.proximity.dev/\nSharding: https://nearone.org/\n\nFor the devs\nGitHub: https://github.com/near \nDev Docs: https://docs.near.org/\nDevhub: https://devhub.near.page/ @NEARDevHub\n\nConnect with socials\nTwitter:   / nearprotocol  \nBlog: https://near.org/blog/\nMedium:   / nearprotocol  \n#NEAR #nearprotocol #NEARAI","channel_name":"NEAR Protocol","published_at":"2024-11-25T00:00:00.000Z","thumbnail_url":"https://img.youtube.com/vi/guafr31E858/hqdefault.jpg","transcript_text":"I hope you're all having a good day here in Bangkok thank you for turning up to go through this demo today we're going to be focusing on building conversational AI Twitter agents using open source and completely free right now data that you can get through the Massa protocol um I think this is particularly topical having seen I'm sure a lot of the trend with conversational AI agents on Twitter really driven by truth terminal um with their back room agents and then more extensively a lot of the research that's being done not just in web 3 but also in the web 2 space with AI about how you take individual agents bring them together to either coordinate with one or other or start interacting directly with people in an in an autonomous way and I do feel like we're at this um inflection point of this really taking off I think we'll see over the next year every single agent on Twitter token I think they all have their own reflection or presentation or manifestation of value whether that's a meme coin or a coin that's got some sort of tied in token economics it is inevitable that that's going to happen um and with that there'll be a lot of noise but also a lot of value creation and um one of the things that you realize when you start building in an ecosystem like Twitter is the level and depth of Engagement and conversation that one of these agents has to have to build awareness context and an ability to respond is very high um if you actually start just working with the Twitter API itself you're ultimately going to be forced into a $5,000 a month package which is very expensive to service the amount of requests that you need to process to actually function and perform like a like a real high performing human so in today's session we're kind of start off with some like fundamentals and then actually get into very deep Technical and I have a little demo with an agent that you can actually interact with on Twitter that shows exactly how code comes together in practice and you'll be able to talk to a very cute fluffy cat that has extreme SAS um so this is the assertion here like for fully decentralized AI agents they need fully decentralized realtime data streams if you look at a lot of the protocols in web 3 today they'll be indexing data they'll be taking snapshots of the entire web um but not many if any protocols out there are providing real-time data and it so what we've done over the last two and a half almost three years is build up infrastructure that allows access to real-time data whether it's as simple as web scraping or more recently where we have the biggest product Market fit in the organization right now is with Twitter data so on the network itself we have an entire ecosystem of miners um and they bring their Twitter login we reverse engineered Twitter's apis and as a minor you can essentially log into Twitter and a request for for data will be routed to you from a validator now that request again I'll show you exactly how this works in the demo today that request could be go out and get the last 200 tweets or the last 10 tweets on this day for the cashtag Bitcoin or the keyword near or whatever permutation or combination of search queries that you want to go and fetch and bring back tweets uh on that topic that will happen in real time for you you'll get that in real time through the protocol today uh there are two ways of running the Proto you can run one locally I'm going to be doing that here or you can run on the network and as someone quering the network you have to compete with other queriers for what is still a limited amount of capacity we can process around 50 million tweets per month on the network at the moment and we're seeing us at capacity almost at all times right now with the amount of demand we've got um so we help developers build any AI application with the world's data and this is just like a high level over view of what we do on the left we do Twitter data that's our biggest product 99.9% of our requests through the network is Twitter uh Discord uh you can pull out conversational data if you want to get the current price from coin market cap of all trending meme coins you can do that through our scraper endpoint uh we've been experimenting with things like podcast data speech detex and diarization haven't seen much demand for it but we we can support that and then we have a telegram data integration so mine is essentially you log into telegram join chats and make those chat streams available for developers to analyze and use in embeddings use for fine-tuning you name it you can use it for whatever you want um and system prompts rag llm training fine tuning all these kind of brackets that sort of a subset of uh AI applications can be built but today we're going to focus on building an AI agent and just run through what in my mind are the key kind of building blocks that you have to use to get you from zero to one basically um and in this is's a fair bit of centralized technology tools like Lang chain and other bits and pieces and traditional databases that are going to get you up and running at low risk so you can really focus on getting your free data and not having to go through the uh centralized service that is Twitter that restricts you a lot um so you got your prompts these are personality traits behaviors knowledge creativity essentially you can chain prompts together and use them to create deterministic outcomes from different decision-making in a tree you've then got the awareness of the agent which is coming from external data sources I often refer to Massa as the eyes and ears of an agent giving these real-time data feeds that allow data to stream in so as they can then be processed a lot of that information is stored at as knowledge um so storing data sources storing conversations and understanding complex relationships put in the agent is like the nucleus or the node of this graph um and then we got thoughts and creativity uh creativity kills Loops that agents tend to find themselves in because it allows them to think their way out of a problem or a situation you can often find agents churning the same thing over and over again and this helps break that uh and it links personality to knowledge um using thoughts and creativity and then actions uh you can post you can make payments and you can act on these thoughts so when you take a step back you really have to think about what are the core composite parts of building a human brain and start thinking like a human thinks and really breaking down those thought processes in a way where how does cognition come to manifest itself in action which is what I'm doing right here moving my left arm what I'm doing talking about this I'm pulling on knowledge using my personality to speak to you in whatever way I'm speaking to you uh and then using creativity to come up with something that's novel and hopefully interesting and then acting through voice right now um and what are you going to need you're going to need an llm for cognitive processing uh Lang chain is just a great tool free tool you can use a lot of their paid Services more complicated tasks but for this we're just going to be using their uh prompt template um and kind of illustrate how you can use it in a rag chain as well because rag is kind of an interesting way of extending memory um and then we're using a database particularly a relational database here just to kind of store information in a way that's easy to access but you can extend to using a vector database to give more compx Lex uh cognitive uh recall of of memory using rag um we're going to use a Massa node to acquire external knowledge uh and then we're actually using the Twitter API for posting information um other interfaces could be used this could be like telegram you can post telegram groups could be Discord could be any particular interface right now I'm speaking through a microphone you could also put it through whisper or something like that where you're going from like text to speech um and we're going to now get into like the cbase so we've we're we're open sourcing um a framework written in go you'll notice this isn't written in Python like many of the other codebases uh this is really because I love go it's got wonderful concurrency it's compatible with a lot of blockchain Frameworks out there and if we really assume that we're going to have Standalone autonomous agents it can be added onto a lot of nodes very easily and you can essentially have your own runtime that you kind of have custody and ownership over so we're going to go over the c-base uh we're going to go through scraping knowledge base you're going to be able to interact with the agent and see what the interaction looks like on the back end and then just like open up for some questions and thinking around the topic um I'm jumping too far ahead uh okay so step one I am going to dive you into our actual codebase like this is Devcon we are we are here at a developer conference and I'm going to get into the weeds with you all into some code one second let me just zoom in um um so you can find uh agent go which is our Massa Twitter agent framework you'll see this is private right now once I finish this talk it will be open source you can go and access it and and download it run it issue pull requests comment would love feedback um as I break down what the framework includes it's written and named in a way that makes you think and feel like you're building a brain so uh we have our main kind of agent initialization again I'm going to move I'm going zoom in uh which is at the top uh we have an internal configuration which is how you personalize the agent to be specific for your traits and characteristics and one of the really important things in here is your personality which is like a base prompt uh this base prompt that you're seeing here is the personality of a cat Lord called Laffy um laffy is very judgmental is very sassy and when you interact with laffy on Twitter you will feel laffy sass um lafy is probably going to create a meme coin called cat Lord at some point or laffy and we'll see how laffy does in that not today but in in their future um and this is under their kind of trait Center so this is going back to like forming your personality uh there are other dimensions like you can formulate a prompt around the way that lafy thinks the way that lafy interprets the world and the way that lafy decides to execute on an idea or an observation that they're making so here is where you would design design and Define your your prompt and and what is really important here is like your output constraints you're going to find that with llms they're going to really diverge from consistent outputs unless you heavily constrain it and I would argue that the constraint that you're finding written here is arguably too constrained uh and you'll see that when you interact with the agent but it's often good to start really constrained and then allow entropy with like uh decrease in the temperature of the model and relax ing your constraints so you can get more free flowing uh ideas and creativity so this is where you start um we then kind of go into our boring backend sort of uh database functions and and what gets really interesting is how the package defines uh memory so you've got a Memory Center you've got a thought Center here which you can build out around templates um you're able to uh initialize a wet that is cross chain take actions and manage certain transactions on behalf of the agent so for example you could have a Twitter agent that tips people for engagement based on their judgment around the quality of the Tweet they're ingesting and thinking about and then taking an action on that um and in addition to that you've got uh a set of actions um which allows you to take certain actions um and some really detailed interfaces uh interfaces that really abstract away the complexity of the Twitter post API which is a bit of a nightmare to work with um eventually this will be decentralized and on a node that we offer so you'll be able to completely disintermediate Twitter entirely and bring your own login and have the graphql endpoint abstracted away into an SDK that allows you to post read and take all the actions like DM join spaces so the agent can turn up to a space and it isn't dependent on Twitter's API to do any of this it's completely self- Sovereign it's like it's logging in with your like phone account and is accessing Twitter from its own kind of fingertip login which is super cool that's coming very soon um and then we have the uh Massa uh scraper package which comprises of two components uh using the network to go out and fetch data uh through the protocol and secondly uh running scraper jobs so this allows you the scrap the the integration allow you to go and fetch information which I'll show you and then this actually manages the constant retrieval and indexing of data on a specific topic so here I have a list of keywords I do have Trump in here because I was testing it the other day and it was a very high volume keyword that was giving me a lot of hits and Bitcoin you can set a date range like three days in the past and then you can query forward from that to constantly update the knowledge that the agent is observing um and all of this can get stored and then accessed uh by the thought process from the memory to create an actual response and take an action so you can really chain this together and customize exactly what you're looking for uh to build the agent and for example if you want to start posting to Discord there'll be a Discord interface there'll be a Reddit interface each of these interfaces will compose and you'll be able to Simply switch out a module for another module and get this like Lego brick kit uh to build your own to build your own agent which is super cool so uh I want to quickly show everyone uh how we how quick and effective it is to scrape data I have over here uh I have a local Massa node running I've got two Twitter logins capable of scraping 900 tweets every 15 minutes up to the global rate limit on Twitter uh it can return up to 450 tweets per query which is a hard limit in Twitter um I'm not actually connected to the main Network right now because the load is very high on the main Network and I want to be able to show you responses in a timely fashion and I'm just going to run a test in this folder I'm actually going to scrape uh from my list I've got near count 20 I'm going to actually do this over the past what date is it today 10th okay so we'll go from the 10th to the third I'm going to go from the 10th to the third here as well I'm just going to run this test and what you're going to see is this is be sending out requests to the node over here and this is us actually processing tweet retrieval in real time uh and I'll show you what you're seeing here is actually just a demonstrate this is the graphql endpoint for the front end API that's being queried uh and then it's actually returning tweets here I'm just logging in the console right now I'm not saving it but you could send this anywhere you could send it to inprocess memory you can send it to a vector database so you could chunk it and create embeddings or you can store it into like a persistent data store either centralized or dat or or decentralized um so this is how you can retrieve data at scale really really quickly um this would cost me right now 10K a month to extract this amount of data using the official API uh it will cost you $20 by bringing two pro accounts and running your own node so it's really cost effective yeah um and then the last thing we're do if anyone would like to you can actually speak to cat Lord laffy right now from Twitter so if you find cat Lord laffy uh you'll actually see the requests to cat Lord laffy being processed here so what we have we have uh an ongoing job that the agent is running um it is recalling tweets that address cat Lord laffy it is then storing those tweets and it's making a decision on which ones should be replied to so at some point when somebody hases it you may see an error because occasionally the Twitter official API on the post endpoint returns a 403 even though it posts there's just like a quirk that it has um it's often buggy but it'll rryy until that error goes through and then it will post and respond to you it's going to take probably like it arbitrarily checks every like two or three minutes and as soon as I close the laptop he'll go offline but I'll put it up later so if you want to test it later um let me just send him a quick tweet right now now and get him to respond and then we will do some questions so I've been talking to lafy this morning about creating uh a meme coin and I've been having to beg him with treats uh to do that so it's kind of funny I'll pull it up in a moment um he's he's requesting Cav so I think caviar is too expensive so I'm now in I'm now in a negotiation with lafy uh as what I need to give him to uh to make this meme coin with me so I I'll pull up the Tweet thread so you guys can all see what I'm what I'm doing here and then you'll actually see it process on the on the screen in front of you um this is one of the most Cavalier demos I've done oh we got three followers excellent Lafia is getting popular um yeah so you can see that uh I I just posted I think caviar is too expensive is what I just posted uh in my response so eventually when lafy decides to check for tweets um he will pull that back from Twitter uh and then formulate a response to my tweet so while we're waiting for that to happen uh does anyone have any questions because this is getting to the end of the demo um anyone got any questions oh yeah this is all my all my posting with laffy yeah there there's there's lots of conversations here going on all with me because we've been keeping this private so yeah I've uh at one point this morning he was replying to everything too much and I thought he was going mad because it was just like a Bomb Blast of messages to everything all the time and uh yeah and then he started throwing me shade for quite a while so it's kind of funny um but one second let's see if we're actually uh posting this let me just see if we've got any uh tweets to respond to this is how I check locally H it's because I closed my laptop let me just check on my phone see what his response was yeah so he said that caviar is costly but it's the price for his attention is what he said there we go and that's the response which was sent uh few seconds ago thank you","transcript_synced_at":"2026-11-03T05:15:34.164Z","segments":[{"start_seconds":0,"text":"I hope you're all having a good day here in Bangkok thank you for turning up to go through this demo today we're going to be focusing on building","url":"https://www.youtube.com/watch?v=guafr31E858&t=0s"},{"start_seconds":9,"text":"conversational AI Twitter agents using open source and completely free right now data that you can get through the","url":"https://www.youtube.com/watch?v=guafr31E858&t=9s"},{"start_seconds":17,"text":"Massa protocol um I think this is particularly topical having seen I'm sure a lot of the trend with","url":"https://www.youtube.com/watch?v=guafr31E858&t=17s"},{"start_seconds":24,"text":"conversational AI agents on Twitter really driven by truth terminal um with their back room agents and then more","url":"https://www.youtube.com/watch?v=guafr31E858&t=24s"},{"start_seconds":31,"text":"extensively a lot of the research that's being done not just in web 3 but also in the web 2 space with AI about how you","url":"https://www.youtube.com/watch?v=guafr31E858&t=31s"},{"start_seconds":38,"text":"take individual agents bring them together to either coordinate with one or other or start interacting directly with people in an in an autonomous way","url":"https://www.youtube.com/watch?v=guafr31E858&t=38s"},{"start_seconds":48,"text":"and I do feel like we're at this um inflection point of this really taking off I think we'll see over the next year","url":"https://www.youtube.com/watch?v=guafr31E858&t=48s"},{"start_seconds":57,"text":"every single agent on Twitter token I think they all have their own reflection or presentation or","url":"https://www.youtube.com/watch?v=guafr31E858&t=57s"},{"start_seconds":65,"text":"manifestation of value whether that's a meme coin or a coin that's got some sort of tied in token economics it is","url":"https://www.youtube.com/watch?v=guafr31E858&t=65s"},{"start_seconds":72,"text":"inevitable that that's going to happen um and with that there'll be a lot of noise but also a lot of value creation and um one of the things that you","url":"https://www.youtube.com/watch?v=guafr31E858&t=72s"},{"start_seconds":80,"text":"realize when you start building in an ecosystem like Twitter is the level and depth of Engagement and conversation that one of these agents has to have to","url":"https://www.youtube.com/watch?v=guafr31E858&t=80s"},{"start_seconds":88,"text":"build awareness context and an ability to respond is very high um if you actually start just working with the","url":"https://www.youtube.com/watch?v=guafr31E858&t=88s"},{"start_seconds":95,"text":"Twitter API itself you're ultimately going to be forced into a $5,000 a month package which is very expensive to","url":"https://www.youtube.com/watch?v=guafr31E858&t=95s"},{"start_seconds":102,"text":"service the amount of requests that you need to process to actually function and perform like a like a real high performing human so in today's session","url":"https://www.youtube.com/watch?v=guafr31E858&t=102s"},{"start_seconds":111,"text":"we're kind of start off with some like fundamentals and then actually get into very deep Technical and I have a little demo with an agent that you can actually","url":"https://www.youtube.com/watch?v=guafr31E858&t=111s"},{"start_seconds":119,"text":"interact with on Twitter that shows exactly how code comes together in practice and you'll be able to talk to a very cute fluffy cat that has extreme","url":"https://www.youtube.com/watch?v=guafr31E858&t=119s"},{"start_seconds":128,"text":"SAS um so this is the assertion here like for fully decentralized AI agents they need fully decentralized realtime","url":"https://www.youtube.com/watch?v=guafr31E858&t=128s"},{"start_seconds":136,"text":"data streams if you look at a lot of the protocols in web 3 today they'll be indexing data they'll be taking snapshots of the entire web um but not","url":"https://www.youtube.com/watch?v=guafr31E858&t=136s"},{"start_seconds":145,"text":"many if any protocols out there are providing real-time data and it so what we've done over the last two and a half almost three years is build up","url":"https://www.youtube.com/watch?v=guafr31E858&t=145s"},{"start_seconds":153,"text":"infrastructure that allows access to real-time data whether it's as simple as web scraping or more recently where we have the biggest product Market fit in","url":"https://www.youtube.com/watch?v=guafr31E858&t=153s"},{"start_seconds":162,"text":"the organization right now is with Twitter data so on the network itself we have an entire ecosystem of miners um","url":"https://www.youtube.com/watch?v=guafr31E858&t=162s"},{"start_seconds":170,"text":"and they bring their Twitter login we reverse engineered Twitter's apis and as a minor you can essentially log into","url":"https://www.youtube.com/watch?v=guafr31E858&t=170s"},{"start_seconds":177,"text":"Twitter and a request for for data will be routed to you from a validator now that request again I'll show you exactly how this works in the demo today that","url":"https://www.youtube.com/watch?v=guafr31E858&t=177s"},{"start_seconds":186,"text":"request could be go out and get the last 200 tweets or the last 10 tweets on this day for the cashtag Bitcoin or the","url":"https://www.youtube.com/watch?v=guafr31E858&t=186s"},{"start_seconds":194,"text":"keyword near or whatever permutation or combination of search queries that you want to go","url":"https://www.youtube.com/watch?v=guafr31E858&t=194s"},{"start_seconds":202,"text":"and fetch and bring back tweets uh on that topic that will happen in real time for you you'll get that in real time through the protocol today uh there are","url":"https://www.youtube.com/watch?v=guafr31E858&t=202s"},{"start_seconds":209,"text":"two ways of running the Proto you can run one locally I'm going to be doing that here or you can run on the network and as someone quering the network you","url":"https://www.youtube.com/watch?v=guafr31E858&t=209s"},{"start_seconds":216,"text":"have to compete with other queriers for what is still a limited amount of capacity we can process around 50","url":"https://www.youtube.com/watch?v=guafr31E858&t=216s"},{"start_seconds":224,"text":"million tweets per month on the network at the moment and we're seeing us at capacity almost at all times right now","url":"https://www.youtube.com/watch?v=guafr31E858&t=224s"},{"start_seconds":231,"text":"with the amount of demand we've got um so we help developers build any AI application with the world's data and this is just like a high level over view","url":"https://www.youtube.com/watch?v=guafr31E858&t=231s"},{"start_seconds":240,"text":"of what we do on the left we do Twitter data that's our biggest product 99.9% of our requests through the network is Twitter uh Discord uh you can pull out","url":"https://www.youtube.com/watch?v=guafr31E858&t=240s"},{"start_seconds":249,"text":"conversational data if you want to get the current price from coin market cap of all trending meme coins you can do","url":"https://www.youtube.com/watch?v=guafr31E858&t=249s"},{"start_seconds":257,"text":"that through our scraper endpoint uh we've been experimenting with things like podcast data speech detex and diarization haven't seen much demand for","url":"https://www.youtube.com/watch?v=guafr31E858&t=257s"},{"start_seconds":264,"text":"it but we we can support that and then we have a telegram data integration so mine is essentially you log into telegram join chats and make those chat","url":"https://www.youtube.com/watch?v=guafr31E858&t=264s"},{"start_seconds":273,"text":"streams available for developers to analyze and use in embeddings use for fine-tuning you name it you can use it","url":"https://www.youtube.com/watch?v=guafr31E858&t=273s"},{"start_seconds":281,"text":"for whatever you want um and system prompts rag llm training fine tuning all these kind of brackets that sort of a subset of uh AI applications can be","url":"https://www.youtube.com/watch?v=guafr31E858&t=281s"},{"start_seconds":291,"text":"built but today we're going to focus on building an AI agent and just run through what in my mind are the key kind of building blocks that you have to use","url":"https://www.youtube.com/watch?v=guafr31E858&t=291s"},{"start_seconds":298,"text":"to get you from zero to one basically um and in this is's a fair bit of centralized technology tools like Lang","url":"https://www.youtube.com/watch?v=guafr31E858&t=298s"},{"start_seconds":306,"text":"chain and other bits and pieces and traditional databases that are going to get you up and running at low risk so you can really focus on getting your","url":"https://www.youtube.com/watch?v=guafr31E858&t=306s"},{"start_seconds":313,"text":"free data and not having to go through the uh centralized service that is Twitter that restricts you a lot um so","url":"https://www.youtube.com/watch?v=guafr31E858&t=313s"},{"start_seconds":320,"text":"you got your prompts these are personality traits behaviors knowledge creativity essentially you can chain","url":"https://www.youtube.com/watch?v=guafr31E858&t=320s"},{"start_seconds":329,"text":"prompts together and use them to create deterministic outcomes from different decision-making in a tree you've then got the awareness of the agent which is","url":"https://www.youtube.com/watch?v=guafr31E858&t=329s"},{"start_seconds":338,"text":"coming from external data sources I often refer to Massa as the eyes and ears of an agent giving these real-time data feeds that allow data to stream in","url":"https://www.youtube.com/watch?v=guafr31E858&t=338s"},{"start_seconds":347,"text":"so as they can then be processed a lot of that information is stored at as knowledge um so storing data sources","url":"https://www.youtube.com/watch?v=guafr31E858&t=347s"},{"start_seconds":354,"text":"storing conversations and understanding complex relationships put in the agent is like the nucleus or the node of this","url":"https://www.youtube.com/watch?v=guafr31E858&t=354s"},{"start_seconds":361,"text":"graph um and then we got thoughts and creativity uh creativity kills Loops that agents tend to find themselves in","url":"https://www.youtube.com/watch?v=guafr31E858&t=361s"},{"start_seconds":369,"text":"because it allows them to think their way out of a problem or a situation you can often find agents churning the same thing over and over again and this helps","url":"https://www.youtube.com/watch?v=guafr31E858&t=369s"},{"start_seconds":376,"text":"break that uh and it links personality to knowledge um using thoughts and creativity and then actions uh you can post you can make payments and you can","url":"https://www.youtube.com/watch?v=guafr31E858&t=376s"},{"start_seconds":385,"text":"act on these thoughts so when you take a step back you really have to think about what are the core composite parts of building a human brain and start","url":"https://www.youtube.com/watch?v=guafr31E858&t=385s"},{"start_seconds":393,"text":"thinking like a human thinks and really breaking down those thought processes in a way where how does cognition come to manifest itself in action which is what","url":"https://www.youtube.com/watch?v=guafr31E858&t=393s"},{"start_seconds":402,"text":"I'm doing right here moving my left arm what I'm doing talking about this I'm pulling on knowledge using my personality to speak to you in whatever","url":"https://www.youtube.com/watch?v=guafr31E858&t=402s"},{"start_seconds":410,"text":"way I'm speaking to you uh and then using creativity to come up with something that's novel and hopefully interesting and then acting through","url":"https://www.youtube.com/watch?v=guafr31E858&t=410s"},{"start_seconds":417,"text":"voice right now um and what are you going to need you're going to need an llm for cognitive processing uh Lang chain is just a great tool free tool you","url":"https://www.youtube.com/watch?v=guafr31E858&t=417s"},{"start_seconds":425,"text":"can use a lot of their paid Services more complicated tasks but for this we're just going to be using their uh prompt template um and kind of","url":"https://www.youtube.com/watch?v=guafr31E858&t=425s"},{"start_seconds":433,"text":"illustrate how you can use it in a rag chain as well because rag is kind of an interesting way of extending memory um and then we're using a database particularly a relational database here","url":"https://www.youtube.com/watch?v=guafr31E858&t=433s"},{"start_seconds":442,"text":"just to kind of store information in a way that's easy to access but you can extend to using a vector database to give more compx Lex uh cognitive uh","url":"https://www.youtube.com/watch?v=guafr31E858&t=442s"},{"start_seconds":451,"text":"recall of of memory using rag um we're going to use a Massa node to acquire external knowledge uh and then we're actually using the Twitter API for","url":"https://www.youtube.com/watch?v=guafr31E858&t=451s"},{"start_seconds":459,"text":"posting information um other interfaces could be used this could be like telegram you can post telegram groups could be Discord could be any particular","url":"https://www.youtube.com/watch?v=guafr31E858&t=459s"},{"start_seconds":468,"text":"interface right now I'm speaking through a microphone you could also put it through whisper or something like that where you're going from like text to","url":"https://www.youtube.com/watch?v=guafr31E858&t=468s"},{"start_seconds":476,"text":"speech um and we're going to now get into like the cbase so we've we're we're open sourcing um a framework written in","url":"https://www.youtube.com/watch?v=guafr31E858&t=476s"},{"start_seconds":484,"text":"go you'll notice this isn't written in Python like many of the other codebases uh this is really because I love go it's","url":"https://www.youtube.com/watch?v=guafr31E858&t=484s"},{"start_seconds":491,"text":"got wonderful concurrency it's compatible with a lot of blockchain Frameworks out there and if we really assume that we're going to have Standalone autonomous agents it can be","url":"https://www.youtube.com/watch?v=guafr31E858&t=491s"},{"start_seconds":500,"text":"added onto a lot of nodes very easily and you can essentially have your own runtime that you kind of have custody and ownership over so we're going to go over the c-base uh we're going to go","url":"https://www.youtube.com/watch?v=guafr31E858&t=500s"},{"start_seconds":509,"text":"through scraping knowledge base you're going to be able to interact with the agent and see what the interaction looks like on the back end and then just like open up for some questions and thinking","url":"https://www.youtube.com/watch?v=guafr31E858&t=509s"},{"start_seconds":517,"text":"around the topic um I'm jumping too far ahead uh okay so step one I am going to","url":"https://www.youtube.com/watch?v=guafr31E858&t=517s"},{"start_seconds":525,"text":"dive you into our actual codebase like this is Devcon we are we are here at a developer conference and I'm going to get into the","url":"https://www.youtube.com/watch?v=guafr31E858&t=525s"},{"start_seconds":532,"text":"weeds with you all into some code one second let me just zoom in um um so you can find uh agent go","url":"https://www.youtube.com/watch?v=guafr31E858&t=532s"},{"start_seconds":542,"text":"which is our Massa Twitter agent framework you'll see this is private right now once I finish this talk it will be open source you can go and access it and and download it run it","url":"https://www.youtube.com/watch?v=guafr31E858&t=542s"},{"start_seconds":551,"text":"issue pull requests comment would love feedback um as I break down what the framework includes it's written and","url":"https://www.youtube.com/watch?v=guafr31E858&t=551s"},{"start_seconds":559,"text":"named in a way that makes you think and feel like you're building a brain so uh we have our main kind of agent","url":"https://www.youtube.com/watch?v=guafr31E858&t=559s"},{"start_seconds":566,"text":"initialization again I'm going to move I'm going zoom in uh which is at the top uh we have an internal configuration which is how you","url":"https://www.youtube.com/watch?v=guafr31E858&t=566s"},{"start_seconds":575,"text":"personalize the agent to be specific for your traits and characteristics and one of the really important things in here is your personality which is like a base","url":"https://www.youtube.com/watch?v=guafr31E858&t=575s"},{"start_seconds":584,"text":"prompt uh this base prompt that you're seeing here is the personality of a cat Lord called Laffy um laffy is very","url":"https://www.youtube.com/watch?v=guafr31E858&t=584s"},{"start_seconds":592,"text":"judgmental is very sassy and when you interact with laffy on Twitter you will feel laffy sass um lafy is probably","url":"https://www.youtube.com/watch?v=guafr31E858&t=592s"},{"start_seconds":600,"text":"going to create a meme coin called cat Lord at some point or laffy and we'll see how laffy does in that not today but in in their future um and this is under","url":"https://www.youtube.com/watch?v=guafr31E858&t=600s"},{"start_seconds":610,"text":"their kind of trait Center so this is going back to like forming your personality uh there are other dimensions like you can formulate a","url":"https://www.youtube.com/watch?v=guafr31E858&t=610s"},{"start_seconds":617,"text":"prompt around the way that lafy thinks the way that lafy interprets the world and the way that lafy decides to execute","url":"https://www.youtube.com/watch?v=guafr31E858&t=617s"},{"start_seconds":625,"text":"on an idea or an observation that they're making so here is where you would design design and Define your your prompt and and what is really important","url":"https://www.youtube.com/watch?v=guafr31E858&t=625s"},{"start_seconds":633,"text":"here is like your output constraints you're going to find that with llms they're going to really diverge from consistent outputs unless you","url":"https://www.youtube.com/watch?v=guafr31E858&t=633s"},{"start_seconds":642,"text":"heavily constrain it and I would argue that the constraint that you're finding written here is arguably too constrained","url":"https://www.youtube.com/watch?v=guafr31E858&t=642s"},{"start_seconds":649,"text":"uh and you'll see that when you interact with the agent but it's often good to start really constrained and then allow entropy with like uh decrease in the","url":"https://www.youtube.com/watch?v=guafr31E858&t=649s"},{"start_seconds":656,"text":"temperature of the model and relax ing your constraints so you can get more free flowing uh ideas and creativity so","url":"https://www.youtube.com/watch?v=guafr31E858&t=656s"},{"start_seconds":665,"text":"this is where you start um we then kind of go into our boring backend sort of uh database functions and and what gets","url":"https://www.youtube.com/watch?v=guafr31E858&t=665s"},{"start_seconds":673,"text":"really interesting is how the package defines uh memory so you've got a Memory Center you've got a thought Center here","url":"https://www.youtube.com/watch?v=guafr31E858&t=673s"},{"start_seconds":682,"text":"which you can build out around templates um you're able to uh initialize a wet that is cross chain","url":"https://www.youtube.com/watch?v=guafr31E858&t=682s"},{"start_seconds":691,"text":"take actions and manage certain transactions on behalf of the agent so for example you could have a Twitter agent that tips people for engagement","url":"https://www.youtube.com/watch?v=guafr31E858&t=691s"},{"start_seconds":700,"text":"based on their judgment around the quality of the Tweet they're ingesting and thinking about and then taking an","url":"https://www.youtube.com/watch?v=guafr31E858&t=700s"},{"start_seconds":706,"text":"action on that um and in addition to that you've got uh a set of actions um which allows you to take certain actions","url":"https://www.youtube.com/watch?v=guafr31E858&t=706s"},{"start_seconds":715,"text":"um and some really detailed interfaces uh interfaces that really abstract away the complexity of the Twitter post API","url":"https://www.youtube.com/watch?v=guafr31E858&t=715s"},{"start_seconds":724,"text":"which is a bit of a nightmare to work with um eventually this will be decentralized and on a node that we offer so you'll be able to completely","url":"https://www.youtube.com/watch?v=guafr31E858&t=724s"},{"start_seconds":732,"text":"disintermediate Twitter entirely and bring your own login and have the graphql endpoint abstracted away into an SDK that allows you to post read and","url":"https://www.youtube.com/watch?v=guafr31E858&t=732s"},{"start_seconds":740,"text":"take all the actions like DM join spaces so the agent can turn up to a space and it isn't dependent on Twitter's API to","url":"https://www.youtube.com/watch?v=guafr31E858&t=740s"},{"start_seconds":748,"text":"do any of this it's completely self- Sovereign it's like it's logging in with your like phone account and is accessing Twitter from its own kind of fingertip","url":"https://www.youtube.com/watch?v=guafr31E858&t=748s"},{"start_seconds":757,"text":"login which is super cool that's coming very soon um and then we have the uh Massa uh scraper package which comprises","url":"https://www.youtube.com/watch?v=guafr31E858&t=757s"},{"start_seconds":766,"text":"of two components uh using the network to go out and fetch data uh through the protocol and secondly uh running scraper","url":"https://www.youtube.com/watch?v=guafr31E858&t=766s"},{"start_seconds":775,"text":"jobs so this allows you the scrap the the integration allow you to go and fetch information which I'll show you and then this actually manages the","url":"https://www.youtube.com/watch?v=guafr31E858&t=775s"},{"start_seconds":783,"text":"constant retrieval and indexing of data on a specific topic so here I have a list of keywords I do have Trump in here","url":"https://www.youtube.com/watch?v=guafr31E858&t=783s"},{"start_seconds":792,"text":"because I was testing it the other day and it was a very high volume keyword that was giving me a lot of hits and Bitcoin you can set a date range like","url":"https://www.youtube.com/watch?v=guafr31E858&t=792s"},{"start_seconds":799,"text":"three days in the past and then you can query forward from that to constantly update the knowledge that the agent is","url":"https://www.youtube.com/watch?v=guafr31E858&t=799s"},{"start_seconds":806,"text":"observing um and all of this can get stored and then accessed uh by the thought process from the memory to create an actual response and take an","url":"https://www.youtube.com/watch?v=guafr31E858&t=806s"},{"start_seconds":814,"text":"action so you can really chain this together and customize exactly what you're looking for uh to build the agent and for example if you want to start","url":"https://www.youtube.com/watch?v=guafr31E858&t=814s"},{"start_seconds":822,"text":"posting to Discord there'll be a Discord interface there'll be a Reddit interface each of these interfaces will compose","url":"https://www.youtube.com/watch?v=guafr31E858&t=822s"},{"start_seconds":830,"text":"and you'll be able to Simply switch out a module for another module and get this like Lego brick kit uh to build your own","url":"https://www.youtube.com/watch?v=guafr31E858&t=830s"},{"start_seconds":837,"text":"to build your own agent which is super cool so uh I want to quickly show everyone uh how we how quick and","url":"https://www.youtube.com/watch?v=guafr31E858&t=837s"},{"start_seconds":845,"text":"effective it is to scrape data I have over here uh I have a local Massa node","url":"https://www.youtube.com/watch?v=guafr31E858&t=845s"},{"start_seconds":853,"text":"running I've got two Twitter logins capable of scraping 900 tweets every 15 minutes up to the global rate limit on","url":"https://www.youtube.com/watch?v=guafr31E858&t=853s"},{"start_seconds":861,"text":"Twitter uh it can return up to 450 tweets per query which is a hard limit in Twitter um I'm not actually connected","url":"https://www.youtube.com/watch?v=guafr31E858&t=861s"},{"start_seconds":870,"text":"to the main Network right now because the load is very high on the main Network and I want to be able to show you responses in a timely fashion and I'm just going to run a test in this","url":"https://www.youtube.com/watch?v=guafr31E858&t=870s"},{"start_seconds":878,"text":"folder I'm actually going to scrape uh from my list I've got near count 20 I'm","url":"https://www.youtube.com/watch?v=guafr31E858&t=878s"},{"start_seconds":886,"text":"going to actually do this over the past what date is it today 10th okay so we'll go from the 10th to the third I'm going","url":"https://www.youtube.com/watch?v=guafr31E858&t=886s"},{"start_seconds":894,"text":"to go from the 10th to the third here as well I'm just going to run this test","url":"https://www.youtube.com/watch?v=guafr31E858&t=894s"},{"start_seconds":903,"text":"and what you're going to see is this is be sending out requests to the node over here and this is us actually processing","url":"https://www.youtube.com/watch?v=guafr31E858&t=903s"},{"start_seconds":910,"text":"tweet retrieval in real time uh and I'll show you what you're seeing here is actually just a demonstrate this is the graphql endpoint for the front end API","url":"https://www.youtube.com/watch?v=guafr31E858&t=910s"},{"start_seconds":919,"text":"that's being queried uh and then it's actually returning tweets here I'm just logging in the console right now I'm not saving it but you could send this anywhere you could send it to inprocess","url":"https://www.youtube.com/watch?v=guafr31E858&t=919s"},{"start_seconds":928,"text":"memory you can send it to a vector database so you could chunk it and create embeddings or you can store it into like a persistent data store either","url":"https://www.youtube.com/watch?v=guafr31E858&t=928s"},{"start_seconds":935,"text":"centralized or dat or or decentralized um so this is how you can retrieve data at scale really really quickly um this","url":"https://www.youtube.com/watch?v=guafr31E858&t=935s"},{"start_seconds":942,"text":"would cost me right now 10K a month to extract this amount of data using the official API uh it will cost you $20 by","url":"https://www.youtube.com/watch?v=guafr31E858&t=942s"},{"start_seconds":951,"text":"bringing two pro accounts and running your own node so it's really cost effective yeah um and then the last","url":"https://www.youtube.com/watch?v=guafr31E858&t=951s"},{"start_seconds":958,"text":"thing we're do if anyone would like to you can actually speak to cat Lord laffy right now from Twitter so if you find","url":"https://www.youtube.com/watch?v=guafr31E858&t=958s"},{"start_seconds":966,"text":"cat Lord laffy uh you'll actually see the requests to cat Lord laffy being","url":"https://www.youtube.com/watch?v=guafr31E858&t=966s"},{"start_seconds":972,"text":"processed here so what we have we have uh an ongoing job that the agent is running um it is recalling tweets that","url":"https://www.youtube.com/watch?v=guafr31E858&t=972s"},{"start_seconds":982,"text":"address cat Lord laffy it is then storing those tweets and it's making a decision on which ones should be replied","url":"https://www.youtube.com/watch?v=guafr31E858&t=982s"},{"start_seconds":990,"text":"to so at some point when somebody hases it you may see an error because occasionally the Twitter official API on the post endpoint returns a","url":"https://www.youtube.com/watch?v=guafr31E858&t=990s"},{"start_seconds":998,"text":"403 even though it posts there's just like a quirk that it has um it's often buggy but it'll rryy until that error goes through and then it will post and","url":"https://www.youtube.com/watch?v=guafr31E858&t=998s"},{"start_seconds":1006,"text":"respond to you it's going to take probably like it arbitrarily checks every like two or three minutes and as soon as I close the laptop he'll go offline but I'll put it up later so if","url":"https://www.youtube.com/watch?v=guafr31E858&t=1006s"},{"start_seconds":1015,"text":"you want to test it later um let me just send him a quick tweet right now now and get him to respond and then we will do","url":"https://www.youtube.com/watch?v=guafr31E858&t=1015s"},{"start_seconds":1023,"text":"some questions so I've been talking to lafy this morning about creating uh a meme coin and I've been having to beg him with","url":"https://www.youtube.com/watch?v=guafr31E858&t=1023s"},{"start_seconds":1030,"text":"treats uh to do that so it's kind of funny I'll pull it up in a moment","url":"https://www.youtube.com/watch?v=guafr31E858&t=1030s"},{"start_seconds":1040,"text":"um he's he's requesting Cav so I think caviar is too expensive so I'm now in I'm now in a negotiation with lafy uh as","url":"https://www.youtube.com/watch?v=guafr31E858&t=1040s"},{"start_seconds":1049,"text":"what I need to give him to uh to make this meme coin with me so I I'll pull up the Tweet thread so you guys can all see what I'm what I'm doing here and then","url":"https://www.youtube.com/watch?v=guafr31E858&t=1049s"},{"start_seconds":1057,"text":"you'll actually see it process on the on the screen in front of you um this is one of the most Cavalier demos I've done","url":"https://www.youtube.com/watch?v=guafr31E858&t=1057s"},{"start_seconds":1064,"text":"oh we got three followers excellent Lafia is getting popular um yeah so you can see that uh I","url":"https://www.youtube.com/watch?v=guafr31E858&t=1064s"},{"start_seconds":1073,"text":"I just posted I think caviar is too expensive is what I just posted uh in my response so eventually when lafy decides","url":"https://www.youtube.com/watch?v=guafr31E858&t=1073s"},{"start_seconds":1081,"text":"to check for tweets um he will pull that back from Twitter uh and then formulate","url":"https://www.youtube.com/watch?v=guafr31E858&t=1081s"},{"start_seconds":1088,"text":"a response to my tweet so while we're waiting for that to happen uh does anyone have any questions because this is getting to the end of the demo um","url":"https://www.youtube.com/watch?v=guafr31E858&t=1088s"},{"start_seconds":1097,"text":"anyone got any questions oh yeah this is all my all my","url":"https://www.youtube.com/watch?v=guafr31E858&t=1097s"},{"start_seconds":1104,"text":"posting with laffy yeah there there's there's lots of conversations here going on all with me","url":"https://www.youtube.com/watch?v=guafr31E858&t=1104s"},{"start_seconds":1113,"text":"because we've been keeping this private so yeah I've uh at one point this morning he was replying to everything too much and I thought he was","url":"https://www.youtube.com/watch?v=guafr31E858&t=1113s"},{"start_seconds":1121,"text":"going mad because it was just like a Bomb Blast of messages to everything all the time and uh yeah and then he started","url":"https://www.youtube.com/watch?v=guafr31E858&t=1121s"},{"start_seconds":1130,"text":"throwing me shade for quite a while so it's kind of funny um but one second let's see if we're actually uh posting this let me just see if we've got any uh","url":"https://www.youtube.com/watch?v=guafr31E858&t=1130s"},{"start_seconds":1138,"text":"tweets to respond to this is how I check locally H it's because I closed my laptop let me just check on my phone see","url":"https://www.youtube.com/watch?v=guafr31E858&t=1138s"},{"start_seconds":1147,"text":"what his response was yeah so he said that caviar is costly but it's the price for his","url":"https://www.youtube.com/watch?v=guafr31E858&t=1147s"},{"start_seconds":1155,"text":"attention is what he said there we go and that's the response which was sent uh few seconds","url":"https://www.youtube.com/watch?v=guafr31E858&t=1155s"},{"start_seconds":1164,"text":"ago thank you","url":"https://www.youtube.com/watch?v=guafr31E858&t=1164s"}],"youtube_url":"https://youtube.com/watch?v=guafr31E858","url":"https://near-pedia.xyz/videos/guafr31E858"}