In this section, we present how to connect ChromaDB to MindsDB. ChromaDB is the open-source embedding database. Chroma makes it easy to build LLM apps by making knowledge, facts, and skills pluggable for LLMs.Documentation Index
Fetch the complete documentation index at: https://docs.mindsdb.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before proceeding, ensure the following prerequisites are met:- Install MindsDB locally via Docker or Docker Desktop.
- To connect ChromaDB to MindsDB, install the required dependencies following this instruction.
- Install or ensure access to ChromaDB.
Connection
This handler is implemented using thechromadb Python library.
To connect to a remote ChromaDB instance, use the following statement:
host: The host name or IP address of the ChromaDB instance.port: The TCP/IP port of the ChromaDB instance.distance: It defines how the distance between vectors is calculated. Available method include l2, cosine, and ip, as explained here.
persist_directory: The directory to use for persisting data.distance: It defines how the distance between vectors is calculated. Available method include l2, cosine, and ip, as explained here.
Usage
Now, you can use the established connection to create a collection (or table in the context of MindsDB) in ChromaDB and insert data into it:mysql_datasource is another MindsDB data source that has been created by connecting to a MySQL database. The test_embeddings table in the mysql_datasource data source contains the embeddings that we want to store in ChromaDB.