Free and Low-Cost Automation Tool Stack

Automating Keyword Clustering with Free NLP Libraries and GitHub Actions

If you are a solo marketer running your own SEO stack, you already know the pain of manual keyword grouping. Exporting a thousand keywords from Ahrefs or Semrush, then dragging cells around in Google Sheets is soul-crushing work. Worse, it introduces human bias and inconsistency. The solution is not a paid enterprise tool that costs as much as your monthly rent. It is a serverless, open-source pipeline that runs on free tiers and delivers deterministic clusters with no GPU required. This is the kind of automation that scales from a side project to a full site without asking for your credit card.

The core idea is straightforward. Use a lightweight natural language processing library to compute semantic similarity between keyword vectors, then apply a graph-based clustering algorithm. Run the entire process inside a GitHub Actions workflow triggered on a cron schedule or a push to a YAML file. No dedicated server, no database, no monthly subscription. Just a repository, a few Python dependencies, and a token for an optional embedding API if you want to squeeze out marginal improvements.

Start with the data layer. You need a clean list of target keywords. Export from your favorite tool as a CSV with a single column, or pull them directly from the Google Search Console API via a free code snippet. Store the CSV in a GitHub repository under a `keywords/` directory. The workflow will clone the repo, read the file, and process it every night. If you want to get fancy, set up a scheduled automated export from your SEO tool using its webhook or Zapier free tier, and push the file to the repo via a simple REST call. That gives you a zero-cost ingestion pipeline.

Now the heavy lifting. The Python script loads the keywords, strips whitespace, lowercases everything, and generates embeddings. For maximum frugality, use the `sentence-transformers` library with the `all-MiniLM-L6-v2` model. It is small enough to download in under ten seconds and runs on a CPU core in a GitHub Actions runner. The embeddings capture semantic relationships: “cheap running shoes” and “budget athletic sneakers” will land close together even without exact lexical overlap. If you have fewer than five thousand keywords, the free runner memory is plenty. For larger sets, chunk them or switch to a lighter model like `distiluse-base-multilingual-cased`.

Once you have a matrix of embedding vectors, apply affinity propagation clustering. This algorithm does not require you to pre-specify the number of clusters, which is perfect when you have no idea how many topical groups exist. It works by sending messages between data points until a set of exemplars emerges. The result is a dictionary mapping each keyword to a cluster label. Alternatively, use HDBSCAN for density-based clustering that handles noise well, but affinity propagation runs faster on small to medium datasets and gives more interpretable labels.

After clustering, the script outputs a simple JSON file with the cluster assignments and a CSV with an added `cluster_id` column. Write these files back to the repository in an `output/` directory. The GitHub Actions workflow then commits and pushes the results automatically. You now have a living document of keyword groups that updates every time you add new keywords to the input folder. No manual intervention. No broken spreadsheets.

But the real power is in the secondary automation this enables. With a structured list of clusters, you can trigger downstream workflows. For example, use another free action to generate a content brief from each cluster’s top terms using a language model API like GPT-4o-mini (costs pennies per run). Or pipe the cluster JSON into a Jekyll static site generator to create a keyword silo map for your site architecture. Or feed it into a custom Python script that cross-references cluster IDs with existing URL rankings to identify content gaps. Each of these is a small, composable micro-automation that runs for free on GitHub’s generous public repository minutes.

One critical detail to avoid breaking the bank is managing the caching of embeddings. The `sentence-transformers` model files are about 90 MB. Downloading them every run wastes time and counts against your runner’s bandwidth. Set up a GitHub Actions cache keyed on the model name and the OS. The first workflow run downloads and caches the model; subsequent runs load it from cache in under a second. Similarly, cache the keyword embeddings themselves so you only recompute when the input changes. This keeps the workflow under the free tier’s sixty-minute monthly limit even if you run it daily.

For solo marketers, the biggest win is not the money saved. It is the elimination of cognitive overhead. You stop thinking about which keywords belong to which bucket and start thinking about which clusters to target next. The tool becomes a second brain that reorganizes your keyword universe every night while you sleep. When you open your repo the next morning, a fresh cluster map waits for you, ready to inform your next piece of pillar content or internal linking strategy.

This approach also future-proofs your process. As your keyword set grows from hundreds to tens of thousands, you can swap the clustering algorithm for a more scalable one, or replace the local runner with a free Google Colab session triggered by a webhook. The architecture is modular. The core loop—data ingestion, embedding, clustering, output—remains the same. You never get locked into a proprietary tool because every component is open source and runs on infrastructure you control.

The only real investment is fifteen minutes to set up the repository, write the two script files, and configure the workflow YAML. That is time well spent for anyone who values their sanity and their keyword research equally. Stop grouping keywords by hand. Let the machines cluster; you cluster the strategy.

Image
Knowledgebase

Recent Articles

Earning Unlinked Citations Through Open-Source Infrastructure Play

Earning Unlinked Citations Through Open-Source Infrastructure Play

The typical playbook for bootstrapped SEO is a grind of guest posts, digital PR, and hyperlocal link bait.But there is a quieter, more technical path that most startup marketers overlook because it lives outside the marketing department: contributing to the open-source libraries, frameworks, and data protocols that your product already depends on.

F.A.Q.

Get answers to your SEO questions.

Can I really compete for high-volume keywords with guerrilla tactics?
Not head-on. The guerrilla approach is to “skate to where the puck is going” by targeting adjacent, lower-competition queries that indicate high commercial intent. Focus on long-tail keywords with modifiers like “how to fix,“ “alternative to [X],“ or “[tool] vs.“ These often have higher conversion potential and are easier to rank for. You build a fortress of content around the core topic, eventually earning the authority to compete for the broader head term.
How Do I Perform Competitor Analysis Without Expensive Tools?
Adopt a “manual intelligence” approach. Use `site:` and `intitle:` search operators to reverse-engineer their backlink profiles and top pages. Analyze their page source for meta structures and schema markup. Google’s “Related:“ operator (e.g., `related:competitor.com`) reveals their competitive landscape. View their sitemap.xml (often at `/sitemap.xml`). Use free browser extensions like SEO Meta in 1 Click for quick on-page audits. Guerrilla analysis is about focused, manual digging for specific tactical insights, not broad, expensive dashboard data.
How Can I Use Performance Data to Find “Quick Win” Keywords?
Forget broad terms. In GSC’s Performance report, filter for queries with decent impression volume but a low click-through rate (CTR). These are often long-tail, question-based, or informational keywords where your page is seen but not compelling enough to click. Guerrilla tactic: swiftly optimize your page’s title tag and meta description for these specific queries to dramatically boost CTR and steal traffic with minimal content overhaul.
How can I fix duplicate content without 301 redirects?
Implement the canonical tag (`rel=“canonical”`) strategically. Point all duplicate or similar page versions (e.g., `?sort=price`, HTTP vs HTTPS, www vs non-www) to your chosen canonical URL. This consolidates ranking signals without the server load of redirects. For internal duplicate content (like paginated series `page/1/`, `page/2/`), use `rel=“next”` and `rel=“prev”` tags. For scrapers stealing your content, aggressively use the `rel=“canonical”` on their site back to yours—some platforms will respect it.
How do I pitch my viral social content for backlinks?
When your content gains social traction, proactively but politely inform relevant bloggers, journalists, or industry sites. Your pitch isn’t “link to me.“ It’s, “My data-driven analysis on X is gaining significant discussion on [Platform], and I thought it might add depth to your recent piece on Y.“ Frame it as a value-add for their audience, leveraging social proof as validation of its relevance.
Image