Skip to main content
Every answer produced by the query agent carries a list of citations — structured references that map each factual claim back to the exact chunk and quoted text that supports it. Citations are created by the reasoner, verified for accuracy before the answer is assembled, and then deduplicated and numbered sequentially so you can display them inline or surface them in a review UI.

Citation Structure

number
The sequential display number assigned during the Respond phase. Corresponds directly to the [n] marker embedded in result.answer.
string
The unique identifier for the retrieved chunk, formatted as documentId:section:chunkIndex. Use this to look up the full chunk in your document store.
string
The parent document’s ID. Matches records in your documentStore.
"policy" | "quote"
Optional document type tag populated when the document store provides it.
string
Optional field path (e.g. coverage.generalLiability.perOccurrenceLimit) when the citation points to a structured field rather than a free-text chunk.
string
The exact text extracted from the source chunk that directly supports the claim. The verifier phase checks that this quote is genuinely present in the referenced chunk.
number
Similarity score from 0 to 1 assigned during the retrieval phase. Higher values indicate a closer semantic match to the sub-question.

How Citations Flow Through the Pipeline

Citations are produced and refined across four pipeline phases. Understanding the flow helps you debug low-confidence answers or missing citations in your UI.
1

Retrieval produces evidence items

Each retrieval strategy (chunk search, document lookup, source retrieval, conversation history) returns evidence items that carry source references — the chunk ID, document ID, and the raw text of the chunk. These references become the raw material for citations.
2

Reasoners create citations from evidence

Each reasoner is given only its assigned evidence items. For every factual claim it makes, it must produce a citation pointing to a specific evidence item and include an exact quote from that item. Claims without a supporting evidence item are either omitted or flagged as low-confidence.
3

Verifier checks citation accuracy

The verifier confirms that:
  • Every claim in every sub-answer has at least one citation
  • The quoted text in each citation is genuinely present in the referenced chunk
  • Citations across sub-answers are consistent (no two citations contradict each other about the same fact)
If a citation fails verification, the verifier can trigger a targeted retry on the affected sub-question.
4

Responder deduplicates and numbers citations

When sub-answers are merged into the final response, identical citations (same chunkId and quote) are collapsed into a single entry. The remaining citations are assigned sequential index values starting at 1, matching the [n] markers embedded in the answer text.

Using Citations in Your UI

After calling agent.query(), you can display citations inline or render them in a reference list. The index value in each Citation matches the [n] markers in result.answer.
Use cite.chunkId to deep-link into your document viewer, or pass it back to your documentStore to retrieve the full surrounding paragraph for additional context.

Rendering an Inline Reference List


Query Intent Reference

The intent assigned during classification determines which retrieval strategies are prioritised and therefore which kinds of citations you’re likely to see in the output.
document_search queries often produce citations with a field path rather than a free-text quote, because the retrieval strategy matches structured document metadata rather than prose chunks.

Low Confidence and Missing Citations

When result.confidence is below 0.7, or when result.reviewReport flags completeness issues, some claims may have been answered without strong evidence.
A low relevance score on a citation (below 0.5) means the retrieval system found a loosely related chunk rather than a direct match. Review those citations carefully before relying on the answer in an automated workflow.
You can inspect the review report to understand what the verifier found: