# 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](/platform/nlx-platform-guide/flows-and-building-blocks/knowledge-bases/ingest-content.md#custom-beta) and when invoked through the [*Knowledge base node*](/platform/nlx-platform-guide/flows-and-building-blocks/overview/nodes.md#knowledge-base) in a flow.
{% endhint %}

*Metadata* refers to the optional filters or parameters placed on the retrieval request when your knowledge base [content](/platform/nlx-platform-guide/flows-and-building-blocks/knowledge-bases/ingest-content.md) is called via a [*Knowledge base* node](/platform/nlx-platform-guide/flows-and-building-blocks/overview/nodes.md#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](/platform/nlx-platform-guide/flows-and-building-blocks/overview/nodes.md#knowledge-base) side panel when the node is hit in a flow.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/knowledge-bases/add-metadata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
