From 902b5c066e467e0d84b0cfaedd62e9c618b21f00 Mon Sep 17 00:00:00 2001 From: Itai Smith Date: Tue, 5 Aug 2025 18:49:49 -0700 Subject: [PATCH] Update Chroma notebook --- .../Using_Chroma_for_embeddings_search.ipynb | 30 +++++++++++++++---- .../chroma/hyde-with-chroma-and-openai.ipynb | 6 ++-- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/examples/vector_databases/chroma/Using_Chroma_for_embeddings_search.ipynb b/examples/vector_databases/chroma/Using_Chroma_for_embeddings_search.ipynb index cdeb6d61ad..98352ae6da 100644 --- a/examples/vector_databases/chroma/Using_Chroma_for_embeddings_search.ipynb +++ b/examples/vector_databases/chroma/Using_Chroma_for_embeddings_search.ipynb @@ -513,7 +513,7 @@ "source": [ "# Chroma\n", "\n", - "We'll index these embedded documents in a vector database and search them. The first option we'll look at is **Chroma**, an easy to use open-source self-hosted in-memory vector database, designed for working with embeddings together with LLMs. \n", + "We'll index these embedded documents in a vector database and search them. The first option we'll look at is **Chroma**, an easy to use open-source vector database, designed for working with embeddings together with LLMs.\n", "\n", "In this section, we will:\n", "- Instantiate the Chroma client\n", @@ -528,8 +528,11 @@ "source": [ "### Instantiate the Chroma client\n", "\n", - "Create the Chroma client. By default, Chroma is ephemeral and runs in memory. \n", - "However, you can easily set up a persistent configuration which writes to disk." + "Create the Chroma client. There are several ways to run a Chroma server and connect to it:\n", + "* In memory using the `EphemeralClient`\n", + "* Locally with data persistence using the `PersistentClient`\n", + "* You can run Chroma on your own server and connect to it using the `HttpClient`\n", + "* Using Chroma Cloud, and connecting to your DB using the `CloudClient`." ] }, { @@ -540,8 +543,23 @@ "outputs": [], "source": [ "chroma_client = chromadb.EphemeralClient() # Equivalent to chromadb.Client(), ephemeral.\n", + "\n", "# Uncomment for persistent client\n", - "# chroma_client = chromadb.PersistentClient()" + "# chroma_client = chromadb.PersistentClient()\n", + "\n", + "# Uncomment for connecting to a remote Chroma server\n", + "# chroma_client = chromadb.HttpClient(\n", + "# ssl=False,\n", + "# host='localhost',\n", + "# port=8000\n", + "# )\n", + "\n", + "# Uncomment for connecting to ChromaCloud\n", + "# chroma_client = chromadb.CloudClient(\n", + "# tenant=os.getenv(\"CHROMA_TENANT\"),\n", + "# database=os.getenv(\"CHROMA_DATABASE\"),\n", + "# api_key=os.getenv(\"CHROMA_API_KEY\"),\n", + "# )" ] }, { @@ -873,7 +891,7 @@ ], "metadata": { "kernelspec": { - "display_name": "chroma_openai", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -887,7 +905,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.13.0" } }, "nbformat": 4, diff --git a/examples/vector_databases/chroma/hyde-with-chroma-and-openai.ipynb b/examples/vector_databases/chroma/hyde-with-chroma-and-openai.ipynb index 1274618bfb..4020242c68 100644 --- a/examples/vector_databases/chroma/hyde-with-chroma-and-openai.ipynb +++ b/examples/vector_databases/chroma/hyde-with-chroma-and-openai.ipynb @@ -972,7 +972,7 @@ ], "metadata": { "kernelspec": { - "display_name": ".venv", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -986,9 +986,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.10" + "version": "3.13.0" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }