For the complete documentation index, see llms.txt. This page is also available as Markdown.
Ground an LLM answer in real citations
Outcome: answers in your product where every claim links to a source the user can open and check.
Approach
Use SciSpace for retrieval and grounding rather than asking a general model to remember the literature. The Citation object is what your UI renders.
Walkthrough
Create a chat scoped to the documents or papers in play
Send the question with
stream: trueRender
message.deltaas it arrives; oncitation.added, attach a markerLink each marker to the source, with the quote in a tooltip
Handling the hard parts
Unsourced claims.
source.type: "model"means no retrieved evidence. Show it differently, or drop the sentence — do not present it as sourced.Quote fidelity. Render
quoteverbatim. Never paraphrase inside a quotation mark.Marker mapping. Match
[n]in the text tocitations[].index. Do not renumber.Dead links. Papers without an accessible PDF have no
locations. Fall back to the paper page.
Related
Last updated