# 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>


---

# 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://vigil.deadbits.ai/overview/customize-detections/add-embeddings.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.
