Enhance your programmatic SEO with RAG applications

Mo Abdelhady profile picture

Mo A. Abdelhady

October 7, 2024

Workflow highlighting how to use RAG to build a content generation and repusposing flywheel.

Introduction

Programmatic SEO is a marketing strategy that is used to improve the visibility of a website or web page in search engine results pages (SERPs). This is achieved by generating 100s or even 1000s of pages that are optimized for specific keywords and phrases. This can be achieved by using a variety of tools and techniques, such as keyword research, content optimization, and link building.


In this post, I will demonstrate a quick experiment to verify that RAG applications could be useful for programmatic SEO. I started with a brand new website targeting a semi-popular niche in a certain geography.

Workflow

The main RAG workflow involved in developing such an application is:

  • Loading / ingestion of all the source material and original content
  • Transformation / pre-processing of the content into chunks
  • Embedding the chunks of text using a small or an open-source embedding model
  • Storing the index to save time and $ money (I stored it locally, no need for a vector database)
  • Building a query engine that can generate the main skeleton of the post (customized system prompt)

To learn how you can build a full RAG applicaiton using llama-index, check the previous post.


Once the RAG application is built, it is time to put it to work. The main goal is to repurpose the source material, no matter how big or small, into more interested, engaging, and targeted articles. For example, if I have some source material regarding a specific product, I would generate multiple posts that target different aspects of the product, such as "Best .... for beginners" or "What is the difference between .... and ....." type of posts.

Note that I customized the system prompt to already influence the content to be more SEO friendly.


Once the main skeleton of the post is generated, the next step is to expand on it a bit more and create SEO friendly markdown file for the actual post, as well as, the metadata that should accompany it. The final step is to connect the generated articles to any CMS (I used airtable) to serve the data to your website.

Experiment & Results

I started with a brand new website targeting a semi-popular niche in a certain geography. Then I collected all my content into a single page and deployed it, it was not a shock that this strategy did not work out so well. The website barely got a few impressions each week.

I used the workflow described above to generate around 20 posts targeting different aspects of the topic. I used the same source material for all the posts, but the generated posts were different in terms of content and structure.


I deployed the new posts, updated the sitemap, and waited for the results. The results were astonishing, the website started to get more impressions and clicks. The website was now getting around 1000 impressions in a single day!

The result of applying RAG to content repurposing for programmatic SEO and leading to my website getting 1000 impressions each day!



I used the following resources to learn more about programmatic SEO:

  • https://www.semrush.com/blog/programmatic-seo/
  • https://www.searchenginejournal.com/programmatic-seo/395233/