RAG & search

InlineCitation

Superscript [n] chip with a CSS-only hover card. Drop it inline in generated answers so each claim links to its source. Works in server-rendered streams — no hydration cost.

Sourcesrc/components/ai/source-citation.tsx

Embedded in prose

Hover or keyboard-focus the superscript chip to reveal the source card. Each citation is an independent anchor.

The population of greater Tokyo is roughly 37 million1UN World Cities Report 2025un.orgGreater Tokyo remains the world's largest urban agglomeration at 37.4M residents., about three times the size of New York2US Census — MSA population estimatescensus.govNew York-Newark-Jersey City MSA: 19.3M (2025 estimate).. The density is driven largely by rail commuter networks3JR East annual ridership report FY2025Yamanote Line alone moves ~3.5M passengers per weekday, with peak-hour trains at 180% capacity.rather than car-centric suburban sprawl.

Mixed source types

Icon in the hover card changes with source.type: web, document, code, database, video.

Our retrieval pipeline chunks at 512 tokens with 64-token overlap1src/rag/chunk.ts — splitByTokens()splitByTokens(doc, { chunkSize: 512, overlap: 64 })then re-ranks the top-40 neighbours with cohere-rerank-v32embeddings_v3 table schemadoc_id uuid, chunk_idx int, embedding vector(1536), text text, meta jsonbbefore passing the final 8 chunks to the model.