Sub topic 1
What Answer Engines Are and Why They Cite Pages
An answer engine reads a question, searches the web, and writes a direct answer with links to its sources. ChatGPT search, Perplexity, and Microsoft Copilot all work this way. A plain chat model answers from its training data alone. An answer engine fetches pages at question time, which is why it can link to them.
Prerequisites
This chapter assumes you understand how a search engine crawls and indexes pages, can read HTML and HTTP requests, and have a general idea of what a large language model does.
The Retrieve-then-Generate Pipeline
Most answer engines use retrieval-augmented generation (RAG). The steps run in order:
- Rewrite the user's question into one or more search queries.
- Retrieve candidate pages from a web index or a live search.
- Extract short passages from the strongest pages.
- Pass those passages to the language model and ask it to write an answer.
- Attach citations that point to the passages the answer used.
How Pages Get Crawled and Indexed
A crawler is a program that requests pages over HTTP and follows links. An indexer stores the text and metadata so a query can find matching pages quickly. A page that was never crawled or indexed usually cannot be retrieved from that index.
Crawler User Agents
Each crawler identifies itself with a user-agent string. Three purposes matter:
- Search crawlers build the index used for retrieval. Examples: OAI-SearchBot, PerplexityBot, bingbot.
- Training crawlers collect content for model training. Example: GPTBot.
- User-initiated fetchers load a page because a user asked about it. Examples: ChatGPT-User, Perplexity-User.
Blocking a training crawler does not block search crawlers. Vendor names change, so check each vendor's documentation before writing rules.
Controlling Access with robots.txt
robots.txt is a plain text file at the site root. It lists which crawlers may fetch which paths. Well-behaved crawlers honor it, but the file is a request, not an enforcement mechanism.
# Allow the search crawler that feeds ChatGPT search
User-agent: OAI-SearchBot
Allow: /
# Opt out of model training
User-agent: GPTBot
Disallow: /> Note: the file is a request, not a lock. Use server or firewall rules if you need enforcement.
Exercise
A site wants its pages cited in AI search answers but does not want its content used for model training. Which user agents should it allow, and which should it disallow?
Show answer
Allow search crawlers such as OAI-SearchBot, PerplexityBot, and bingbot. Disallow GPTBot, the training crawler.