This is a submission for the AI Agents Challenge powered by n8n and Bright Data
What I Built
In the new era of generative search, why not just use a model with built-in Google Search grounding to create an article? This was the first question I asked myself.
The answer reveals a fundamental limitation: a grounded AI gives you a summary, but you never see the source material. It’s a black box. You can’t analyze the structure of the top-ranking pages, you can’t see the exact “People Also Ask” questions, and you have no control over which sources the AI chooses to value.
To solve this fundamental limitation, I built the AI SEO Content Brief Agent. This is not a chatbot; it’s a complete, automated intelligence pipeline that transforms the messy, real-time web into a high-value, strategic asset.
This agent solves a critical problem for content creators: it provides not just an answer, but a data-driven blueprint for how to create content that wins. It automates the work of an expert SEO strategist who needs to deconstruct the competition, not just summarize them.
The process is a powerful fusion of live data and specialized AI agents, and it’s what makes this approach superior:
Request: A user visits the agent’s webpage (rankbeacon.dev) and enters a competitive keyword.
Real-Time Data Acquisition (The Crucial Difference): The n8n workflow triggers. Instead of asking an AI for a summary, it uses Bright Data’s Web Unlocker to fetch the raw, complete HTML of the live Google search results page. This provides the unprocessed, unbiased source material that grounding completely hides.
Specialized Analysis (The “Analyst Agent”): The first AI agent acts as a high-speed parser. Its only job is to deconstruct the raw HTML and extract a clean, structured JSON analysis. It identifies the top-ranking competitor URLs, the exact wording of questions users are asking, and the recurring themes in the titles and descriptions. This structural analysis is impossible with a simple grounded prompt.
Strategic Synthesis (The “Strategist Agent”): A second, distinct AI agent receives this clean, structured data. It thinks like a senior content strategist, using the real-world data to write a creative and comprehensive content brief in Markdown. It doesn’t guess what a good title is; it suggests titles based on what’s already performing well.
Professional Delivery: The final brief, now perfectly optimized for both human readability and AI synthesis, is delivered directly to the user’s email, ready for a writer to create a piece of content with a genuine, data-driven competitive advantage. Alternatively, we could add an extra AI Writer Agent & a WordPress node in n8n let AI write the article & publish it on WordPress to turn it into an AI SEO Content Generator.
Demo
You can try the live tool yourself on the official project webpage:
➡️ Live Tool: https://www.rankbeacon.dev/content-brief-agent.html
I have also recorded a short demo video that showcases the complete end-to-end process, from entering a keyword on the webpage to receiving the final, formatted content brief in my email inbox.
➡️ Demo Video: https://youtu.be/jxnbHURAkIE
n8n Workflow
https://gist.github.com/tanDivina/1030962215cc5535ac28db72c08d4461
Technical Implementation
My agent is architected as an “AI Agent Chain” in n8n. This approach breaks a complex problem into smaller, specialized tasks, leading to more reliable and higher-quality results than a single, monolithic prompt.
System Instructions (Prompts): The workflow uses two distinct agents. The first, the “Analyst Agent,” is prompted to act as a technical parser, focusing solely on extracting a structured JSON from raw HTML. The second, the “Strategist Agent,” is prompted to act as a creative content strategist, taking the clean JSON and generating a human-readable brief in Markdown.
Model Choice: The workflow is powered by Google Gemini 2.5 Flash Lite. It is designed to be model-agnostic, but the two-agent structure allows for optimization. For instance, a faster, cheaper model can be used for the technical parsing task, while a more powerful, creative model like Gemini 2.5 Pro could be used for the final content generation if desired.
Memory: The agent is stateless and requires no memory. Each run is a discrete, self-contained task triggered by the user, making it efficient and scalable.
Tools: The core tools in the n8n workflow are: Webhook (to receive requests from the webpage), Bright Data (for data acquisition), AI Agent using Gemini 2.5 Flash Lite (x2), Code (x2): This was the most critical part of my solution. I used two separate Code nodes to build a resilient data pipeline. The first reconstructs the raw HTML from the Bright Data node’s unique output format. The second uses a regular expression to reliably parse the JSON from the AI Analyst’s text response, making the workflow robust against AI hallucinations or conversational text, Markdown (for HTML conversion), and Gmail (for final delivery).
Bright Data Verified Node
My project’s entire data acquisition strategy is built upon the Bright Data Verified Node. I specifically leveraged the Web Unlocker resource within the node. This was the critical component that allowed my agent to reliably bypass blocks, solve any potential CAPTCHAs, and access the raw, real-time HTML of the Google Search Results Page — a task that is notoriously difficult and would be impossible with standard HTTP requests. The Verified Node was the cornerstone that transformed my agent from a theoretical concept into a functional, unstoppable workflow.
Journey
As someone completely new to n8n, this challenge was an incredible, hands-on learning experience. My journey was defined by persistent, step-by-step debugging, which taught me the core principles of building robust automation.
I overcame several key challenges that are common in real-world development:
The Unexpected Data Format: My first major breakthrough was diagnosing the output of the Bright Data node. It wasn’t clean HTML, but a character-indexed JSON object. I solved this by writing a custom JavaScript snippet in an n8n Code node using Object.values().join(”) to reliably reconstruct the full HTML string. This was a fantastic lesson in adapting to real-world API outputs.
The Unreliable AI Response: My second “aha!” moment came when I realized my AI Analyst would sometimes wrap its perfect JSON in conversational text (e.g., “Here is the JSON you requested…”). This would break the downstream nodes. I engineered a robust solution by adding a second Code node that uses a regular expression (/({[\s\S]*})/) to find and extract only the JSON block from the AI’s text output.
This project taught me that building a truly “unstoppable workflow” isn’t just about a clever prompt. It’s about anticipating and handling the messy, unpredictable nature of real-world data and AI responses. I’m proud that I was able to build not just an AI agent, but a complete, resilient, and highly useful full-stack solution.