Back to Blog & Research

How AI Models Cite Sources: Deconstructing the RAG Pipelines of Perplexity, ChatGPT, and Claude

An architectural inspection of web search retrieval in modern LLMs: how search queries are formulated, why marketing blogs get ignored, and how SeerSight reverse-engineers the citations driving AI recommendations.

One of the most persistent questions founders and DevRel leads ask when looking at AI search results is:

“Why did Perplexity and SearchGPT cite a two-year-old GitHub issue and an obscure Reddit comment, while completely ignoring our $50,000 product documentation overhaul?”

The answer lies in understanding that modern answer engines do not search the web the way humans do. They operate through sophisticated, multi-stage Retrieval-Augmented Generation (RAG) pipelines designed to optimize token density, factual verifiability, and semantic consensus while actively filtering out marketing fluff.

To win visibility in generative search, we need to examine what happens under the hood when an LLM connects to the live web.


Inside the Anatomy of a Live AI Search Query

When a user submits a prompt like “What is the most reliable job queue for Python FastAPI applications?”, an answer engine with search capabilities (such as Perplexity Pro or ChatGPT with Search) doesn’t simply paste that prompt into Google.

It executes a deterministic multi-phase orchestration:

┌────────────────────────────────────────────────────────┐
│ 1. Sub-Query Formulation & Decomposition              │
│    Model expands 1 prompt -> 3-5 distinct search terms │
└──────────────────────────┬─────────────────────────────┘

┌──────────────────────────▼─────────────────────────────┐
│ 2. Live Web Index Fetching                             │
│    Executes API calls to web indexes (Bing / Google)  │
└──────────────────────────┬─────────────────────────────┘

┌──────────────────────────▼─────────────────────────────┐
│ 3. HTML Scraping, DOM Pruning & Chunking               │
│    Strips scripts/navbars, chunks text into tokens     │
└──────────────────────────┬─────────────────────────────┘

┌──────────────────────────▼─────────────────────────────┐
│ 4. Dense Semantic Reranking                            │
│    Scored via Cross-Encoders against user intent       │
└──────────────────────────┬─────────────────────────────┘

┌──────────────────────────▼─────────────────────────────┐
│ 5. Context Injection & Footnote Citation Synthesis    │
│    LLM writes response & appends anchor citations      │
└────────────────────────────────────────────────────────┘

Step 1: Sub-Query Expansion

The model first asks its internal query planner: “What search queries will uncover the real operational consensus on this topic?”

Instead of searching best Python job queue, the planner generates queries such as:

  • "Python background workers Celery vs RQ vs ARQ benchmark"
  • "FastAPI background tasks production issues reddit"
  • "Celery Redis memory leak alternatives github"

Notice the fundamental characteristic of these queries: the model actively seeks out candid developer feedback and comparative benchmarks.

Step 2: Dense Semantic Reranking

Once raw documents are retrieved, a cross-encoder reranking model scores every chunk of text on an information density curve.

Traditional SEO tactics—fluffy introductions, keyword repetition, stock imagery, and generic meta tags—penalize documents in semantic rerankers. Rerankers are trained to maximize information-to-token ratio. If a passage takes 300 words to explain what could be stated in a 2-column comparative table or a code snippet, its relevance score plummets.


Why Technical Marketing Pages Get Discarded

Most B2B SaaS landing pages and blog posts fail the RAG ingestion test for three specific architectural reasons:

1. Subjective Claims vs. Verifiable Facts

When an official landing page states:

“AcmeQueue is the world’s fastest, most intuitive, zero-configuration task runner for modern cloud teams.”

The LLM’s instruction fine-tuning flags this sentence as high-entropy promotional copy. The model cannot ground the words “most intuitive” in an objective metric.

Contrast that with a GitHub discussion or third-party engineering blog:

“We benchmarked AcmeQueue against Celery with Redis broker at 10,000 tasks/sec. AcmeQueue maintained p99 latency of 14ms with 42MB baseline RAM consumption, whereas Celery averaged 65ms under memory pressure.”

This second excerpt is dense with verifiable claims (p99p99 latency, throughput numbers, exact baseline memory). The model’s context assembly algorithm prioritizes this passage, and consequently, the third-party post receives the citation, not your official documentation.

2. The Multi-Source Consensus Mechanism

Frontier models are heavily penalized in RLHF (Reinforcement Learning from Human Feedback) for unverified hallucinations. When making a recommendation, models seek cross-document corroboration:

  • If your official website is the only place claiming your software supports horizontal autoscaling, the model treats it with lower confidence.
  • If that claim is echoed across an independent review on Hacker News, a client case study on Substack, and an open-source example repo on GitHub, the model accepts the capability as an established ground fact.

3. Structural Scrape Accessibility

Many enterprise marketing websites rely on heavy client-side JavaScript rendering, gated content modals, and nested shadow DOMs. AI web crawlers prioritize lightweight HTML endpoints that return semantic markdown-clean text within 300 milliseconds.


Citations vs. Web Searches: The SeerSight Forensics Layer

In building SeerSight’s deep intelligence engine, we discovered that tracking only the final output citations misses half the equation.

There is a fundamental technical distinction between:

  1. Web Search Queries & Sources: The actual search queries the LLM formulated under the hood, and the full corpus of organic search results it inspected during reasoning.
  2. Citations: The subset of URLs the LLM explicitly elected to anchor into its final rendered answer as footnotes.
Total Web Sources Consulted (e.g. 15 URLs across 3 search queries)

      ▼  (Model synthesizes and filters)
Final Inline Citations (e.g. 3 URLs cited as authoritative footnotes)

By dissecting both layers in SeerSight’s Pro and Scale tiers, teams can see:

  • Exactly what exploratory queries models run when investigating their category.
  • Which competitor URLs appeared in the model’s intermediate search results but were rejected during the synthesis phase.
  • Which third-party authority domains (e.g., G2, Reddit, Stack Overflow, Medium) are repeatedly trusted as citation sources by OpenAI, Anthropic, and Perplexity.

The Technical Action Plan to Earn AI Citations

If your goal is to ensure generative models cite your product as the authoritative answer, align your documentation with how RAG pipelines read:

  1. Publish Machine-Digestible Benchmark Repositories: Host reproducible benchmark scripts on public GitHub repositories with markdown tables showing latency, throughput, and hardware configurations. Models crawl and cite GitHub readmes with exceptionally high priority.
  2. Structure Technical Documentation with High Information Density: Put the direct answer, requirements, and comparative table in the first 500 tokens of the page. Use strict <h2> hierarchy and clean HTML tables.
  3. Engage with Developer Communities: Foster organic discussions on Reddit (r/programming, r/webdev), Stack Overflow, and Hacker News. When models perform sub-query expansions looking for “real developer experiences”, these forums provide the primary training and RAG data.
  4. Monitor Citation Decay with SeerSight: LLM search indexes refresh dynamically. A link cited consistently in January can be replaced by a competitor’s fresh benchmark in March. Automated tracking alerts you the moment your citation authority slips.