---
title: "Chroma"
lang: "en-US"
draft: false
description: "Learn about how to set up a VDP Chroma component https://github.com/instill-ai/instill-core"
---
The Chroma component is a data component that allows users to build and search vector datasets.
It can carry out the following tasks:
- [Batch Upsert](#batch-upsert)
- [Upsert](#upsert)
- [Query](#query)
- [Delete](#delete)
- [Create Collection](#create-collection)
- [Delete Collection](#delete-collection)
## Release Stage
`Alpha`
## Configuration
The component configuration is defined and maintained [here](https://github.com/instill-ai/component/blob/main/data/chroma/v0/config/definition.json).
## Setup
In order to communicate with Chroma, the following connection details need to be
provided. You may specify them directly in a pipeline recipe as key-value pairs
withing the component's `setup` block, or you can create a **Connection** from
the [**Integration Settings**](https://www.instill.tech/docs/vdp/integration)
page and reference the whole `setup` as `setup:
${connection.<my-connection-id>}`.
| Field | Field ID | Type | Note |
| :--- | :--- | :--- | :--- |
| API Key (required) | `api-key` | string | Fill in your Chroma API key |
| Chroma URL Endpoint (required) | `url` | string | Fill in your Chroma hosted public URL endpoint with port, e.g http://1.2.3:8000 |
## Supported Tasks
### Batch Upsert
Upsert multiple vector items into a collection, existing items will be updated
| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_BATCH_UPSERT` |
| Collection Name (required) | `collection-name` | string | The name of the collection to upsert the item into |
| Array ID (required) | `array-id` | array[string] | The array of id |
| Array Metadata (required) | `array-metadata` | array[object] | The array of vector metadata |
| Array Vector (required) | `array-vector` | array[array] | The array of vector values |
| Array Document | `array-document` | array[string] | The array of document string values |
| Array URI | `array-uri` | array[string] | The array of uri |
| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Status | `status` | string | Batch add status |
### Upsert
Upsert a vector item into a collection, existing item will be updated
| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_UPSERT` |
| Collection Name (required) | `collection-name` | string | The name of the collection to upsert the item into |
| ID (required) | `id` | string | The ID of the item |
| Metadata (required) | `metadata` | object | The vector metadata |
| Vector (required) | `vector` | array[number] | An array of dimensions for the vector value |
| Document | `document` | string | The document string value |
| URI | `uri` | string | The uri of the item |
| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Status | `status` | string | Add status |
### Query
Perform a vector search on a collection
| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_QUERY` |
| Collection Name (required) | `collection-name` | string | The name of the collection to perform vector similarity search on |
| Vector (required) | `vector` | array[number] | An array of dimensions for the vector query. |
| N Results (required) | `n-results` | integer | The N amount of items to return from the vector search operation |
| Filter | `filter` | object | The metadata filter to be applied to the data with Chroma where filter, please refer to [using-where-filters](https://docs.trychroma.com/guides#using-where-filters) |
| Filter Document | `filter-document` | string | The document content filter to be applied to the data, please refer to [filtering-by-document-contents](https://docs.trychroma.com/guides#filtering-by-document-contents) |
| Fields | `fields` | array[string] | The fields to be returned from the vector search operation |
| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Result | `result` | object | Result of the vector search operation |
| Status | `status` | string | Vector search status |
### Delete
Delete vector items from a collection
| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_DELETE` |
| Collection Name (required) | `collection-name` | string | The name of the collection to delete the object from |
| ID | `id` | string | The ID of the item |
| Filter | `filter` | object | The metadata filter to be applied to the data with Chroma where filter, please refer to [using-where-filters](https://docs.trychroma.com/guides#using-where-filters) |
| Filter Document | `filter-document` | string | The document content filter to be applied to the data, please refer to [filtering-by-document-contents](https://docs.trychroma.com/guides#filtering-by-document-contents) |
| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Status | `status` | string | Delete status |
### Create Collection
Create a collection
| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_CREATE_COLLECTION` |
| Collection Name (required) | `collection-name` | string | The name of the collection to create |
| Config | `metadata` | object | The metadata of the collection. Please refer to [creating-inspecting-and-deleting-collection](https://docs.trychroma.com/guides#creating,-inspecting,-and-deleting-collections) |
| Configuration | `configuration` | object | The configuration of the collection. Please refer to [creating-inspecting-and-deleting-collection](https://docs.trychroma.com/guides#creating,-inspecting,-and-deleting-collections) |
| Get or Create | `get-or-create` | boolean | If true, the collection will be created if it does not exist |
| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Status | `status` | string | Create collection status |
### Delete Collection
Delete a collection
| Input | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Task ID (required) | `task` | string | `TASK_DELETE_COLLECTION` |
| Collection Name (required) | `collection-name` | string | The name of the collection to delete |
| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Status | `status` | string | Delete collection status |