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
| Parameter | Type | Description |
|---|
org_slug | str | The Clerk organization slug |
business_name | str | The business name |
url | str | The 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
For each prompt, checks if the business is mentioned in responses from:
| Platform | API Used |
|---|
| ChatGPT | OpenAI API |
| Claude | Anthropic API |
| Gemini | Google AI Studio |
| Perplexity | Perplexity API |
| Copilot | Bing Chat API |
| DeepSeek | DeepSeek API |
| Grok | xAI API |
| Google AI | Google 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
| Source | Count | Pre-tested |
|---|
| GROUP 1c (Exa) | 10 | β
Yes |
| GROUP 2a (Gemini) | 40 | β No |
| Total Business Prompts | 50 | |
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",
]