Search⌘ K
AI Features

Storing Audio and Metadata Embeddings to Vector Database

Explore how to use Chroma DB to store audio and metadata embeddings for a music recommendation system. Learn to create collections, add embeddings data, and prepare for querying similar songs, enabling you to optimize and develop intelligent music apps.

We’ll use Chroma DB to store our embeddings. Let’s jump right in.

Create a chroma client

First, we import chromadb and initialize a persistent Chroma client. This setup ensures that the database is saved and loaded on our local machine, with data being automatically persisted and reloaded upon startup if it exists.

Python 3.10.4
import chromadb
client = chromadb.PersistentClient(path="/usr/local/musicRecommendationSystemDir/database")

Create collections for storing metadata and audio embeddings

...