Building AI Agents on The Graph

ETHGlobal Lisbon 2026 · July 2026 · 22:30

Kevin Jones of Edge & Node introduces The Graph Protocol, a decentralized network of indexers, and the hackathon bounties for AI-related builds. He explains subgraphs as GraphQL APIs for smart contract data, Substreams for fast streaming, and how builders can create tooling or agents that use The Graph to work with onchain data.

Speakers

Topics

From ETHGlobal Lisbon 2026, hosted by ETHGlobal.

Transcript

Uh how are you guys doing? Everyone having a good time? What a beautiful venue, right? This is amazing. Um thank you so much for coming. Uh my name is Kevin Jones. So, I'm a member of the Build Guild. I did a workshop earlier about Ethereum. Uh I'm also working at Edge & Node. So, Edge & Node is the original creators of The Graph Protocol. So, we're going to be talking about The Graph. We're going to be talking about the bounties that are available, some of the things that you can hack on, and uh kind of go from there. So, uh I guess show of hands here, who has uh maybe built like a subgraph in the past? Anyone here built a subgraph?

What about Anyone here use substreams before? No? Okay, cool. So, these are these are like pretty much prime products that we have uh at The Graph Protocol. So, that's good. A lot of new new hands. There'll also be a little refresher on the subgraph stuff. And then we're going to be focusing on what um more specifically, we're kind of focused on like AI as well as some of our um bounties. So, we want you to either build tooling that will help AI work with The Graph or best use of an AI-related kind of application that uses The Graph. So, we'll go through those in a little bit. But um essentially, you know, for anyone who doesn't know what The Graph Protocol is, it is a decentralized network of indexers that

serve data, right? Um there's different ways that you can get access to that data, but you can essentially think of um The Graph as a network of individuals, indexers, that are actually running a stack, and that give you access to different kinds of data. So, one of those uh uh products is subgraphs. Subgraphs are GraphQL-based APIs, right? So, they're very very easy to uh get large amounts of information about something that is complex like a blockchain, right? Blockchain uh uh we have this very um um hard to sift through kind of data structure that's time series, but it we don't really have a lot of tooling uh that is easy to be able to parse that

data. And so subgraphs really help you do that. Um subgraphs are very easy to create. You can come on here to the graph website and you can go to the subgraph studio and it will walk you through on how to create a subgraph. They're usually designed for uh very specific um uh subgraphs focused on one particular smart contract, right? Or a set of smart contracts. And so if you're writing a smart contract, it's a good chance you're going to want to have a subgraph for that because it's going to make it a lot easier for you to read the data versus querying an RPC directly, you can use GraphQL to stream that data very quickly into your front end. So that's the first product. The next is

substreams. Substreams is a streaming protocol and what's nice about that is you can stream data uh directly to your own database and then you can do additional things with it, right? So maybe you want to stream um more more deeper data or across the entire blockchain like you want to get transactions, right? Or you want to get um you know, value transfers and wallets and stuff like that. Substreams are great for that because it's literally just a chunk of the entire block and it's composed and then it can be easily parsed uh and placed into other databases um like maybe you want to use ClickHouse, right? Or you want to use some other database. You can use substreams to do

that. Um substreams are So subgraphs are all written in um AssemblyScript. So it's a it's a subset of TypeScript. So it's doesn't have all the functionality of TypeScript, but it's very similar. So if you understand um TypeScript, you can kind of read subgraphs pretty easily. Substreams are all Rust-based. So, it's a little harder to work with, but with in the world of AI, Rust is actually very easy uh to work with. So, if you're using AI tooling, very easy. Um what I will tell you is we're going to be talking about um you know, how you can make how we're going to make it easier for you for AI if you're using AI. By the way, who here is using AI to hack? Just I always like to ask this. Everybody pretty much.

Um So, there's a couple So, if you go to the docs right here uh by clicking this link, it will take you to the docs. And there's a whole section about AI tooling. So, if you come there, you can see that there's primarily two kind of skills that you'll want to have. Uh one is the substreams. Uh okay, we'll we'll we'll get to that in a second. First, let me cover um the MCP MCP servers that we have. So, we have two MCP servers, one for subgraphs, and one for substreams. Um essentially, the reason why you would want to use an MCP server is agents can understand it a lot easier, and they can discover what data they need by just querying

this the MCP server. So, you can kind of think of like the MCP as like a discovery tool. So, if you call the MCP and say, "I'm looking for data about Uniswap." Right? It's going to come back with all the Uniswap subgraphs, and then it's going to make a recommendation for you of which is most likely going to have the data that you need, right? So, it's a very dynamic way for your agent to discover the data. Same thing goes for the subgraph MCP. I've actually never used the subgraph MCP, but I assume it's very similar. The difference is that subgraphs are deployed on the graph network as endpoints. So, they're actual HTTP-based APIs that are GraphQL.

Um substreams are packages, and they're they're streaming packages. So, let's say you build an AI agent that wants to stream data from base mainnet, right? Um you can say, "Hey, I need to use the MCP server to discover a stream for base mainnet that has all of the transactions that it you know in this particular block." It's going to try to find the proper package for you to use, right? So, the MCPs are tools that will either A, let you find out where that data is uh in your IDE, or you can program your AI agent to use them and query the data directly from the MCP as well. So, that's just a preface on why you would use MCPs.

If you're building um an app from cursor or Claude code or any of like IDE and you want to empower your agent or your your coding agent to understand how to work with the graph, then you'll want to install one of the skills. So, if you want to build subgraphs, there's a subgraph skill link right here. You can click that and it will kind of walk you through um all the the the skill for that. And then there's also one for substreams as well. And that is a GitHub repo um that's available as well. And it kind of walks you through uh how to install those. So, depending on what you're going to build, if you if you have questions and you don't know what tool to use, just come find us and we'll

explain to you what you should use um and what tool's going to do the best for you for what you're building. But that's generally going to help you a lot with troubleshooting through the night and like building whatever you need. So, yeah, so check out the skills. Um let me talk briefly about the bounties and and what the graph is looking for because that relates. Um so, we are looking for tooling that will help agents use data coming from the graph. Okay. So, this could be coding agents, this could be front-end AI agents, this could be any kind of AI use case where you were like building some kind of tooling that could possibly be utilized by

developers on the graph network or consumers right? We're trying to trying to figure out ways to make it as easy as possible for agents to discover. So, maybe you build, you know, there's some examples here. Oh, this one doesn't actually have examples. Oh, yeah, it does. You know, a one prompt sub streams deployment flow using the sub stream skills, right? So, this could be like a web interface where you just like put in one prompt and it gives you all the data you need from sub streams, right? So, look through those. Those are some examples. The other stuff is best use case of the graph in AI. So, what that is is you're building a AI agent and the best use case of using the graph for that AI agent, right? So, this is tooling very

specific to helping developers use AI for the graph. And these are actual like consumer AI agent applications like front end applications. And then the very last one. So, there's two here. I don't know why they're split up, but there's full of $7,000. So, five places. So first second third fourth and fifth place for $7,000 total split up. And then there is best use of an composable sub graphs. So, what does that mean?

So, sub graphs are my mentioned it before. They're per per contract and per chain. So, let's say you deploy a D5 protocol across 10 chains. You can create a composable sub graph that sits on top and like brings those all together. So, there's a whole section about that on our docs. And so, this would be the best way of either doing composable or just regular sub graphs as well. So, take a look at that. Again, there's also examples, you know, in here that you can kind of go as a reference for what you're building.

Um, what I to show a demo today using um some other tooling. So, I don't know if people were here earlier, I did a workshop on Scaffold ETH, which is a starter kit for Ethereum. It's really good for prototyping and building on Ethereum, and there's also a sub graph extension for that. Um, but about three or four three months ago, I started building this as kind of an alternative tool. We're actually using some of the packages that come from Scaffold ETH. We're using the components, we're using the hooks, and we're using uh something else I can't remember.

Um, but this is a little more AI native, and what I mean is that um everything that can be done with Scaffold Agent is available via command line uh tools. And so, it's a lot easier way to like bootstrap an application, and the the the end result you get is an AI chatbot. So, you actually get an AI agent. So, we're going to show it off right now. And the reason why I want to show it off is because we have an integration where it will automatically spin up the MCP, and it will also automatically let you consume the graph over X402. So, let me cut just touch base on that real quick.

Who here has heard of X402? Few people. Okay, for those who don't know what X402 is essentially the graph essentially runs on API keys, right? Um, which are actually a little archaic uh in my opinion. And so, one of the initiatives for Ethereum and for just in general is to try to replace API keys with what's called X402. So, for X402 is just a reinvention of an existing HTTP status code 402, that basically has been around since like the '90s, that just says, "Hey, if you want to query this API, you need to pay some kind of amount to get access to it. So, X402 was created by Coinbase to take that HTTP 402 and respond with it like

an object that tells you exactly how to pay over crypto rails. So, it's not necessarily just for Ethereum, but X402 is one of the most popular chains is Ethereum, also Solana. Um but the point is is that we've enabled X402 uh for all of the the endpoints for sub sub graphs, okay? So, this starter kit that I created already has that wired up. So, what you can do is spin it up. It will It's a Next.js application. It also uses Vercel AI SDK. It's automatically going to be hooked up to the subgraph MCP server.

Uh it's going to automatically generate wallets for you and then allow your AI agent to be able to query data over X402 okay? And um the way we do that is by again using X402 and using uh a subgraph MCP server. Now, the subgraph MCP server is open source, so you can run it yourself if you want, uh but we actually are running running it for you so that you don't need to run it. Um and again, it's X402 enabled, so you can make payments over X402. So, we'll let's just try to do that cuz we have like 8 minutes.

And let's see if we can do it. So, I'm going to copy this command, NPX scaffold agent, and we're going to go to a new window here, paste it in. And what you'll see is we get this very similar to Scaffold-ETH. We need to name our project. We'll call it um ETH Lisbon. And now, for this >> [clears throat] >> you don't need to use One Click. One Click is a actually my startup that I'm working on. I built this as part of that. Um but it does key custody for you. So, we use multi-party computation and HSM to store private keys, signing keys, inside of Google Cloud. You don't need to use it. You could use a basic ENV file locally that's encrypted or a just standard ENV which is not

recommended. But I'm just for the sake of the demo, I'm going to use One Cloud to show you how useful it is and to show you how we're going to not even need to have a private key on our machine and be able to sign transactions and pay for services from the graph over X Road 2. So, to do One Cloud, we need an API key. So, we're going to go to onecloud.xyz which is again, it's just you can think of it as a key custody platform. And we're going to generate a key. An API key. So, I'm going to come here to API keys.

Boom. Go here. We'll call it demo. Give it full access. Don't show the key normally online, but I'm going to delete it later. We're going to enter the key now. And it we have to store that API key that it's going to create for us or that we just copied locally, but we want a password protect it. So, we're going to protect it with a password. And then it's going to ask us if we want to generate signing keys inside of the hardware security module. Right? So, this is like the most secure you can be without you storing it on a piece of like like a ledger or something.

So, we'll say yes. It's going to ask you if you want to use ampersand. We're not going to get into that, but that's a 400 X Road 2 payment thing that you could use. I'm not going to use that. It's going to ask us if we want to use the graph. So, we're going to say both MCP server and X Road 2 enabled for agent payments. And we're going to use So, this is where it wants to know what kind of LLM provider you're going to use. So, One Cloud is an LLM provider and we do some LLM security related stuff. So, I'm going to use that, but you could use Gemini, Anthropic, Open AI, whatever you want.

And then it asks us what provider we want to use. I'm going to use Google cuz I like Google. And we're going to use the billing that comes with One Cloud. So, One Cloud can you can also pay for your LLM inference similar to Open Router and you can use any model you want. Um but you can also provide your own provider API key. So, if you had a um Open AI key, you could do that and type it in, but we're going to use One Cloud again to make it easy. We also can run a blockchain locally which we can like simulate and kind of use as a a blockchain.

And we're going to use Next.js. We also support Python and Vite. And then the very last thing, this is kind of interesting, but we're going to force signing inside of the trusted execution environment. So, again, this is infrastructure that's running on Google Cloud. Um I'm just doing it for the demo cuz it's easy to demo and we'll say yes. Um we're going to choose Ethereum and then that's it. So, what it does is it's going to bootstrap a full application for you with a chat interface. It's going to automatically install all of the you need. It's going to install um uh uh uh the Vercel AI SDK and it's going to basically hook up uh your front end to your chain as well if you had a a

blockchain that you ran which we chose yes. And it's going to give us the signing key right here. So, you see right here is a HSM signing key. So, let's grab that public address. And let's go to uh Base Scan cuz we're going to use Base. And we're going to fund this address here. So, it's a fresh wallet. It generated it inside of the TEE. And I'm going to send some funds there. So, let me scan here. Uh let's see.

While we're waiting. It's not a lot of money in there. Got to find a wallet money. Uh let's see about there. There we go. Okay, scan that. And then I'm just going to send like I don't need to send a lot. I'm just going to send like 10 cents. Okay so So I just sent 10 cents in USDC to this brand new wallet again that was generated in the TEE.

And it's still installing the dependencies. Uh while we're waiting for that, I'm just going to split up this screen real quick, go into that folder, and load up this project in cursor. So I was saying earlier, I like cursor cuz it it can I can kind of see what's going on with the the diff as I'm using AI. Some people like cloud code, but I I like to see what's going on. Um and if we look here, we have two ENV files. We have an encrypted one that has our very secret API key from one claw, and then we have this other ENV which just has like public information, and uh all the information that came back, what what model I want to use, how what kind of billing. This is automatically generated when you

bootstrap. And there it goes, so it's done. So now all I need to do is run this one command, just quick start. So we're using um in the scaffold agent kit, we're using uh just, which is very similar like yarn, where you say yarn whatever. Um but it's called just, so you need just installed, so you'll need to install that. But let's go into that folder real quick, and just run it. So this one command is going to run a uh a front end, a chain, and uh use the faucet to deploy some funds.

It's going to ask us for our password for the vault or for the uh the local um thing here. And then just going to ask for the password to start the front end, okay? So, then we get this Next.js application here. And I only have 2 minutes, but it should work now. Because I've sent the funds to already. I already sent 10 cents, and I'm going to be able to ask one question about a DeFi protocol here. So, this is what we get. Very similar to Scaffold-Eth. It has like some tabs for like debug contracts. It has a faucet. It has a wallet connector for your agent or for your human, right? So, you could like disconnect.

And you can connect with the burner wallet we use. Oh, that's the other thing. We use Scaffold-Eth burner wallet. And then all we need to do is say, "Give me the last five swaps on Uniswap V3." And hit enter. And fingers crossed it works. And we're going to query this data from the graph network and pay over XPR 2 using that wallet. And again, you could just use your own wallet locally. You could generate one and save it in the ENV file if you wanted as well. Oh, great.

Let's see if we can uh get it to work it. It should have funds though. Did it go through? Yeah, it has 10 cents. No, no, no, no. We don't want to use that. Um Let's see if I can figure it out. I don't know why it didn't work, but it should have worked. Um but essentially, you can see here that we didn't need to put in an API key for the LLM because we're using one claw for the LLM stuff. Um we didn't need to save a private key anywhere. Again, we

generated in the TE. The agent technically has a wallet, so we can be like, "Hey, what is your public address?" And it should give it give me its public address. And I know we're at time, so No, no. It's not working right now. I swear I did this demo yesterday and it worked fine. >> [laughter] >> Um So, well, it is working here, but Yeah, okay. Yeah, sorry it didn't work, but essentially this is a good starting point for you that if you are building an AI agent,

um check that out. Again, NPX scaffold-agent. And again, it will give you that option to to use the graph automatically. Um if you want to just build from scratch, use the Subgraph MCP or the Substreams MCP server is going to help you a lot. And then again, add the skills for subgraphs or for the Substreams into your IDE. And if you have questions, just go ahead and stop by and ask us. And I'll be around if you have more questions after this workshop. So, thank you so much. Sorry that the demo didn't work. >> [applause]

Related talks