🎃 We're participating in Hacktoberfest 2023!

Integration: Chroma Document Store

A Document Store for storing and retrieval from Chroma - built for Haystack 2.0

Authors
Massimiliano Pippi

Chroma Document Store for Haystack

PyPI - Version PyPI - Python Version test


Table of Contents

Installation

pip install chroma-haystack

Usage

Once installed, you can start using your Chroma database with Haystack 2.0 by initializing it:

from chroma_haystack 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.preview.components.file_converters import TextFileToDocument
from haystack.preview.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": {"paths": 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.