> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/en/build/choose-channel/web-chat/citation-display.md).

# Citation Display

Web Chat citation display: how the source is labeled when an Agent's answer cites a knowledge base, multilingual and dark mode support, where citations appear, and administrator settings.

This article introduces the citation display optimization features in the Web Chat window, including multilingual support and visual presentation improvements.

## What Is Citation Display? <a href="#what-is-citation-display" id="what-is-citation-display"></a>

When an Agent answers a question using specific documents or data from a knowledge base, the system displays "citations" below the answer so end users know where the information comes from.

This feature is especially suitable for scenarios that require proof of information sources, such as:

* Regulatory inquiry assistant: Displays the source of legal provisions
* Policy consultation assistant: Displays policy document sources
* Product customer service assistant: Displays product manuals or official documents
* Medical information assistant: Displays medical literature sources

## Where Citations Appear <a href="#citation-display-location" id="citation-display-location"></a>

When an Agent's answer uses a knowledge base, citation information appears in three places:

| Location                                                               | What you see                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:blue;">Knowledge bases used</mark> below the answer | Which knowledge bases were searched for this answer                                                                                                                                                                                                                                                                                                                                                                          |
| <mark style="color:blue;">Citations</mark> list below the answer       | The names of the cited documents; click <mark style="color:blue;">View cited nodes</mark> to open a dialog listing the passages that were actually cited (cited nodes)                                                                                                                                                                                                                                                       |
| Citation markers in the answer text                                    | Hover over a marker to show a small card with the document name, <mark style="color:blue;">page number</mark> (shows "Source has no pages" if the source is not paginated), a <mark style="color:blue;">relevance</mark> percentage, and two views of the passage, <mark style="color:blue;">Original text</mark> and <mark style="color:blue;">Highlighted keywords</mark>; you can download the original document directly |

Fields for each node in the "View cited nodes" dialog:

| Field                                                                                                  | Meaning                                                                                                                             |
| ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:blue;">Similarity score</mark> / <mark style="color:blue;">Relevance</mark>         | How semantically similar this passage is to the question; the higher it is, the more likely the passage is the basis for the answer |
| <mark style="color:blue;">Hit count</mark>                                                             | How many times this passage was hit in this retrieval; more hits mean it was more often judged relevant                             |
| <mark style="color:blue;">Character count</mark>                                                       | The length of this node                                                                                                             |
| <mark style="color:blue;">Original text</mark> / <mark style="color:blue;">Highlighted keywords</mark> | Switch between plain text and highlighting the keywords related to the question                                                     |

Whether citations are displayed is decided by administrators in [Function Settings](https://docs.maiagent.ai/maiagent-user-guide/en/build/conversation-settings/platform-settings/function-settings.md#ai-interaction). For the corresponding information in the back-end conversation viewer, see [Conversation Viewer: Knowledge Base Citation Tracking](https://docs.maiagent.ai/maiagent-user-guide/en/serve/daily-operations/reply/conversation-viewer.md#knowledge-base-citation-tracking).

## Multilingual Support <a href="#multilingual-support" id="multilingual-support"></a>

### Automatic Language Adaptation <a href="#automatic-language-adaptation" id="automatic-language-adaptation"></a>

Web Chat citation display now supports automatic multilingual adaptation. When end users switch languages, the citation interface text automatically switches to the corresponding language.

#### Supported Languages <a href="#supported-languages" id="supported-languages"></a>

* **Traditional Chinese**: 引用來源、參考資料
* **Simplified Chinese**: 引用来源、参考资料
* **English**: Citation、References

### Language Switch Timing <a href="#language-switch-timing" id="language-switch-timing"></a>

Web Chat automatically switches languages based on the following scenarios:

1. **Browser language settings**: On first load, the display language is based on the user's browser language
2. **Manual switch**: When users switch languages in Web Chat, citation text updates accordingly
3. **Website language environment**: If your website supports multiple languages, Web Chat automatically matches the website's language settings

{% hint style="info" %}
For how to configure Web Chat language, see: [Web Chat Overview](https://docs.maiagent.ai/maiagent-user-guide/en/build/choose-channel/web-chat.md)
{% endhint %}

## Visual Presentation Optimization <a href="#visual-presentation-optimization" id="visual-presentation-optimization"></a>

In addition to multilingual support, the visual presentation of citations has been optimized for clearer readability.

### Optimization Items <a href="#optimization-items" id="optimization-items"></a>

1. **Spacing adjustments**: More appropriate spacing between citations and answer content for a clearer visual hierarchy
2. **Font style**: Citations use a different font style to distinguish them from the main content
3. **Color treatment**: Citations use a lighter color so they don't interfere with reading the main content
4. **Icon marker**: A consistent icon marks citations for better recognition

## Dark Mode Support <a href="#dark-mode-support" id="dark-mode-support"></a>

Citation display also supports dark mode. When an end user's device uses a dark theme, the text and background colors of citations adjust automatically so they remain clearly visible on a dark background.

### Dark Mode Adaptation Items <a href="#dark-mode-adaptation-items" id="dark-mode-adaptation-items"></a>

* Text color automatically adjusts to a light color
* Background color adapts to the dark theme
* Contrast with the main content is maintained

{% hint style="success" %}
Dark mode is enabled automatically based on the user's device settings, with no manual configuration required.
{% endhint %}

## Use Cases <a href="#use-cases" id="use-cases"></a>

### 🏛️ Government Policy Consultation Platform <a href="#government-policy-consultation" id="government-policy-consultation"></a>

**Scenario**: When citizens ask about the eligibility requirements for a subsidy policy, the Agent not only provides the answer but also shows a link to the source of the policy announcement.

**Benefits**:

* Increases the credibility of the information
* Lets citizens read the full announcement
* Reduces citizens' doubts about the accuracy of the information

### ⚖️ Legal Consultation Assistant <a href="#legal-consultation-assistant" id="legal-consultation-assistant"></a>

**Scenario**: When a user asks about the provisions of a regulation, the Agent shows the source of the legal provision and the article number.

**Benefits**:

* Provides a complete legal basis
* Users can verify the original provisions
* Increases the professionalism of the consultation service

### 🏥 Medical Information Platform <a href="#medical-information-platform" id="medical-information-platform"></a>

**Scenario**: When patients ask about a disease, the Agent indicates which medical paper or patient education article the information comes from.

**Benefits**:

* Provides transparency about information sources
* Helps patients understand how reliable the information is
* Meets the regulatory requirements for providing medical information

## Administrator Settings <a href="#admin-settings" id="admin-settings"></a>

### Enable Citation Display <a href="#enable-citation-display" id="enable-citation-display"></a>

Citation display is enabled by default. If you want to adjust the setting:

1. Go to the "AI Assistant" settings page
2. Select "Answer Settings"
3. Find the "Show citations" option
4. Toggle the switch to enable or disable it

### Customize the Citation Format <a href="#customize-citation-format" id="customize-citation-format"></a>

You can add metadata to knowledge base documents to customize how citations are displayed:

* **Document title**: The document name shown in the citation
* **Section number**: Shows the specific section or page number
* **Publication date**: Shows the document's publication or update date
* **External link**: Provides a link to the original document

{% hint style="info" %}
For how to configure knowledge base metadata, see: [Document Management: Tags and Metadata](https://docs.maiagent.ai/maiagent-user-guide/en/build/knowledge-base/tags-and-metadata.md)
{% endhint %}

## FAQ <a href="#faq" id="faq"></a>

### Q1: Do citations show every referenced document? <a href="#faq-show-all-referenced-documents" id="faq-show-all-referenced-documents"></a>

Not necessarily. The system shows the "most relevant" citations, usually no more than 3-5, to avoid information overload.

### Q2: Can I hide citations? <a href="#faq-hide-citation" id="faq-hide-citation"></a>

Yes. Turn off the "Show citations" option in the Agent settings.

### Q3: Can I fix the citation language to a specific language? <a href="#faq-fix-citation-language" id="faq-fix-citation-language"></a>

Citations automatically follow the Web Chat language setting. If you want to fix a specific language, set the language option in the Web Chat settings.

### Q4: Are citation links clickable? <a href="#faq-citation-clickable-link" id="faq-citation-clickable-link"></a>

Yes. If you set an external link in a knowledge base document, the citation is displayed as a clickable link.

### Q5: What if citations are hard to read in dark mode? <a href="#faq-citation-dark-mode-visibility" id="faq-citation-dark-mode-visibility"></a>

The system has been optimized for dark mode. If you still have problems, it may be a browser cache issue; try clearing the cache or refreshing the page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/maiagent-user-guide/en/build/choose-channel/web-chat/citation-display.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
