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.3.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.3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dagster_chroma-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 1c65ab08b0fdc047754c60099a0a50305235f8289d86837615e81807574e3066
MD5 63bed9e86d6f2735147f33f8b5a8df5a
BLAKE2b-256 5d757a4bcba29c16a9ad3c25adea0118a5502e3a85254295ce49f8f5bf41e935

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dagster_chroma-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 496c9f22336e2c72c14da674fe741dfc97327271b8b131e301fafc0f4211a74a
MD5 286fcc0da16c85c1abc183c962a7ddcd
BLAKE2b-256 1c791650cd8504488486173dd94d19e1575d7971a2b5de2c5799d06c23520789

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