Skip to main content

Chroma Integration

inertialai-chroma is the official InertialAI embedding function for ChromaDB. It connects InertialAI's inertial-embed-alpha foundation model directly to any Chroma collection, enabling semantic search over text, raw time-series sensor data, or both simultaneously — all through Chroma's standard Python API.

How It Works

InertialAIEmbeddingFunction implements Chroma's EmbeddingFunction[Documents] interface. When you attach it to a collection, Chroma calls it automatically on every add() and query() operation. The package handles authentication, request formatting, and parsing the response into the float32 vectors Chroma expects — you never interact with InertialAI's HTTP API directly.

import chromadb
from inertialai_chroma import InertialAIEmbeddingFunction

client = chromadb.HttpClient(host="localhost", port=8000)
ef = InertialAIEmbeddingFunction() # reads INERTIALAI_API_KEY from env

collection = client.create_collection("my-sensors", embedding_function=ef)

collection.add(
documents=[
"temperature spike at noon",
"stable overnight readings",
"pressure anomaly detected",
],
ids=["doc-1", "doc-2", "doc-3"],
)

results = collection.query(query_texts=["unusual thermal event"], n_results=2)
print(results["documents"])

InertialAI's API is called in the background on every add() and query().

Key Features

FeatureDetails
Input modesText-only, time-series-only, and multi-modal (text + time-series) in the same collection
Multi-modal formatPass json.dumps({"text": ..., "time_series": ...}) as standard Chroma document strings
Distance spacesCosine (default), L2, and inner product
Secure persistenceStores the env var name, never the key value — serialized collections are safe to commit
Index protectionmodel_name and dimensions are immutable after collection creation
Full interfaceImplements all 8 methods of Chroma's EmbeddingFunction[Documents] protocol
Python supportPython 3.11, 3.12, and 3.13

Installation

pip install inertialai-chroma

or with uv:

uv add inertialai-chroma

Prerequisites

Before using this integration you need:

In This Section

PageDescription
QuickstartInstall, connect to Chroma, and run your first multi-modal similarity search.
Multi-Modal EmbeddingsEmbed time-series sensor data alongside text in the same Chroma collection.
Collection PersistenceUnderstand how credentials are handled when Chroma serializes collections to disk.
Configuration ReferenceConstructor parameters, distance spaces, and immutability constraints.
ECG5000 DemoRun a local end-to-end demo with real ECG data, a Chroma server, and a Streamlit search UI.

Resources