Gemini File Search Visual Citations: Audit media_id and page_numbers

Audit Gemini File Search visual citations by preserving file hashes, page numbers, media IDs, answer claims, cited evidence, and manual verification.

Sonar traces a Gemini answer to page_numbers and media_id locators while an editor verifies a duplicate image.

Direct answer: Gemini File Search can now embed and search images using gemini-embedding-2, and Google says grounding metadata includes media_id for visual citations plus page_numbers for source location. Those fields make an audit more precise, but they do not prove that the answer interpreted the visual or page correctly.

Treat a page or media locator as a retrieval pointer. Correctness still depends on stable file identity, the exact answer claim, the cited content, OCR or visual interpretation, and a reviewer’s support decision.

Build a file and citation ledger

Assign an immutable internal ID to every ingested file and save a cryptographic hash, original filename, MIME type, page count, page order, rotation, language, extraction method, embedding model, store, and ingestion timestamp. When a file changes, create a new version instead of silently reusing the old identity.

For each answer claim, preserve the raw grounding metadata, file ID, page_numbers, media_id, cited span where available, answer sentence, prompt, model, date, and reviewer. Keep the original page image or a reproducible pointer subject to rights and privacy constraints.

One visual citation needs retrieval and verification evidence
FieldRecordFailure it reveals
File identityName, hash, version, ingest timeCitation points to a replaced file
Locationpage_numbers and media_idMissing or ambiguous locator
ClaimExact answer sentence and boundaryCitation is only topically related
ReviewVisible evidence and decisionModel misreads image, table, or OCR

Test the locator edge cases

Build fixtures with repeated figures, scanned pages, rotated pages, diagrams with nearby captions, multi-column layouts, page-number labels that differ from PDF indices, and an image reused on several pages. Include documents where OCR disagrees with visible text and where the decisive evidence is graphical rather than written.

Retain missing locators as data. If a response cites the document but provides no page or media identifier, classify it separately instead of guessing the location. A correct guessed page would hide a metadata failure.

Verify support at the claim level

Open the exact page and media object. Ask whether it supports the nearby answer statement within the stated scope and whether a reasonable reviewer could reach the same interpretation. Separate verified, qualified, unsupported, inaccessible, and ambiguous outcomes.

A citation can point to the right page while the model reads a chart axis incorrectly, confuses a legend, ignores a footnote, or attributes a decorative image as evidence. Compare OCR output with the rendered page when text extraction matters, and preserve the discrepancy.

Maintain the evidence after file changes

Re-run citation fixtures after replacing files, changing the embedding model, rebuilding the store, or updating the answering model. Record additions and deletions; a locator that remained syntactically valid may now identify different content.

Publish the ledger schema and failure counts when reporting a test. Do not reduce the result to “citation accuracy” without showing the denominator, missing locators, ambiguous duplicates, and manual adjudication method.

Assign an owner and review trigger to each store. A document replacement, page insertion, OCR correction, permission change, or model migration can invalidate a previously verified locator even when the public filename stays the same.

Use the citation-ready passage test and the AI citation measurement protocol for the reporting boundary.

Primary documentation

Community discussion

Discuss: Gemini File Search Visual Citations: Audit media_id and page_numbers

Have a question, a useful example, or a different perspective? Join the discussion, share evidence, and help other readers reach a better answer.

0 replies Moderated
No replies yet.

Be the first to ask a focused question, share a practical example, or add useful evidence.

Ask a question or join the discussion

Share evidence, a useful example, or a clear question. Be specific, stay on topic, and challenge ideas without attacking people. First-time replies may be held for moderation.