# Add metadata

## What's *Metadata* of a *Knowledge base*?

{% hint style="warning" %}
Metadata is currently only supported for *Q\&A* or *External* [knowledge base integrations](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/ingest-content#custom-beta) and when invoked through the [*Knowledge base node*](https://docs.nlx.ai/platform/nlx-platform-guide/overview/nodes#knowledge-base) in a flow.
{% endhint %}

*Metadata* refers to the optional filters or parameters placed on the retrieval request when your knowledge base [content](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/knowledge-bases/ingest-content) is called via a [*Knowledge base* node](https://docs.nlx.ai/platform/nlx-platform-guide/overview/nodes#knowledge-base). This is useful as your data can become massive in scale.&#x20;

Imagine, for example, you have a large collection of insurance questions, but for a specific user query, you only want to search within the user's own insurance policy. In this case, you can use *Metadata* to tag each question (e.g., by user ID group) that acts as a filter during retrieval. This ensures only matching insurance questions are searched, improving speed and relevance.

## Including *Metadata*

To include metadata for your knowledge base content, enter the supporting JSON schema that will act as a filter.&#x20;

Sample metadata schema:

```json
{
  "documentId": "",
  "policyholderId": "",
  "documentType": "",
  "coverageType": "",
  "effectiveDate": "",
  "language": "",
  "state": "",
  "sensitive": true
}
```

{% @arcade/embed flowId="nehxtEz4Xvt2ttaX4LsA" url="<https://app.arcade.software/share/nehxtEz4Xvt2ttaX4LsA>" %}

* Select *Metadata* tab of a selected *Q\&A* or *External Knowledge base*
* Select :sparkles: *Auto-generate >* Enter/paste JSON schema and click *Generate*
* Click *Save*

For a *Q\&A* *Knowledge base*, complete the following to provide the metadata attributes to applicable question entries:

* Select the *Q\&A* tab
* Expand a question > Select *+ Add metadata*
* Enter any applicable values for the metadata > Repeat as needed
* Click *Save*
* Select *Publish* tab > Publish a new version

{% hint style="success" %}
After providing metadata, you can now apply the filters on the [*Knowledge base* node's](https://docs.nlx.ai/platform/nlx-platform-guide/overview/nodes#knowledge-base) side panel when the node is hit in a flow.
{% endhint %}
