> For the complete documentation index, see [llms.txt](https://help.botpenguin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.botpenguin.com/ai-agents/metadata.md). Agents can also search and read this documentation through its [MCP server](https://help.botpenguin.com/~gitbook/mcp).

# MetaData

Metadata is a detail your AI agent picks up from a chat and saves to the contact, for example a name, an email or an order number. You can then filter, search and use these details in other parts of BotPenguin.

### Prerequisites

* An AI agent. See Create your first AI Agent.
* A list of the details you want the agent to collect. Choose only what you will use. \[CHECK: confirm the plan and role needed.]

### Key definitions

| Term         | Meaning                                                                                                |
| ------------ | ------------------------------------------------------------------------------------------------------ |
| Metadata     | A detail the agent collects from a chat and saves to the contact.                                      |
| Metadata key | A short unique name used to refer to the metadata. It uses lowercase letters, numbers and underscores. |
| Default      | Built-in metadata: Name, Email and Phone. You cannot edit or delete these.                             |
| Custom       | Metadata you add yourself.                                                                             |

### Steps

1. Open **Metadata** under Setup in the AI Agent sidebar.

![Click Metadata under Setup](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/HXhiB1IWHj09m53nrJQy/images/meta-data-step-1.png)

2. Read the table. It has four columns: Metadata name, Category, Collect from chats and Actions.

![The table lists each metadata and whether it is collected](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/ZU1lzkfw849ODBUJsSPz/images/meta-data-step-2.png)

3. Type in **Search by metadata name** to find one. Click **Filter metadata** to filter by Status (All, Active or Inactive) and by Category.

![Search or filter the metadata list](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/rromUlIS83xPabWNFv6v/images/meta-data-step-3.png)

4. Use the switch in Collect from chats to turn collection on or off for a metadata. When it is on, the agent collects that detail during chats.

![Turn Collect from chats on or off for a metadata](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/nuOWd9Jz1mQ1c2Qgcq5R/images/meta-data-step-4.png)

5. Click **Add metadata** to create your own.

![Click Add metadata to create your own](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/zolvj6lHVfVz3Y3WsCB1/images/meta-data-step-5.png)

6. Type a Metadata name, for example Customer city. The Metadata key fills in for you. You can change it. Use lowercase letters, numbers and underscores.

![Type the Metadata name and check the key](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/R45yrhpLT2SglPs4fSBl/images/meta-data-step-6.png)

7. Choose a Type, such as Single Line Text, Date Picker or Number. Then, in Prompt, write how the agent should collect or use it. Example: "Ask which city the customer is in if they have not said."

![Choose the Type and write the Prompt](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/1ddJhfkwLZ1C0XYMXrNL/images/meta-data-step-7.png)

8. Click **Add metadata** in the form to save it. The button stays grey until the name and key are filled in. For a choice type, add at least two options.

![Click Add metadata to save the new metadata](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/3tk0Nl3fOKOorGfTbu9o/images/meta-data-step-8.png)

9. To change or remove metadata you added, click its edit or delete icon in the Actions column. Default metadata cannot be edited or deleted.

![Edit or delete metadata in the Actions column](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/WerDFAl4I9FCU53YaAU5/images/meta-data-step-9.png)

10. Click **Update** to save your changes to the page.

![Click Update to save the page](https://content.gitbook.com/content/APDb8cKQtGlIAfgHjcsQ/blobs/iPGGJowTo19WUSvJSseZ/images/meta-data-step-10.png)

### Common errors

<details>

<summary>I cannot edit or delete Name, Email or Phone</summary>

These are default metadata. They are always available. You can turn collection on or off with the switch, but you cannot edit or delete them.

</details>

<details>

<summary>The Add metadata button is grey</summary>

Fill in the Metadata name and the Metadata key. For a choice type such as Radio Select, add at least two options.

</details>

<details>

<summary>It says my key already exists</summary>

Each key must be unique. Change the key, for example add a word to it.

</details>

<details>

<summary>It says my key is not valid</summary>

Start the key with a letter. Use only lowercase letters, numbers and underscores.

</details>

<details>

<summary>The agent is not collecting a detail</summary>

Check that the Collect from chats switch is on. Check that the Type matches the answer customers give, and that the Prompt says how to ask for it.

</details>

<details>

<summary>I cannot find a metadata in the list</summary>

Clear the search box and the filters. A status or category filter may be hiding it. Use Load more to see more rows.

</details>

### Support

Still not working? Write to us at <support@botpenguin.com>. We will reach out to you within 24 hours.
