# Add embeddings

Vigil uses ChromaDB to store text embeddings. Any embeddings submitted to the `collection` specified in your configuration file will be used by the `vectordb` scanner when analyzing prompts.

The API server has an endpoint for submitting text to the database. The text will be embedded according to your `conf/server.conf` file at index time.

## Add new text to the vector database

<mark style="color:green;">`POST`</mark> `/add/texts`

Submit text to the vector database (embedded at index time per config file)

#### Query Parameters

| Name                                    | Type | Description                   |
| --------------------------------------- | ---- | ----------------------------- |
| texts<mark style="color:red;">\*</mark> | List | List of text strings          |
| metadatas                               | List | List of metadata dictionaries |

{% tabs %}
{% tab title="200: OK List of stored document IDs" %}

```json
{
  "ids": [
    "f2e437e7-90e9-4809-9499-a752b52ca3a4",
    "8197560f-aeaf-403e-b61c-dce9babb9471"
  ],
  "success": true
}

```

{% endtab %}
{% endtabs %}

<details>

<summary>Example curl request</summary>

```bash
curl -X POST "http://127.0.0.1:5000/add/texts" \
     -H "Content-Type: application/json" \    --data '{
         "texts": ["Hello, world!", "Blah blah."],
         "metadatas": [
             {"author": "John", "date": "2023-09-17"},
             {"author": "Jane", "date": "2023-09-10", "topic": "cybersecurity"}
         ]
     }'
```

</details>
