You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/chroma.adoc
+45-5Lines changed: 45 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,9 @@ link:https://docs.trychroma.com/[Chroma] is the open-source embedding database.
6
6
7
7
== Prerequisites
8
8
9
-
1. Access to ChromeDB. The <<Run Chroma Locally, setup local ChromaDB>> appendix shows how to set up a DB locally with a Docker container.
9
+
1. Access to ChromaDB. Compatible with link:https://trychroma.com/signup[Chroma Cloud], or <<run Chroma Locally, setup local ChromaDB>> in the appendix shows how to set up a DB locally with a Docker container.
10
+
- For Chroma Cloud: You'll need your API key, tenant name, and database name from your Chroma Cloud dashboard.
11
+
- For local ChromaDB: No additional configuration required beyond starting the container.
10
12
11
13
2. `EmbeddingModel` instance to compute the document embeddings. Several options are available:
12
14
- If required, an API key for the xref:api/embeddings.adoc#available-implementations[EmbeddingModel] to generate the embeddings stored by the `ChromaVectorStore`.
@@ -72,12 +74,16 @@ A simple configuration can either be provided via Spring Boot's _application.pro
|`spring.ai.vectorstore.chroma.tenant-name`| Tenant (required for Chroma Cloud) | `SpringAiTenant`
133
+
|`spring.ai.vectorstore.chroma.database-name`| Database name (required for Chroma Cloud) | `SpringAiDatabase`
126
134
|`spring.ai.vectorstore.chroma.collection-name`| Collection name | `SpringAiCollection`
127
-
|`spring.ai.vectorstore.chroma.initialize-schema`| Whether to initialize the required schema | `false`
135
+
|`spring.ai.vectorstore.chroma.initialize-schema`| Whether to initialize the required schema (creates tenant/database/collection if they don't exist) | `false`
128
136
|===
129
137
130
138
[NOTE]
@@ -134,6 +142,36 @@ For ChromaDB secured with link:https://docs.trychroma.com/usage-guide#static-api
134
142
For ChromaDB secured with link:https://docs.trychroma.com/usage-guide#basic-authentication[Basic Authentication] use the `ChromaApi#withBasicAuth(<your user>, <your password>)` method to set your credentials. Check the `BasicAuthChromaWhereIT` for an example.
135
143
====
136
144
145
+
=== Chroma Cloud Configuration
146
+
147
+
For Chroma Cloud, you need to provide the tenant and database names from your Chroma Cloud instance. Here's an example configuration:
- The tenant and database names must match your Chroma Cloud configuration
172
+
- Set `initialize-schema=true` to automatically create the collection if it doesn't exist (it won't recreate existing tenant/database)
173
+
====
174
+
137
175
== Metadata filtering
138
176
139
177
You can leverage the generic, portable link:https://docs.spring.io/spring-ai/reference/api/vectordbs.html#_metadata_filters[metadata filters] with ChromaVector store as well.
@@ -238,6 +276,8 @@ Integrate with OpenAI's embeddings by adding the Spring Boot OpenAI starter to y
238
276
@Bean
239
277
public VectorStore chromaVectorStore(EmbeddingModel embeddingModel, ChromaApi chromaApi) {
0 commit comments