> For the complete documentation index, see [llms.txt](https://docs.nlx.ai/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/knowledge-bases/support-citations.md).

# Support citations

## What are *citations* of a *Knowledge base*?

{% hint style="warning" %}
Citations are currently best optimized for *Documents*, *External*, or *Custom* knowledge base types.
{% endhint %}

*Citations* are references that point to the original source of information when your conversational AI delivers a response from a knowledge base. Citations show where the information comes from, allowing users to verify an answer's accuracy and explore its sources.

In the AI's response, citations will appear inline with number indicators `[1]` and an accompanying `sources` section to correlate with each numbered citation:

<figure><img src="/files/3vOKZ1eVRuCKNXQkPeGl" alt=""><figcaption><p>Source citations using NLX's Touchpoint framework</p></figcaption></figure>

## Create citation modality

To appropriately render citations in your AI's response using [Touchpoint](broken://spaces/t5aE1E0ldkTW4JnyIYGZ), first create a citation modality:

* Select *Resources > Modalities* in your workspace menu
* Select *New modality* > Provide a name (e.g., `KBCitation`)
* Select :sparkles: *Auto-generate*
* Paste sample JSON schema provided below
* Click *Set schema*
* Click *Save*

Citation modality schema:

```json
[
  {
    "content": "",
    "fileName": "",
    "pageNumber": 1,
    "score": 1
  }
]
```

## Citation setup in flow

Once your modality is created, you'll set up your *Knowledge base* with citation support in a flow:

* Select *Flows* in your workspace menu *>* Choose or create a flow
* Add a *Knowledge base* node to the Canvas > Assign the knowledge base created in your workspace to the node
* Enter `{System.utterance}` in the node's *Question* field
* Expand the node's *Settings* section > Enable *Include citation*
* From the *Match* edge of the *Knowledge base* node, add and link a *User choice* node
* On the *User choice* node, add `{Response.answer)` as a message > Assign a [custom Yes/No slot](/platform/nlx-platform-guide/flows-and-building-blocks/advanced/slots-custom.md) to the node
* Select *Add functionality* on the *User choice* node > Choose *Modalities*
* Select the modality you created in the previous step (e.g., `KBCitation`) > Toggle ON *Enable*
* Set the modality's payload value to `{Response.sources}`
* Click *Save*

Note that while using the [Test](/platform/nlx-platform-guide/ai-applications/testing.md) widget in your workspace, the citation modality will not render for test chats. Instead, deploy a build of your application to launch the Touchpoint configurator and experience it live.

{% hint style="success" %}
Once you've created a build and deployed your application, access the Touchpoint configurator from [deployment details](/platform/nlx-platform-guide/ai-applications/setup.md#deployment) to install the Touchpoint SDK to your site.
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/knowledge-bases/support-citations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
