SegOps AIDocs

AI Visibility Tracking

Track how your brand and products are mentioned in AI-generated search responses across ChatGPT, Perplexity, Claude, Gemini, and Grok.

Overview#

AI Visibility Tracking answers: "When someone asks an AI assistant about my product category, does my brand appear — and where?"

You register natural-language queries, schedule them to run across AI providers, and the platform extracts brand mentions, ranks your position, and tracks sentiment over time.

Key Concepts#

TermDefinition
AIQueryA registered query (e.g. "best running shoes under $150") with a schedule and provider list
AIQueryResultA single execution of a query against one provider — stores raw response + extracted entities
Mention Rate% of results where your brand appeared
Avg PositionAverage rank of your brand when mentioned (1 = first)
Share of VoiceYour brand mentions as a fraction of all brand mentions in responses
Sentiment Score0–1 score (0 = negative, 0.5 = neutral, 1 = positive)
SimulatedResults from providers without configured API keys — realistic placeholder, not real LLM output

Setup#

Provider API Keys#

Configure in your environment:

ProviderEnv VarSDK Used
ClaudeANTHROPIC_API_KEYanthropic (already required)
ChatGPTOPENAI_API_KEYopenai
PerplexityPERPLEXITY_API_KEYopenai (compatible base URL)
GeminiStub until configured
GrokStub until configured

Without a key, a provider returns is_simulated: true with plausible placeholder text.

Entity Extraction#

Extraction uses Claude Haiku. It always uses ANTHROPIC_API_KEY. If the key is absent, extracted entities default to empty arrays.

Query Registration#

From AI Visibility → Query Manager, click Add query:

  • Query text — the natural-language question, max 1000 chars
  • Category — optional grouping (brand awareness, product discovery, etc.)
  • Providers — which AI providers to run against (defaults to all 5)
  • Schedule — hourly, daily, or weekly execution

Scheduling#

Celery beat runs schedule_ai_query_execution every 5 minutes. It finds all active queries where last_run_at is null or past the schedule threshold and enqueues run_ai_query for each.

Dashboard#

/ai-reach shows:

  • 4 KPI cards — Mention Rate, Avg Position, Share of Voice, Sentiment Score
  • 30-day timeline — mention rate trend chart
  • Provider breakdown — per-provider metrics table

Integration with Product Segments#

M14 activates the ai_visibility_metric condition type in product segments (previously stubbed to 1=0). Supported operators:

ConditionDescription
not_ai_visible = trueProducts whose SKU has not appeared in any real AI response in the last 30 days
mention_rate >= 0.5Products with ≥50% mention rate across recent snapshots
share_of_voice >= 0.2Products appearing in ≥20% of AI response brand mentions
avg_position <= 3Products ranking in the top 3 when mentioned

These conditions query segmentation.ai_visibility_snapshots directly. Only non-simulated results (is_simulated = 0) are used.

Code Paths#

FilePurpose
apps/api/apps/ai_reach/models.pyAIQuery, AIQueryResult models
apps/api/apps/ai_reach/adapters.pyBaseProviderAdapter + 5 implementations
apps/api/apps/ai_reach/extraction.pyClaude Haiku entity extraction
apps/api/apps/ai_reach/tasks.pyrun_ai_query, schedule_ai_query_execution
apps/api/apps/ai_reach/views.pyAIQueryViewSet, DashboardView
apps/api/apps/product_segments/preview.py_build_ai_visibility_metric (now live)
apps/web/app/(app)/ai-reach/page.tsxDashboard UI
apps/web/app/(app)/ai-reach/queries/page.tsxQuery manager
apps/web/app/(app)/ai-reach/queries/new/page.tsxNew query form

Adding a New Provider#

  1. Implement class MyAdapter(BaseProviderAdapter) in adapters.py with provider_id and execute()
  2. Add to ADAPTERS dict
  3. Add to AIQueryResult.PROVIDER_CHOICES
  4. Add to ALL_PROVIDER_IDS
  5. No task or extraction changes needed — they use ADAPTERS dynamically