๐Ÿ”ฌ
Vigil: Documentation
GitHub Repo
  • ๐Ÿ›ก๏ธVigil
  • Overview
    • ๐Ÿ—๏ธRelease Blog
    • ๐Ÿ› ๏ธInstall Vigil
      • ๐Ÿ”ฅInstall PyTorch (optional)
    • ๐ŸงชUse Vigil
      • โš™๏ธConfiguration
        • ๐Ÿ”„Auto-updating vector database
      • ๐Ÿ—„๏ธLoad Datasets
      • ๐ŸŒWeb server
        • ๐ŸคAPI Endpoints
        • ๐ŸชWeb UI playground
      • ๐ŸPython library
      • ๐ŸŽฏScanners
        • ๐Ÿค—Transformer
        • โ•YARA / Heuristics
        • ๐Ÿ“‘Prompt-response Similarity
        • ๐Ÿ’พVector database
        • ๐ŸคCanary Tokens
    • ๐Ÿ›ก๏ธCustomize Detections
      • ๐ŸŒŸAdd custom YARA signatures
      • ๐Ÿ”ขAdd embeddings
      • ๐ŸCustom scanners
    • ๐Ÿช„Sample scan results
Powered by GitBook
On this page
  1. Overview
  2. Customize Detections

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

Name
Type
Description

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"}
         ]
     }'
PreviousAdd custom YARA signaturesNextCustom scanners

Last updated 1 year ago

๐Ÿ›ก๏ธ
๐Ÿ”ข