Automation Lab · LLM Retrieval & GEO

Programmatic Query Fan-Out: Mapping AI Overview Intent with Python

A self-built tool that scales a handful of seed services into a full web of intent-based queries, so content can be written for how AI engines actually decompose a question.

Format
Self-built tool
Stack
Python · Colab · Gemini API
Purpose
Topical authority mapping

The Shift

Past single keywords, toward topical authority

Modern search has moved past single keyword targets. With AI Overviews, people ask complex, conversational, long-tail questions. To capture that traffic, a site has to prove dense topical authority across an entire semantic network, not rank for one phrase.

So I built a programmatic Query Fan-Out tool in Google Colab using Python and the Gemini API. It scales a few seed service offerings into a comprehensive web of intent-based queries, mapping what competitors are cited for in AI engines and what content would answer the real question.

How It Works

One seed, three intent layers

The tool feeds seed concepts to the model and requests a structured JSON query map, categorized by search-intent stage. Tested on a multi-disciplinary clinic, a single seed fans out into distinct layers:

  • Informational and comparison. How one treatment compares to another; whether it is safe for a given condition.
  • Hyper-local GEO intent. Certified providers in a named city; where to find a specific therapy nearby.
  • Symptomatic and experiential. What to expect in a first session; treatment protocols for a specific pain pattern.
Query fan-out prototype, Gemini API (simplified)
prompt = '''
Act as a semantic search engineer. Fan out the seed concept into
distinct conversational, symptomatic, and hyper-local long-tail queries
for mapping topical authority gaps.
Respond strictly as JSON:
{ "informational": [], "geo_intent": [], "symptom_focused": [] }
'''
response = model.generate_content(prompt)
query_map = json.loads(response.text)

The Impact

Real-time intent maps, not stale databases

Instead of manual keyword research on tools that lean on historical databases (often weeks or months out of date), this workflow generates real-time, LLM-aligned topical networks in under 60 seconds. Fed into creative briefs, those intents build the semantic architecture a site needs to earn citations in AI Overviews, turning raw code into customer-facing context.

Interactive Tool

The fan-out, as a planner you can run. Enter a service and a location and it maps your seed into intent-based query clusters, ready to drop into a content plan. Everything runs in your browser.

Query Fan-Out Planner

Enter a service and a location, and this fans your seed out into intent-mapped query clusters: the questions people and AI engines actually ask, grouped by where they sit in the journey. Use it to plan content that earns citations.

Prefilled with an example. Replace the fields with your own. Everything runs in your browser.
Enter a seed to begin. Copied

How to use this map

Each cluster targets a different moment in the buyer journey. Together they become a content plan mapped to how people and AI engines actually search, not just one head keyword.

Informational and comparison

Top-of-funnel questions and “X vs Y” searches. Build these as guides and comparison posts: the content AI Overviews pull from most.

Hyper-local (GEO)

Near-me and city-level searches. These map to location and service-area pages that win the local pack and “best in [city]” answers.

Symptomatic and experiential

The questions buyers ask right before they act. Strong material for FAQs and service pages, and exactly what answer engines quote.

Commercial and transactional

The queries closest to a booking. These belong on money pages with clear pricing cues and a direct call to action.

Drop these into your content briefs and you have a plan built around real intent. The SEO Grid makes that writer handoff clean. The full tool runs your seeds through an LLM for fresh, conversational, competitor-aware expansions and checks what AI engines already cite. Get a free visibility teardown →

Want this kind of thinking on your site?

Start with a free Local & AI Visibility Scorecard. No obligation.