CreateGreenVectors

Green Vectors is a product which makes vector storage more efficient while providing more accurate and faster search capability.

Add new vectors

POST /vectors

This endpoint is used to convert existing vector embeddings into a faceted vector embedding.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <your token>

Request Body

Attribute Parameters

  • facetVectors array (required) A array containing existing facets with facet names mapped to their current vector embeddings. ONLY provide this array for existing facets returned from our response. When converting a database, there will most likely be no existing facets. For the first call to our system, this attribute can be an empty array (see the initial call example below). Our response will contain the new facet and a vector. For subsequent calls, this facet and vector will be merged into for new input vectors.

  • inputVectors array (required) An array of vector objects being merged to a facet.

    • vector object (required) This will be the input vector. This vector can be merged into multiple facets by adding the facet name and its weight pertaining to that facet.

    • facetWeights dictionary object (required) It's possible for a vector to be merged into multiple facets by adding the facet name and its weight pertaining to that facet. If a vector is part of multiple facets, provide the name of each facet and the weight of this vector pertaining to that facet

{
  "facetVectors": [
    {
      "facet": "[facet_name]"
      "vector": [0.1, 0.2, 0.3]
    }
  ],
  "inputVectors": [
    {
      "vector": [0.2, 0.3, 0.4],
      "facetWeights": {
        "[facet_name]": 0.5 // the weight of this vector pertaining to this facet
        ......  // other facet names if vector belongs to multiple facets
      }
    },
    {
      "vector": [0.3, 0.4, 0.5],
      "facetWeights": {
        "[facet_name]": 0.7 // the weight of this vector pertaining to this facet
        ......  // other facet names if vector belongs to multiple facets
      }
    }
  ]
}

Example - Initial Call Request

{
  "facetVectors": [],
  "inputVectors": [
    {
      "vector": [0.2, 0.3, 0.4],
      "facetWeights": {
        "Clothing": 0.5
      }
    },
    {
      "vector": [0.3, 0.4, 0.5],
      "facetWeights": {
        "Clothing": 0.7
      }
    }
  ]
}

Example - Initial Call Response

{
    "Clothing": [0.19500001, 0.29500002, 0.395]
}

Example - Subsequent Call Request for Category facet

{
  "facetVectors": {
    "Category": [0.19500001, 0.29500002, 0.395]// the above response from initial call
  },
  "inputVectors": [
    {
      "vector": [0.2, 0.3, 0.4],
      "facetWeights": {
        "Clothing": 0.5
      }
    },
    {
      "vector": [0.3, 0.4, 0.5],
      "facetWeights": {
        "Clothing": 0.7
      }
    }
  ]
}

Example - Subsequent Call Response for merged Category facet

{
    "Clothing": [0.85400001, 0.3435002, 0.5454544]
}

Last updated