Internal Service β This is not an HTTP endpoint. Itβs called directly by the
generate-all orchestrator.Purpose
Creates an AI-optimized website withllms.txt, robots.txt, sitemap.xml, structured data, and markdown replica pages. Deploys to Vercel and assigns a *.searchcompany.dev subdomain.
Runs in GROUP 2a (parallel with 2b and 2c after GROUP 1a + 1b + 1d complete).
Function Signature (Onboarding)
Parameters
Key Change: During onboarding,
business_info is used for LLM content generation (llms.txt, Q&A, data.json). Scraped pages are ONLY used for markdown replica generation.Returns
File Generation: Two Distinct Sources
The AI website content comes from two different sources:From Business Info (Firecrawl Agent)
LLM-generated files usebusiness_info from GROUP 1a:
From Scraped Pages (GROUP 1b)
Deterministic files use scrapedpages:
Pipeline
The Three Gemini Calls
All three calls run in parallel usingasyncio.gather() with business_info:
Call 1: llms.txt Generation
- Input:
business_info(description, products_services, target_market, key_features, value_proposition) - Output: Comprehensive AI-readable summary (500-1500 words)
- Prompt:
build_llms_txt_prompt_from_business_info()
Call 2: Homepage + Q&A Pages
- Input:
business_info+ AI site URL - Output: JSON with homepage structure + 8-15 Q&A pages
- Prompt:
build_index_html_prompt_from_business_info()
Call 3: Schema.org data.json
- Input:
business_info+ source URL - Output: JSON-LD structured data
- Prompt:
build_data_json_prompt_from_business_info()
LLMs.txt Structure
Markdown Replica Pages
For each scraped page, creates a markdown replica at/{slug}:
- Preserve the original content in markdown format
- Are optimized for AI crawlers
- Include structured metadata
- Have collision detection (adds 4-char suffix if slug conflicts with Q&A page)
Product LLMs Architecture
Product-specific llms files are generated by GROUP 2c (Generate Product LLMs) which runs in parallel with GROUP 2a and 2b.File Structure
Flow
Code Location
Database Updates
Updates theai_sites table: