This SEO Ai Agent team generates articles in seconds (no code)

Rory Ridgers builds a no-code system that generates complete blog posts in seconds: keyword research via DataForSEO API, article drafting with an LLM, AI image creation, and logging to Google Sheets. The workflow costs about $0.05 per article and can connect to WordPress or Webflow.
Chapters
What's up guys, in this video I wanted to go over an SEO agent system that I built that can create a completely unique blog post from start to finish, including images and keyword research and everything else you would need. As someone who has a background in digital marketing, I know writing an article isn't as simple as just thinking of an idea and then sitting down and writing an article about it. There is a lot more that goes into it, including competitor research, keyword research, keyword analyzation, generating images, and there's also things like word count, H1s, different paragraphs, everything like that. So I built this full system that covers all of that. As someone who has a background in digital marketing, I know what it's like. So I built a system to basically do everything from start to finish. Just quickly, if you haven't seen me before, my name's Rory Ridgers and I help business owners to integrate AI agent systems into their businesses. So if that's something you might be interested in, I've left a link to my website in the description. You can go ahead and book up a call and we can talk about some ways to integrate AI into your business. Let's not waste any more time. Let's get into the video and I can show you how this system works. Okay guys, so we're in NAN now and this is the full system laid out and I've kind of labeled each part of it so you can see what's going on. So just to kick things off, at the beginning here we have keyword research, and basically what's going to happen is we're going to input a topic that we want to write an article on. So this might be something like AI in healthcare or AI in education, for example. And then the keyword generator is going to generate a list of keywords, it's going to format that data, and it's going to send it off to a, uh, Data for SEO API. It's called Data for SEO, and basically what that allows you to do is scrape a bunch of keywords and get all the relevant information you'd need, like monthly search volume, cost per click, uh, SEO ranking difficulty, everything like that. We get all of that data back and then we'll basically go through that and sort of determine what the best keyword to pick is. Because when you're writing articles, it's usually best to just focus on one keyword or one key phrase rather than trying to jam a bunch of them in there. So in the system, it will go through, look at the best one based on a set criteria, and then pick that keyword to target later on. And then the next section we have here is actually writing the articles. So we have that pick keywords uh, LLM step, which I just told you about. And then we have an LLM that's going to plan the blog. So it's gonna take the topic that we inputted and then also the keyword that we're targeting. And it's basically gonna map out a blog post or an article, sorry, that we can write later on. And then we pass that plan to the next LLM step here that's actually gonna generate this entire blog post based on the plan, based on the keyword that we're targeting. It's gonna generate an entire blog post with everything you need in there. H1s, different paragraphs, bullet points, everything like that. And then basically what we have here is a little sort of system that is essentially going to be able to send this over to us, have us approve it or disapprove it. And if we disapprove it, we're going to be able to give it feedback. So for example, it might send over the article and then it's sort of too long or it's too short. Let's just say it's too long. Once it sends over, we can just reply to it saying it's too long. Can you keep it below 1,000 words, let's say? And then basically it's going to go through like this, wait for approval. We disapprove and it's going to send us an email, say what was wrong with it. Then let's say it was, uh, too long, keep it below 1,000 words. This step here is going to fix the article and it's going to send it back and it's going to send it to us again and wait for a response. So again, it's going to send us the new one and then it's going to say like, is it good now? And then you can approve or disapprove. And obviously, hopefully it'll be better that time so you can approve it, but if not, you can just disapprove and say no, again too long, I actually want it below 750 words. And it's just going to keep going round and round in a loop basically until you click, um, approve. So until you're happy with it, just going to keep going around. You can keep editing it as much as you like. And then the next phase we have here is generating an image for this blog. So it's going to take the article that you're happy with, the finished article, and we're going to pass that over to an LLM. It's going to create a detailed prompt for this. And then this system here, all it's doing is just generating an image and then getting us a link for that image so we can actually, uh, see it. And then pretty much the same thing that's happening here, it's going to send that image over and say, hey, this is the image that goes along with that blog. You do you like it, do you want to change it? And obviously if you like it, just hit approve. If you don't like it, you can hit disapprove, and then it'll ask you what was wrong with it. You could say, for example, um, I want to make it more realistic, or I want to have text on there that says this. And then this step here, it's just going to take the original prompt, look at the feedback you gave it, rewrite the prompt, and then again it's just going to loop over and generate that image again. And same system as before, you just keep going over and over again and iterating it until it's exactly how you want it. And then, uh, simple one at the end, we just have add to sheet. It's just gonna add all of this data to a Google Sheet. Now you could post this to like WordPress or Webflow or wherever you're hosting your website, but just for this demo, we're gonna be putting it into a Google Sheet so you can sort of see it all laid out. And I don't actually have to post this blog anywhere, but of course, like I said, you can, um, link this up to your WordPress, your Webflow, your Wix account, whatever it might be. And you can just have it automatically post this because you've already approved each step. It's not just sort of, um, going off on a limb and hoping you'll like it and hoping it is going to be what you want. You've approved each step, so in theory you can just have the, um, agent or the system just post this for you. Okay, so we're going to have a deeper look into each step here. You can see a lot of these are sort of LLM steps, and these are absolutely vital for this system. The prompts are playing a massive part in this system. Your prompts really need to be dialed in for a system like this, because apart from sending it over to us, generating the images and then getting the data for the keywords. It's pretty much just all LLMs, and there's lots of different LLM steps in here, and all the prompts need to be pretty much perfect, otherwise the system isn't gonna give you the outputs that you like. So to begin with, we just have a chat message where, like I said, you'll say something like, create an article for me on AI in education. And then we have a keyword generator here, so we pass it the topics, and this is the prompt we've given it. So if we have a closer look in, it says, you're an expert at generating keywords for SEO articles. You'll be given a topic, and I want you to generate 15 keywords for each of them that can be used to target in an SEO article. Here are some of the info on how to generate the best keywords. And I've just given it sort of a criteria here on the different things to look for. So understanding the audience, use variations and synonyms, uh, think of questions, break down your idea, use context and trends, uh, focus on a mix of long-tail keywords, so 4 to 5 words, as well as short keywords, 1 to 2 words. If you don't know the difference between, uh, long-tail keywords and short keywords. I mean, it kind of says it there. The long-tail keywords are usually sort of 4 to 5 words long, can be a little bit longer. And the short keywords are just going to be, say, AI education would be a short keyword, and then a long-tail version of that might be struggles of implementing AI into education, something like that. And the reason you differentiate on the keywords that you want to target, in this case whether it's long-tail keywords or short ones— usually the short ones are going to have a higher search volume than the long-tail keywords, but that just means if they have a higher search volume, they're going to be harder to rank for. So it really depends where your site's at. If it's a fresh site, brand new site, I'd recommend just really going for those long tail keywords and keeping the search volume sort of between 100 and max 500. And then if you've got a website with a really high domain authority, let's say you've been posting loads, you've got loads of backlinks, your website's doing really well, it's really healthy, then you go for those more short keywords, have sort of 1,000+ uh, monthly searches. So yeah, yeah, anyway, this keyword generator is going to generate a bunch of keywords, so we get to do a mix of long tail and short keywords, and then we can differentiate later on which ones we're actually going to target in there. So this is going to output to us a bunch of different keywords. It's going to output 105, and I'll show you why it does 105. And then we have to format this data, and all we're doing here is formatting this data so we can send it over in the API. And you can read the prompt here, it's pretty boring. It's pretty much just telling the LLM how to format it, so it formats it like this to get ready to be sent over as a JSON body. So it just has to be this— well, that's technically not valid JSON, but, um, able to be able to slot into a valid JSON request that we're going to send off. So it'll make sense when we look at it. The next step is going to be the actual API request to what's called Data4SEO, which is where we're going to get our keyword data. So if we come over to Data4SEO, this is the platform here. You can set it up. I do think you get some free credits in here, so you get some free funds. I'm not too sure how much it is. But then after that, it's not a monthly subscription. You just have to top up your balance as you go along. The minimum you can top up is $50, so do be aware of that. Once you've used your free trial, the minimum you can do is $50. I've already just put $50 in there. That $50 will last you quite a long time, by the way. So once you put that in there, you shouldn't have to worry about it too much. Anyway, basically what we're going to do here is we're going to go to documentation, and the exact API endpoint that we need to use is going to be search volume. And then task post. So this is what the endpoint looks like. And basically this, um, Data4SEO is just going to be drawing data from Google Ads, which is just going to be all the different, um, keyword data. So like I said, things like monthly search volume, average cost per click, average ranking difficulty, all of that kind of stuff. That's what it's going to be scraping. And anyway, we put in this endpoint URL, we put it on our HTTP node put down this endpoint URL in here. Then if we come back over to Data for SEO, you can see the curl, and this is what we're actually going to be sending over. So we got two different headers, we got authorization and then bearer API key, content-type application/json. Pretty standard for API. So we've got an authorization, API key, content-type application/json, and then this is what we're actually going to be sending over. So it's quite simple stuff, it's just location name and then the keywords, but you can see how these keywords are formatted That's how we need our keywords formatted. That's what the step before was for. So we basically just sent over the location name. You know, I've just done it as United States. You can do whatever location you want. I've just left it as a US. So basically we copy that, put that over into NAN. I've just left the location name, as I said, to United States. And then the keywords in here, we put in the variable that we get from here, and it's going to be 105 keywords. And the reason we do 105 is because with this Data for SEO API, the way they charge you, it's kind of weird. It's just per request. So it doesn't matter how many keywords you put in your request. If you do 1, it's going to charge you exact same as if you did 10 or if you did 50. And the max you can do is 105. So it makes the most sense to get our money's worth, put in 105. It's going to charge us the exact same as if it was to do just 1 or 10, for example. So that's why we do 105. So we send over these 105 keywords, and then what we do is we add a wait node, wait for just 20 seconds, and then we do another HTTP request And what we're going to do here, really, really simple, which is going to be getting the data that happened here. So this one's task_post. We're going to go to task_get, put in this endpoint URL along with our ID, and we'll get the ID from this step here. So this step here is just pretty much going to say, yep, I've started the task, it's going to give us an ID, and then we have to wait for that task to actually run. And then we do another HTTP request using that ID to just get the data from that run. So 20 seconds might be a little bit over the top. I usually just highball it just to be sure. You don't want to, um, sort of not wait long enough and then break the system here and not get through any data. So just eyeball it, do 20 seconds, and then, um, yeah, this step is just going to get all the data from those 105 keywords. And then we just do edit fields and we set that data to be called keyword data just because it's a little bit easier to handle. And then what we do is we go over to another LLM step and we're going to be picking the keywords here. So if we go into this one, giving it the data that we got from here— and something to note here as well it's kind of weird. You need to do an expression here where you stringify the data, because when the data gets passed through in this step here and then we set the field, it's going to be passed through as an array of objects. And you don't want an array of objects because when you pass that over to an LLM, if you put in the variable here and then you show up sort of what the AI actually sees, it's just going to say object, object, object. And obviously that's no good because the AI, you can only see objects. So what you need to do is you just need to what's called stringify it. And just turn it from an object into a string. And it's basically, rather than an object, it's just gonna be a massive chunk of data, just loads and loads of lines of data all in one go. And it means the LLM can actually read it. So this is the expression. This is what it looks like. You just add in stringify there and then your actual variable. Anyway, this is the prompt that we are using. So you're an expert at data examination. You'll receive a long list of SEO data on 105 keywords. I'm not gonna read out this entire prompt to you, but I'll just give you the general gist of it 'cause it's quite long. Basically what it's doing is it going through there, and when it comes through, it comes through in groups of 15. And what we want it to do is look at each group, and from each group, pick the best keyword. So in each group, there's going to be a best keyword based on our criteria. We say in the— how many groups is there? There's going to be 7 groups, 7 of 15, 105 keywords. Out of all 7 groups, pick the best keyword from each one. So you should have 7 keywords and their data. And then out of those 7, basically just pick the best one. So it's just a way for the LLM to sort of break it down into more manageable tasks. We don't actually see any of this because we prompt it to, um, just output the one keyword rather than giving us all the 7 and all it's working out and everything like that. We just say output the one that you're actually going with, but in the background it's going to be thinking about breaking it up into the different sections, picking the best one from each, and then picking the best one out of those 7, if that makes sense. And then these are all the, um, criteria that we're basically telling it to look for. So search volume good, Keywords with consistent interest and reasonable number of searches. They should indicate that people actively search for them. Bad keywords are very little or no search activity. And you can kind of see what we're doing here. So search volume, cost per click, competition, relevance, intent— that's basically what we're getting it to look for. So after this, it's going to output one keyword and then all the SEO data for that. And if we come to Plan Blog, we basically just give it that keyword with the keyword data and And then again, we've got another big prompt to this. I'm not gonna read you out the whole thing, but you can pause the video, look through it if you like. Well, basically it's just a massive prompt on what to look out for, how to plan a blog, everything it needs to include. And it's just gonna give us a plan for a blog in sort of bullet pointed sections for each one, what to include, how to write it, the tone of voice, everything like that. So we're consistent and actually writing good blogs in the next step. And then Article Generator. We give it that entire plan, and then again, massive prompt. I'm not going to read you the whole thing, but I can just scroll through it like this and you'll get the gist of it. So we're just giving it sort of a general of how to write these blogs. So main body, H2, and another H2, breaks down subtopic into easily digestible paragraphs, H2, and section from title plan. So we're kind of just feeding in the plan and just making it fill in all the gaps and write an actual article here. So now we should have an actual article. And then we get into the sending this over and having us review it part. So what we do is we edit fields and we put in the data from here, and we just call that, um, article. You'll see why we do that in a second. Then what we do is we just have a Gmail send message and wait for response, sending it to myself. The title is New Blog with an exclamation mark, and the message is just that entire blog. And then what we do is a response type approval, type of approval, approve or disapprove. So basically, if you don't know what this node does, by the way, it's going to send over an email to us and then it's just going to wait until we've looked at it and given a response. And at the bottom there'll be two buttons, in this case saying approve or disapprove. And this node is just going to sit there and wait and not continue the scenario until we click a button. Then when we click a button, it's going to send it back to an— and it's just going to pick up where it left off in the scenario. So we've got approve or disapprove, or approve and decline, sorry. So it's going to send this over, we're going to say yes, that's good for approve, or no, want to change it, we hit decline, what we do is we have a switch node to basically say the output of this, if it is false or if it's true. If it's false, it means that we declined it. If it's true, it means we're good to go and we can just carry on. So if we look, if it's true, we just go on to the image generation. But if it's false, we declined it, we send over a follow-up message to me again saying what was wrong with the article, and basically just saying, hey, can you give us some feedback on what was actually wrong with this article? Capture that response, because again, this is a send and wait for message. So It's a send and wait for response, and this time it's just gonna be free text. So we just send over a thing and there'll be a little text box at the bottom and you just type in there what, um, in this case, the feedback for that article was, what you thought was wrong with it. Let's just say it was too long. It would send that back, capture that response, and then we just have an LLM step here. We give it the feedback, so too long, let's say. And then we give it the original article as well. And basically what we're saying is just rewrite this entire article, keep same tone of voice, same everything unless told otherwise. And just, um, make whatever changes they wanted to make. So if they said it was too long, make it a bit shorter. If they said it was too short, make it a bit longer. And yeah, you get the gist. And then basically the output of that comes back to these edit fields, and then we just put in the, uh, json.message.content, which is going to be the output from this one. And again, just name the variable article. We do that so that in this step here we can just use json.article. So it means whether it's an output from this step or an output from this step is gonna be json.article. And what that allows us to do is have a consistent loop. So every time, let's say it comes through, we disapprove, we say what's wrong? Say it's too long, rewrites it, comes back, we rename that variable as the same as this variable, and then it'll just keep going again and again. So that's how we create these little loops in. And then anyway, let's say we changed it and now the person likes it. We're gonna come down to prompt generation. All we're doing here is we're giving it the entire blog post, the good one, the one that was actually approved. And this is the prompt. Your job is to take the full blog post and generate a prompt for an image to go along with it. Make the prompt descriptive and fully encapsulate the essence of the blog. Hope you like that. Output just the prompt. Don't use punctuation like, uh, speech marks or apostrophes, anything like that. And the reason we say that is because in the OpenAI API step, it just doesn't like it. So don't use that type of punctuation. And then again, same deal here, we have an edit field step which is going to be doing— spoiler alert— the exact same thing as this one. It's just going to be renaming these variables and So they're the same, so we can use it in this step. And then we have OpenAI image generation. So we're just connecting to OpenAI and using their new actually good image generation model. So we put in this endpoint, content type application/json, authorization our API key, which you can get from the OpenAI platform. And this is the body that we're sending over. It's just going to be model. This is the model, the prompt, which is going to be the output from that LLM step. And then you can change the size and stuff, but I've just left that as it was. It's going to generate us an image. It is going to be an image, but it's just going to come through as sort of a jumble of letters and numbers. I mean, absolutely nothing to us. So what we do here is we move base64 string to file. So basically all that means is the data from here, we're going to be converting that into an actual legitimate file that's going to contain the image. And then what we do is we upload that to Google Drive. This way we can get a link for it, so we get a web view link where we can sort of preview the image. And then we have an edit field step, again just for sort of easy data management. That WebView link, we're just going to rename it WebView link so it's just easier to manage later on. And then we have a Gmail send message and wait for response, and this is going to do the exact same thing as a blog post except for this time we're going to be sending over the image link. So we're going to be using json.webviewlink, and then same thing as a blog post except obviously it's not sending us a blog post, it's going to be sending us the image for that blog post. And exact same deal, it's going to be, uh, I didn't show you, but it's going to be approve or decline. If they hit approve, it's going to go over to Google Sheets. If they hit decline, we're going to come in here, and we've already set these up. So if it's false, if it's true, if they hit decline, it's going to come here, and then we're going to send over a message saying what was wrong with that image. And then again, it's going to be free text, so they can say, I don't know, uh, it wasn't realistic enough, make it ultra realistic, something like that. And then we're going to pass that over to the Fix Blog Image node. And what we do here is we pass through the original prompt, and then we pass through the feedback, and we just say adjust the prompt because it can't adjust the actual image. We just have to regenerate the image, so it just adjusts the prompts. Let's say we wanted it to be more realistic, it might just add to the beginning of that prompt, make it ultra realistic, and then just do the original prompt after that. And then that's going to get sent back here. We're going to rename the output of that to be the exact same from this, so this step doesn't know whether it's an output from here or here, which is again going to create that nice loop. Oh, and by the way, we add in a wait node just because I found that I was hitting rate limits through the, um, OpenAI API. I guess it's for like the image generation model, it can't handle it. So I just added in a little 20-second wait node. Um, yeah, yours might not do that, but mine was doing that, so I just added in a wait node. And then we just have a Google Sheet node, and we're just going to map all of that data into the Google Sheet. So article is going to be the article from this step here, because last time we went through here would have been when it was approved. So it's going to be this step here. Image, and then image is going to be this step here, because the last time we went through this was when it was the correct image because it means it went straight through. And then the SEO data is going to be from this step here. When we pick the keyword, it's going to output the keyword along with all the SEO data. And then in our Google Sheet, we would get the full article, the image link, and then the SEO data for the keyword that we were targeting. So a lot of talking, we're going to test this out now and we can see how it works. I just hit open chat and then let's say something to it like, I want to write An article on, uh, AI in engineering. Let's say I wanna write an article on AI in engineering. We're gonna send that off and this is gonna take a sec. So I'll just come back to you when a couple of these are finished and we can sort of walk through them together. Okay. I take that back. While this is running, we'll just walk through what's going on here. So the keyword generator outputted all of these different keywords here. You can see some a little bit longer. These are a little bit longer. AI-driven engineering solutions. They're all sort of around 4 words, and it's chucking in some of the longer ones, some of the shorter ones as well. So this one, AI engineering, would be considered like a short, uh, keyword to target there. And then format data, just formats it like this. Doesn't look formatted here, but it is formatted, trust me. And then we send this over to Data4SEO, and you can see here status message is okay, time, cost. So this cost me 5 cents for this run, cost literally nothing at all. Uh, and then task, we get the ID here, wait for 20 seconds, and then pass it over, get all of this data back here. So we put in the ID, and then this is all the data we get. So keyword, AI engineering, spell, location code, don't need to worry too much about that. Uh, competition low, competition index, search volume, low top of page bid, high top of page bid, cost per click, and then all the monthly searches for the past, I think, year or so. So absolutely perfect. Edit fields. Pick keywords. It's just going to pick the keywords, and it looked like it picked AI and engineering. Perfect. And then plan blog. It plans out the entire blog here. You can see it's quite long, which means this should be pretty detailed. And then this is the entire blog here, again pretty long. And it's gone through, edited the fields, and then you can see now it's sent over an email to me and it's waiting for my response. So this is the full blog here. We're not going to read through the whole thing, but let's just say— let's scroll to the bottom. And let's just decline it. And then this happens quite quick. If we hit decline, you should see we'll get another email through. So yeah, another email through. What was wrong with the article? Zap. It happens quite quick, which is nice. And then let's say to it something like, it was too long. So just a simple one. Let's say it was too long. Come back over here. You can see it's gone through. It's got our message here, which was, it was too long. And then we pass that over to our agent here, which is going to rewrite this, hopefully a little bit shorter. It's going to ping back around, send it back over to us, and we can review it again. Okay, so sent that back over and you can see it's a little bit shorter, which is nicer. So we're going to hit approve, come back over. See, it's approved. So it's gone this way now. We've created a prompt. So futuristic engineering workspace showing diverse engineers collaborating with advanced AI systems, including robotic arms, yada yada yada, whole prompt there. Perfect. Edit field, send that over. And this step does take a second, so we'll come back when it's done. Okay, so it happens quite quick, these parts here. This one takes a second. If we look at the output here, uh, if we go to show data, probably won't even load. Okay, yeah, so this is what we get through, means absolutely nothing to us. And then we convert that into a file here, and then we upload that file to Google Drive, and then we should get, yeah, a web view link here. And then it sends it over to us on Gmail. Okay, so this is the email we get. We do have a link here, but also just appears at the bottom of the email because it's a Google Drive link. So if we open this up, this is what it generated. I mean, looks pretty nice, but let's test it out. Let's hit decline, and it should send us something over saying what's wrong with the image. So yeah, we just got this email. What was wrong with the article image? Uh, give us some feedback. So response, let's say I want it to be ultra-realistic. Spelled realistic wrong, but it shouldn't matter. Okay, so you can see this, uh, reworked the prompt. So an ultra-realistic futuristic engineering workspace, yada yada. It's pretty much the same prompt but it's added an ultra realistic. So that's going to regenerate this image and we'll see what it outputs. Okay, so it's gone back around, it's passed it to the Edit Fill step, and we've just renamed that variable to be the same as this one here. So when it passes through, it just does the new prompt and we don't actually have to change the prompt in this step at all, if that makes sense, because the variable is the exact same, it's just got different data in it. Okay, now those steps have run through again, and now again it's waiting for us on Gmail. If we come over to Gmail, this is what it sent us, pretty much just an ultra realistic version of the first one we had. So absolutely perfect. Let's hit approve and it's going to run through the rest of the steps. Okay, then because we hit approve, the switch node took it this way, added it to the Google Sheet. If we come over to Google Sheets, this is what it's given us. So the entire blog post here, the image, which is the one we just looked at— hold on— the one we just looked at there. So perfect. And then the keyword that we're actually targeting, so AI engineering. And then all of the data here. So the monthly searches, month on month with the cost per click, the competition, competition index, everything like that. And then the actual blog post here. So absolutely perfect. Pretty much ready to just be posted on your website. So yeah, absolutely perfect. Really cool system. And of course you can have this set up on some kind of timer where it's just generating your blog posts like every other day or every week, something like that. But for the purpose of this video, I wanted to be able to actually prompt Okay, so that is it for the video, guys. I hope you enjoyed it and hope you learned something. I know this system will help a lot of business owners that are struggling to keep on top of SEO and writing SEO articles. Actually built a similar system to this for a client not too long ago, and it helped him out massively, and now he uses it for his clients as well. And as I said, because I'm someone who has a background in digital marketing, I know all the different things that go into creating one of these SEO-rich articles and how to get it to actually rank. So I kind of built the system around that. Like I said, if you did wanna work for me so we can implement an AI agent system into your business, go to the link in the description and you can book up a free call with me. We can talk about some ways to integrate AI into your business. That's it for this video, guys. As always, if you've got any video suggestions you'd like to see, just drop 'em in the comments and I'll try my best to get around to doing.
More from Rory

Dynamic Workflows are crazy. This is how to actually use them (beginner's guide)










