This page covers configuration and management of View vector repository objects.

Object Overview

Vector repositories define the properties by which vector data is stored within View.

Endpoint, URL, and Supported Methods

Objects are managed via the configuration server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/vectorrepositories

By default, the configuration server is accessible on port 8601.

Supported methods include: GET HEAD PUT DELETE

Structure

Objects have the following structure:

{
    "GUID": "example-vector-repository",
    "TenantGUID": "default",
    "Name": "My knowledgebase",
    "RepositoryType": "Pgvector",
    "Model": "all-MiniLM-L6-v2",
    "Dimensionality": 384,
    "DatabaseHostname": "pgvector",
    "DatabaseName": "vectordb",
    "DatabaseTable": "minilm",
    "DatabasePort": 5432,
    "DatabaseUser": "postgres",
    "DatabasePassword": "password",
    "PromptPrefix": "You are an AI assistant augmented with a retrieval system. Carefully analyze the provided pieces of context and the user query at the end. Rely primarily on the provided context for your response. If the context is not enough for you to answer the question, please politely explain that you do not have enough relevant information to answer. Do not try to make up an answer. Do not attempt to answer using general knowledge. Only use general knowledge to clarify context information if absolutely necessary.",
    "CreatedUtc": "2024-07-10T05:09:32.000000Z"
}

Properties:

  • GUID string globally unique identifier for the object
  • TenantGUID string globally unique identifier for the tenant
  • Name string name of the object
  • RepositoryType string the type of vector repository (currently only Pgvector
  • Model string the name of the language model from which embeddings stored in this repository were generator
  • Dimensionality int the dimensionality of the embeddings, i.e. the number of array elements
  • DatabaseHostname string the database hostname
  • DatabaseName string the name of the database
  • DatabaseTable string the table in which data is stored
  • DatabasePort int the port on which the database is accessed
  • DatabaseUser string the username used to access the database
  • DatabasePassword string the password associated with the user to access the database
  • PromptPrefix string the prompt prefix that should be prepended to prompts when using this vector repository
  • CreatedUtc datetime timestamp from creation, in UTC time

Create

To create, call PUT /v1.0/tenants/[tenant-guid]/vectorrepositories with the following properties using the configuration server: Name RepositoryType Model Dimensionality DatabaseHostname DatabaseName DatabaseTable DatabasePort DatabaserUser DatabasePassword

{
    "Name": "Another vector repository",
    "RepositoryType": "Pgvector",
    "Model": "all-MiniLM-L6-v2",
    "Dimensionality": 384,
    "DatabaseHostname": "localhost",
    "DatabaseName": "vectordb",
    "DatabaseTable": "testtable",
    "DatabasePort": 5432,
    "DatabaseUser": "postgres",
    "DatabasePassword": "password"
}

Enumerate

Refer to the Enumeration page in REST API for details about the use of enumeration APIs.

Enumerate metadata rule objects by using GET /v2.0/tenants/[tenant-guid]/vectorrepositories. The resultant object will appear as:

{
    "Success": true,
    "Timestamp": {
        "Start": "2024-10-21T02:36:37.677751Z",
        "TotalMs": 23.58,
        "Messages": {}
    },
    "MaxResults": 10,
    "IterationsRequired": 1,
    "EndOfResults": true,
    "RecordsRemaining": 16,
    "Objects": [
        {
            "GUID": "example-vectorrepository",
            ... vectorrepository details ...
        },
        { ... }
    ],
    "ContinuationToken": "[continuation-token]"
}

Read

To read an object by GUID, call GET /v1.0/tenants/[tenant-guid]/embeddingsrule/[embeddingsrule-guid]. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound error response.

{
    "GUID": "59f7c18d-7342-4aef-9308-86083459dd81",
    "TenantGUID": "default",
    "BucketGUID": "example-data-bucket",
    "OwnerGUID": "default",
    "Name": "Embeddings rule",
    "ContentType": "*",
    "TargetBucketGUID": "example-embeddings-bucket",
    "VectorRepositoryGUID": "example-vector-repository",
    "DataFlowEndpoint": "http://localhost:8501/processor",
    "EmbeddingsGenerator": "LCProxy",
    "GeneratorUrl": "http://localhost:8301/",
    "GeneratorApiKey": "[huggingface API key]",
    "BatchSize": 16,
    "MaxGeneratorTasks": 16,
    "MaxRetries": 3,
    "MaxFailures": 3,
    "VectorStoreUrl": "http://localhost:8311/",
    "MaxContentLength": 16777216,
    "CreatedUtc": "2024-10-21T15:19:09.000000Z"
}

Note: the HEAD method can be used as an alternative to get to simply check the existence of the object. HEAD requests return either a 200/OK in the event the object exists, or a 404/Not Found if not. No response body is returned with a HEAD request.

Update

To update an object by GUID, call PUT /v1.0/tenants/[tenant-guid]/vectorrepositories/[vectorrepository-guid] with a fully populated object in the request body. The updated object will be returned to you.

Note: certain fields cannot be modified and will be preserved across updates.

Request body:

{
    "Name": "Updated vector repository",
    "RepositoryType": "Pgvector",
    "Model": "all-MiniLM-L6-v2",
    "Dimensionality": 384,
    "DatabaseHostname": "localhost",
    "DatabaseName": "vectordb",
    "DatabaseTable": "testtable",
    "DatabasePort": 5432,
    "DatabaseUser": "postgres",
    "DatabasePassword": "password",
    "PromptPrefix": "Use the following pieces of context to answer the question at the end.  Documents are sorted by similarity to the question.  If the context is not enough for you to answer the question, politely explain that you don't have relevant context.  Do not try to make up an answer.",
}

Response body:

{
    "GUID": "57082e60-5a3d-44ed-bc3c-4b3ac8d1dbe5",
    "TenantGUID": "default",
    "Name": "Updated vector repository",
    "RepositoryType": "Pgvector",
    "Model": "all-MiniLM-L6-v2",
    "Dimensionality": 384,
    "DatabaseHostname": "localhost",
    "DatabaseName": "vectordb",
    "DatabaseTable": "testtable",
    "DatabasePort": 5432,
    "DatabaseUser": "postgres",
    "DatabasePassword": "password",
    "PromptPrefix": "Use the following pieces of context to answer the question at the end.  Documents are sorted by similarity to the question.  If the context is not enough for you to answer the question, politely explain that you don't have relevant context.  Do not try to make up an answer.",
    "CreatedUtc": "2024-10-21T15:42:40.000000Z"
}

Delete

To delete an object by GUID, call DELETE /v1.0/tenants/[tenant-guid]/vectorrepositories/[vectorrepository-guid].