Skip to main content

Dagster integration with chroma

Project description

dagster-chroma

A dagster module that provides integration with chroma. Both HTTP connections, and local (filesystem-based) connections are supported.

Installation

The dagster_chroma module is available as a PyPI package - install with your preferred python environment manager (We recommend uv).

source .venv/bin/activate
uv pip install dagster-chroma

Example Usage (Local Chroma Instance)

(Based on the Chroma getting started guide)

import os
from dagster import Definitions, asset
from dagster_chroma import ChromaResource, LocalConfig, HttpConfig

@asset
def my_table(chroma: ChromaResource):
    with chroma.get_client() as chroma_client:
        collection = chroma_client.create_collection("fruits")

        collection.add(
            documents=[
                "This is a document about oranges",
                "This is a document about pineapples",
                "This is a document about strawberries",
                "This is a document about cucumbers"],
            ids=["oranges", "pineapples", "strawberries", "cucumbers"],
        )

        results = collection.query(
            query_texts=["hawaii"],
            n_results=1,
        )

defs = Definitions(
    assets=[my_table],
    resources={
        "chroma": ChromaResource(
            connection_config=
                LocalConfig(persistence_path="./chroma") if os.getenv("DEV") else
                    HttpConfig(host="192.168.0.10", port=8000)
        ),
    }
)

Development

The Makefile provides the tools required to test and lint your local installation.

make test
make ruff
make check

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dagster_chroma-0.0.4.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dagster_chroma-0.0.4-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file dagster_chroma-0.0.4.tar.gz.

File metadata

  • Download URL: dagster_chroma-0.0.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for dagster_chroma-0.0.4.tar.gz
Algorithm Hash digest
SHA256 91675e9b87c374e4447979727c59ce5a2d78be8db3216ee5f1cc7de5a4f7a15d
MD5 a94da4326d9cfc494d63ca14a33578b9
BLAKE2b-256 4bdfa4a112d2c74b7f8dd8fa92f63d27b9d7948448b6c8f96160fe48f30c7891

See more details on using hashes here.

File details

Details for the file dagster_chroma-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for dagster_chroma-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7f97c3a5a49730840be927c645d81ce93053f5da6da48d619cf7bbd4d5b305e1
MD5 56cba5099292da2002e074d59b31d597
BLAKE2b-256 33633208ced4211ac984818cab9315c4dc1f2db0cf0eeb5af0e6be9e90b59749

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page