๐Ÿ”ขAdd embeddings

Add custom text embeddings to ChromaDB

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

POST /add/texts

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

Query Parameters

NameTypeDescription

texts*

List

List of text strings

metadatas

List

List of metadata dictionaries

{
  "ids": [
    "f2e437e7-90e9-4809-9499-a752b52ca3a4",
    "8197560f-aeaf-403e-b61c-dce9babb9471"
  ],
  "success": true
}
Example curl request
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"}
         ]
     }'

Last updated