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
| Feature | Details |
|---|---|
| Input modes | Text-only, time-series-only, and multi-modal (text + time-series) in the same collection |
| Multi-modal format | Pass json.dumps({"text": ..., "time_series": ...}) as standard Chroma document strings |
| Distance spaces | Cosine (default), L2, and inner product |
| Secure persistence | Stores the env var name, never the key value — serialized collections are safe to commit |
| Index protection | model_name and dimensions are immutable after collection creation |
| Full interface | Implements all 8 methods of Chroma's EmbeddingFunction[Documents] protocol |
| Python support | Python 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:
- Python 3.11 or later
- An InertialAI API key — sign up at app.inertialai.com and generate a key in your dashboard. See Authentication for details.
- A running Chroma instance — follow the Chroma Docker deployment guide to start one locally.
In This Section
| Page | Description |
|---|---|
| Quickstart | Install, connect to Chroma, and run your first multi-modal similarity search. |
| Multi-Modal Embeddings | Embed time-series sensor data alongside text in the same Chroma collection. |
| Collection Persistence | Understand how credentials are handled when Chroma serializes collections to disk. |
| Configuration Reference | Constructor parameters, distance spaces, and immutability constraints. |
| ECG5000 Demo | Run a local end-to-end demo with real ECG data, a Chroma server, and a Streamlit search UI. |
Resources
- GitHub repository — source code, issue tracker, and contribution guide
- PyPI package — release history and package metadata
- Chroma EmbeddingFunction docs — Chroma's embedding function interface reference
- Chroma Docker deployment — run a Chroma instance locally