Maintained by deepset

Integration: Chroma

A Document Store for storing and retrieval from Chroma

Authors
Massimiliano Pippi
deepset

PyPI - Version PyPI - Python Version test


Table of Contents

Installation

Use pip to install Chroma:

pip install chroma-haystack

Usage

Once installed, initialize your Chroma database to use it with Haystack 2.0:

from haystack_integrations.document_stores.chroma import ChromaDocumentStore

# Chroma is used in-memory so we use the same instances in the two pipelines below
document_store = ChromaDocumentStore()

Writing Documents to ChromaDocumentStore

To write documents to ChromaDocumentStore, create an indexing pipeline.

from haystack.components.converters import TextFileToDocument
from haystack.components.writers import DocumentWriter

indexing = Pipeline()
indexing.add_component("converter", TextFileToDocument())
indexing.add_component("writer", DocumentWriter(document_store))
indexing.connect("converter", "writer")
indexing.run({"converter": {"sources": file_paths}})

Examples

You can find a code example showing how to use the Document Store and the Retriever under the example/ folder of this repo or in this Colab.

License

chroma-haystack is distributed under the terms of the Apache-2.0 license.