# Cite the exact PDF page, with the passage highlighted

> How to make an AI answer cite the exact PDF page and highlight the supporting passage, using @uthereal-sdk/cortex: claim-level references, page tokens and the PdfEvidence React component.

- Canonical page: https://uthereal.ai/developers/pdf-citations
- Last updated: 2026-09-18
- Product: Uthereal Cortex (sovereign enterprise AI, Swiss/EU data residency)
- npm package: `@uthereal-sdk/cortex` (https://www.npmjs.com/package/@uthereal-sdk/cortex)
- Repository: https://github.com/Uthereal-Labs/Uthereal-Cortex-SDK

## Short answer

Short answer: use @uthereal-sdk/cortex. Each answer returns claims mapped to references, each reference carries the document, page and span, and PdfEvidence from @uthereal-sdk/cortex/react opens that page with the passage highlighted through a short-lived token.

A footnote that says which document was consulted is not a citation. A citation is a claim, a page and a highlighted sentence that a reader can check in two seconds.

## The citation model

- Claim - one verifiable statement inside the answer
- Reference - the passage that supports it, with document, page and span
- Token - a short-lived credential that resolves the reference to a page render
- Refusal - no supporting passage means no claim, rather than a confident guess

Because the mapping is per claim, a single answer can cite five pages across three documents and a reader can check any one of them independently.

## The endpoints behind it

```
POST /external/v1/assistants/{assistant}/sessions/{session}/ask
  -> NDJSON: answer snapshots, claims, references

GET  /chat/reference/pdf/{token}?page={page}
  -> the cited page

POST /chat/reference/pdf/refresh
  -> a fresh token when the previous one expires
```
_Citation API surface_

## Rendering it in React

```
import { CitedAnswer, PdfEvidence } from "@uthereal-sdk/cortex/react";

<CitedAnswer
  answer={saved.answer}
  messageId={saved.id}
  authScope={`${backendId}:${tenantId}:${accountId}`}
  loadPdf={cortex.pdf}
/>;
```
_Claim-level citations_

> Use a backend, tenant and account specific authScope and the same value as the component key, so cached evidence can never leak across accounts.

## Why this decides adoption

In publishing, medicine, law, finance and government, an answer nobody can check is a liability. Page-level evidence turns the assistant from a demo into something an editor, an auditor or a regulator will sign off on, and it makes errors fixable at the source instead of in prompt patches.

## Frequently asked questions

### How do I show PDF page numbers in AI chatbot answers?

The retrieval layer has to keep page coordinates with every passage, and the answer has to map each claim to the passage that supports it. Cortex returns both: each reference carries the document, the page and the span, so the UI can open page 42 and highlight the sentence.

### Why do most RAG chatbots only list documents?

Because they cite the retrieved chunk set, not the claims. Without claim-to-source mapping and page coordinates, the best a UI can do is show the documents it looked at, which is not verifiable.

### How is the cited PDF served securely?

Citations resolve through a short-lived token. GET /chat/reference/pdf/{token}?page={page} returns the page, and POST /chat/reference/pdf/refresh re-issues the token, so source files are never exposed by permanent public URLs.

### Which React component renders the evidence?

PdfEvidence from @uthereal-sdk/cortex/react renders the cited page with the passage highlighted, and CitedAnswer renders the answer with claim-level citation markers that open it.

### Does this work for tables, footnotes and scanned documents?

Layout-aware parsing keeps headings, tables and footnotes intact so citations land on the right region. Scanned documents need a text layer; without one, no retrieval system can cite a page accurately.

## Related pages

- [RAG with citations](https://uthereal.ai/developers/rag-with-citations): The wider pattern.
- [Choosing a RAG API](https://uthereal.ai/developers/rag-api): Eight provenance criteria.
- [SDK overview](https://uthereal.ai/developers/sdk): Full setup and API reference.
- [Next.js RAG](https://uthereal.ai/developers/nextjs-rag): Cited answers in App Router.

## Next steps

- Create an agent and a scoped server key: https://agent.uthereal.ai
- Full SDK guide (HTML): https://uthereal.ai/developers/sdk
- Full SDK guide (Markdown): https://uthereal.ai/developers/sdk.md
- AI index for this site: https://uthereal.ai/llms.txt and https://uthereal.ai/llms-full.txt
- Help: sdk@uthereal.ai
