Maintained by deepset

Integration: Chroma

A Document Store for storing and retrieval from Chroma

Massimiliano Pippi

PyPI - Version PyPI - Python Version test

Table of Contents


Use pip to install Chroma:

pip install chroma-haystack


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"){"converter": {"sources": file_paths}})


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


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