InertialAI embeddings integration for Chroma
Project description
inertialai-chroma
InertialAI embeddings integration for Chroma — supports text-only, time-series-only, and multi-modal (text + time-series) semantic search via the inertial-embed-alpha model.
Overview
InertialAI's inertial-embed-alpha model produces dense vector embeddings from three input types:
| Input type | Example |
|---|---|
| Text only | "temperature spike at noon" |
| Time-series only | [[72, 74, 73, 75, 71]] (e.g. heart rate readings) |
| Multi-modal | A time-series signal paired with its natural language description, combined into a single vector |
Multi-modal embeddings are InertialAI's core differentiator — a single vector that captures both the numerical signal and its semantic context simultaneously, enabling richer similarity search across domains like industrial IoT, healthcare, and financial markets.
inertialai-chroma implements Chroma's full eight-method EmbeddingFunction interface, including get_config() and build_from_config(), so that collections can be persisted to disk and reconstructed without storing credentials.
Requirements
- Python 3.11 or later
- An InertialAI API key — sign up at app.inertialai.com
- A running Chroma instance — see Chroma Docker deployment
Installation
pip install inertialai-chroma
# or
uv add inertialai-chroma
Quickstart
Set your API key as an environment variable:
export INERTIALAI_API_KEY="your-api-key"
Then create a collection and start embedding:
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("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=["anomalous thermal event"], n_results=2)
print(results["documents"])
Multi-modal Embeddings
Since Chroma documents are always strings, multi-modal inputs are passed as JSON-serialised dicts containing a text field, a time_series field, or both. Time-series data is formatted as a list of channels, where each channel is a list of numerical readings.
import json
import chromadb
from inertialai_chroma import InertialAIEmbeddingFunction
client = chromadb.HttpClient(host="localhost", port=8000)
ef = InertialAIEmbeddingFunction()
collection = client.create_collection("energy", embedding_function=ef)
# Each document pairs a text description with its raw time-series readings
collection.add(
documents=[
json.dumps({
"text": "Energy price spike Q4 2022",
"time_series": [[1.2, 1.5, 1.8, 2.1, 2.4]],
}),
json.dumps({
"text": "Stable energy prices Q1 2023",
"time_series": [[0.9, 0.9, 0.91, 0.88, 0.9]],
}),
],
ids=["doc-1", "doc-2"],
)
# Query with a multi-modal input — or just plain text
results = collection.query(
query_texts=[
json.dumps({"text": "abnormal energy reading", "time_series": [[1.3, 1.6, 2.0]]})
],
n_results=1,
)
print(results["documents"])
Configuration
InertialAIEmbeddingFunction(
api_key_env_var="INERTIALAI_API_KEY", # default
model_name="inertial-embed-alpha", # default
dimensions=None, # default — use full embedding size
timeout=60.0, # default — seconds
)
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key_env_var |
str |
"INERTIALAI_API_KEY" |
Name of the environment variable holding the API key |
model_name |
str |
"inertial-embed-alpha" |
InertialAI model to use for embedding |
dimensions |
int | None |
None |
Truncate embedding output to this many dimensions |
timeout |
float |
60.0 |
HTTP request timeout in seconds |
api_key |
str | None |
None |
(Deprecated) Pass the key value directly — not persisted by Chroma; prefer api_key_env_var |
Note:
model_nameanddimensionsare immutable after a collection is created — changing either would invalidate the existing vector index.
Collection Persistence
When Chroma persists a collection to disk, it serialises the embedding function via get_config(). InertialAIEmbeddingFunction stores the environment variable name, never the key value itself, so serialised collections are safe to commit to version control. At load time, build_from_config() resolves the key from the environment automatically — no credentials need to be passed explicitly.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inertialai_chroma-0.1.0.tar.gz.
File metadata
- Download URL: inertialai_chroma-0.1.0.tar.gz
- Upload date:
- Size: 166.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72053541d87e54da1429ca85870ad225cd2fe8f26241347c019bcfcaf774efc6
|
|
| MD5 |
84c1cf55086d7d227b5167005eea6083
|
|
| BLAKE2b-256 |
f1cda772b3491e97292337ef827c73d1d85af112eca80e2ea8949f9a44b9ec7d
|
Provenance
The following attestation bundles were made for inertialai_chroma-0.1.0.tar.gz:
Publisher:
publish-chroma.yml on InertialAI/inertialai-chroma
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inertialai_chroma-0.1.0.tar.gz -
Subject digest:
72053541d87e54da1429ca85870ad225cd2fe8f26241347c019bcfcaf774efc6 - Sigstore transparency entry: 1087363407
- Sigstore integration time:
-
Permalink:
InertialAI/inertialai-chroma@5261debfbb60c87766fa85aaf5d6fbb6975c1fb7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/InertialAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-chroma.yml@5261debfbb60c87766fa85aaf5d6fbb6975c1fb7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file inertialai_chroma-0.1.0-py3-none-any.whl.
File metadata
- Download URL: inertialai_chroma-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d48c010997143a2bda21da95d72371b11ad89d3a8c9a1cf5ffc1c6f4a6fb21f
|
|
| MD5 |
62b2ed7fc8b37b22782890ffad2d0d1a
|
|
| BLAKE2b-256 |
ae8cd8fbf25e5a6d5d2354d9f71cc2f4207ec9e33b868301744dca9aa12be99a
|
Provenance
The following attestation bundles were made for inertialai_chroma-0.1.0-py3-none-any.whl:
Publisher:
publish-chroma.yml on InertialAI/inertialai-chroma
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inertialai_chroma-0.1.0-py3-none-any.whl -
Subject digest:
1d48c010997143a2bda21da95d72371b11ad89d3a8c9a1cf5ffc1c6f4a6fb21f - Sigstore transparency entry: 1087363426
- Sigstore integration time:
-
Permalink:
InertialAI/inertialai-chroma@5261debfbb60c87766fa85aaf5d6fbb6975c1fb7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/InertialAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-chroma.yml@5261debfbb60c87766fa85aaf5d6fbb6975c1fb7 -
Trigger Event:
push
-
Statement type: