API Behavior
The Green Vectors API is designed to consolidate a collection of input vectors into a set of faceted or "categorized" vectors, ensuring dynamic handling of both existing and new facets.
Input Vector Assignment to Facets
Each input vector can contribute to one or more facets, as defined in its
facetWeights
object.The contribution of the input vector to a facet is determined by the specified weight for that facet.
Handling Existing Facets
If the facet name from
facetWeights
exists in thefacetVectors
object:The input vector is merged with the existing facet using the specified weight.
The result is a recalculated faceted vector embedding for that facet.
Creating New Facets
If the facet name from
facetWeights
does not exist in thefacetVectors
object:A new facet is created with the name and vector embedding based on the input vector.
The new facet is included in the API response.
Merging Vectors
When merging input vectors to an existing facet, the API combines the vectors using the specified weights. This ensures the resulting facet embedding reflects the weighted contributions of all associated input vectors.
Example Workflow
Example Request:
Example Response:
Developer Notes
Dynamic Facet Management: The API dynamically handles the addition of new facets, making it flexible for datasets with evolving categories.
Weighted Vector Contribution: The weights allow fine-grained control over how strongly each input vector influences the resulting faceted vector.
Efficient Updates: Existing facets are updated in place, ensuring minimal overhead while maintaining the integrity of previous data.
Last updated