Skip to main content
Version: 2.0

Citations in Search and Retrieval

Citations provide important source attribution in query results, enabling users to verify information and trace content back to its original sources. This transparency is essential for building trust in AI-generated content and supporting fact-checking workflows.

How citations work

When Vectara generates summaries or retrieval results, it automatically includes citations that reference the specific sources used. These citations create a direct link between the generated content and the underlying documents, ensuring traceability and accountability.

Citation numbering

Citations appear in the format [number] within summary text, where:

  • Numbers start from 1
  • Each number corresponds to a result in the search_results array
  • Numbers increment sequentially for each unique source referenced

Example with citations

Here's an example query response showing how citations appear in a summary:

EXAMPLE RESPONSE WITH CITATIONS
1

Notice how each citation number in the summary corresponds to a specific result in the search_results array. The citations are ordered based on their appearance in the summary text, not by relevance score.


Citation formatting options

Vectara supports multiple citation formats to suit different application needs. You can control how citations appear in summaries using the citations_options parameter in your query. We support the following formats:

Numeric (default)

NUMERIC CITATION FORMAT
1

Citations appear as numbers in square brackets: [1], [2], [3]

This is the default citation format. If you don't specify citations_options, Vectara will use numeric citations automatically.

None

Disables citations entirely, producing clean text without source references

Use this option when you want clean summary text without any source attribution. This is useful for conversational interfaces where citations might disrupt the flow.

HTML

Formats citations as HTML links for web applications

Perfect for web applications where you want clickable citations. You can style these links with CSS and add JavaScript handlers to show source details on click.

Markdown

Formats citations as Markdown links, useful for Markdown-based applications

Ideal for documentation systems, chat applications, or any interface that renders Markdown. The links can be processed by your Markdown renderer.

Code Output Support

Markdown citation style enables formatting of code blocks and technical content in responses, making it easier to display code snippets, YAML configurations, or structured technical output.


Advanced citation options

ADVANCED CITATION CUSTOMIZATION
1

You can further customize citation behavior with additional parameters:

These advanced options allow you to customize how citations are formatted beyond the standard styles. Use url_pattern and text_pattern to create custom citation formats that match your application's needs.

Enable citations in queries

Query with custom citation format

QUERY WITH CUSTOM CITATION FORMAT
1

This example explicitly sets the citation style to Markdown.