The Problem I Was Trying to Solve§

Managing internal linking, competitor audits, and content updates across a scaling site with hundreds of pages is extremely labor-intensive. Most SEO tools flag errors but do not fix them. We wanted to build an Agentic SEO pipeline that periodically crawls our web pages, runs SEO checks, extracts keywords, and automatically injects contextual internal links into blog posts without breaking the page layout.

Our deployment pipeline consisted of:

  • Supabase storing our site index, page content markdown, and outbound click logs.
  • A custom crawling script built in Node.js.
  • Gemini 2.5 Pro as our semantic audit engine.
// Contextual internal link lookup schema
class LinkSuggestion {
  constructor(anchorText, targetUrl, contextSentence) {
    this.anchorText = anchorText;
    this.targetUrl = targetUrl;
    this.contextSentence = contextSentence;
  }
}

Step-by-Step: What I Actually Did§

1. Site Crawling: We wrote a crawler that fetches our database of published blog posts and extracts the clean text. 2. Semantic Linking Analysis: We sent the post content to the AI agent alongside our product target list. The agent identified keywords (like "Model Context Protocol") that match active destination URLs (like /directory?tool=mcp). 3. Automated Replacement: The agent injected the Markdown link syntax directly into the database text fields without altering surrounding punctuation.

Results and Takeaways§

  • Link Velocity: We successfully injected over 120 context-rich internal links across our blog catalog, improving indexing crawl rate.
  • Page Layout Safe: Regular expression checks verified that all injected links had valid syntax and did not corrupt paragraph formatting.
  • Inject with Caution: Always run validation scripts on modified HTML/Markdown before committing updates back to the live database.