Skip to main content

Citations are data: what to store when an answer has to be defensible

Updated 6 min readMarkdown

A citation in a RAG answer is a promise. Someone reads the claim, clicks the source, and expects to land on the page that said it. When that promise breaks, the failure is not cosmetic: the answer is worthless even if every word of it was correct.

Most pipelines break this promise at storage time, not at generation time. They keep the model's prose about its sources and throw away the fields that made the sources addressable. What follows is a map of which fields carry provenance, which ones look like they do and do not, and how to store them so a citation survives a week.

rank and position are not the same number

This is the single most common error in this area, so it goes first.

rank is the place of an item within its own module. The third organic result has rank: 3 (checked 2026-11-25, https://serpbase.dev/docs/google_web_search).

position is where the item's module sits on the results page: its block number counted from the top, with 1 meaning the first block. Every organic result is one block and every other module is one block, so all items inside a module share the same position value.

The docs even ship a real example where the two diverge: in the sample response, the first organic result has rank: 1 and position: 3, because its module is the third block on that page. A pipeline that stores one integer and calls it "the position" has destroyed the ability to tell whether a result was the third organic hit or the third block on the page.

Why it matters later: "we were ranked third" and "we appeared in the third block" are different claims, and a graded answer will notice. Store two columns.

Three link fields, and only one of them is the citation.

link is the primary link returned by the parser. It is required, and for most results it is what you want to store as the destination.

url is present for normalized result links and is described as the canonical target URL, usually the same value as link.

source_url is the original Google URL kept for debugging and provenance, and it is present only when a redirect or source URL was observed (checked 2026-11-25, https://serpbase.dev/docs/google_web_search).

The practical rule: store link as the citation, and store source_url alongside it only as a debugging trail. A citation pointing at a google.com/goto wrapper still opens, still resolves, and still hides which page the answer actually rests on, which is exactly the property you do not want in an audit.

If you do end up with wrapped links, the link resolver is free and takes up to fifty per request (checked 2026-11-25, https://serpbase.dev/products/google_resolve). Paying nothing to turn a wrapper into a destination is a good trade, and it is the only 0-credit endpoint in the catalog.

The display fields are for the human, not the audit

A result carries a set of fields that look like provenance and are actually presentation:

  • display_url, the display URL or source domain
  • display_link, the raw Google display link text
  • snippet, the result summary
  • date, the raw date text extracted from the snippet
  • published_at, an alias for the parsed date when available
  • icon, the favicon

These belong in the record because a reviewer needs to read them. None of them is an address, and none of them can be re-checked mechanically. display_url is a domain, which is not a page. date is text pulled from a snippet, which is not a publication timestamp you can rely on.

Keep them in the same row as the citation, but do not let them stand in for it.

The response itself has provenance

There is provenance above the level of individual results, and most pipelines drop it.

search_url is the Google URL that answered the search, after redirects and with the browser's session identifiers removed (checked 2026-11-25, https://serpbase.dev/docs/google_web_search). With format: raw there is no JSON body, and the same URL arrives in the X-Search-URL response header instead.

That field answers a question a citation list cannot: which page did this whole response come from. When two runs of the same query disagree, search_url tells you whether the engine served a different page or whether the parser read the same page differently.

Storing it costs one column and settles arguments.

Nested citations: AI Overview sources

When the page carries an AI Overview, the response includes its cited sources as structured entries, with a title, a link, and page title and snippet when the page shows the source card (checked 2026-11-25, https://serpbase.dev/docs/google_web_search).

Those are citations inside a citation: the answer cites the overview, and the overview cites pages. A pipeline that flattens this into one string loses the second layer entirely. Keep the nested structure, because "the overview said X and cited Y" is a different claim from "Y said X".

A storage shape that holds up

Four columns carry the promise, and everything else is commentary:

Column Field Why it must be stored
destination link The address a reader can open
provenance source_url Present only when a redirect was observed; the debugging trail
order_in_module rank Which hit inside its block
block_on_page position Which block, shared across a module

Plus one row-level pair: search_url for the response, and the request's own identifier, so a support question about a specific call can be answered without guessing.

What is deliberately not in that table: the snippet, the date text, the display link. They are worth keeping in the row for a human reader, and they are not worth trusting as evidence.

Three habits that keep citations honest

Never reconstruct a URL from a display string. display_url is a domain. Building a link from it produces a URL that opens the homepage of the right site and the wrong page, which is worse than no citation because it looks correct.

Store the module, not just the order. A forum thread and a news card are not evidence of the same kind. If the record does not say which module a result came from, every downstream filter becomes a guess about text.

Treat a missing key as missing, not empty. A field the page did not carry is simply absent from the response; nothing pads it with a placeholder (checked 2026-11-25, https://serpbase.dev/docs/google_web_search). A schema that expects every field will either fail or, worse, write a null and call it data.

What this buys you

A citation chain built this way answers three questions without a re-run: which page, in which position, from which module. That is the difference between an answer that can be defended and an answer that has to be regenerated and hoped over.

The field reference, including the real sample response where rank and position disagree, is at https://serpbase.dev/?utm_campaign=ops-222e35a2a81a&utm_medium=outreach&utm_source=opsbot

No comments yet. Be the first to comment.