Skip to main content
Internal Service β€” This is not an HTTP endpoint. It’s called directly by the generate-all orchestrator as a fire-and-forget background task.

Purpose

Generates 10 prompts using Exa’s Answer API and immediately runs visibility checks across 8 AI platforms. These prompts are pre-tested so users see real visibility data on first dashboard load. Runs in GROUP 1c (parallel with scrape, non-blocking).

Function Signature

async def run_group1c_exa_prompts(
    org_slug: str,
    business_name: str,
    url: str
) -> StepResult

Parameters

ParameterTypeDescription
org_slugstrThe Clerk organization slug
business_namestrThe business name
urlstrThe business website URL

Returns

{
  "name": "exa_prompts",
  "status": "success",
  "data": {
    "prompts_generated": 10,
    "prompts_saved": 10,
    "avg_visibility": 4.2,
    "total_visible": 42
  }
}

Two-Step Process

Step 1: Generate Prompts via Exa

Asks Exa Answer API to generate search queries people would use to find this type of business:
Generate 10 search queries that someone might type into ChatGPT, 
Claude, or Perplexity when looking for a business like {business_name} 
({url}).

Requirements:
- Natural questions or search phrases a potential customer would ask
- Mix of: product/service queries, comparison queries, recommendation queries
- Do NOT include "{business_name}" in the queries

Step 2: Check Visibility Across 8 Platforms

For each prompt, checks if the business is mentioned in responses from:
PlatformAPI Used
ChatGPTOpenAI API
ClaudeAnthropic API
GeminiGoogle AI Studio
PerplexityPerplexity API
CopilotBing Chat API
DeepSeekDeepSeek API
GrokxAI API
Google AIGoogle AI Overviews

Pre-tested Prompts

These 10 prompts have last_tested_at set and visibility results populated before the user first loads their dashboard. This means they see real data immediately, not empty states.
Example saved prompt:
{
  "entity_id": "uuid-...",
  "prompt": "What payment gateway supports instant bank transfers?",
  "chatgpt": true,
  "claude": false,
  "gemini": true,
  "perplexity": true,
  "copilot": false,
  "deepseek": false,
  "grok": true,
  "google_ai": false,
  "checked_at": "2024-01-15T10:30:00Z",
  "last_tested_at": "2024-01-15T10:30:00Z"
}

Execution Timing

GROUP 1a (Scrape)     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
GROUP 1b (Competitors) β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  ← Parallel
GROUP 1c (Exa)        β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  ← This service
GROUP 2               β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  ← Starts when 1a completes

Prompt Count Strategy

SourceCountPre-tested
GROUP 1c (Exa)10βœ… Yes
GROUP 2a (Gemini)40❌ No
Total Business Prompts50

Code Location

src/app/apis/onboarding/generate_all/exa_prompts.py

Error Handling

If Exa fails, falls back to generic prompts:
prompts = [
    "best software alternatives in this category",
    "top rated companies in this industry",
    "which service should I use for this",
    "most recommended solutions for businesses",
    "what are the leading options available",
]