layout | name | description | authors | pypi | repo | type | report_issue | logo | version | toc | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
integration |
Chroma |
A Document Store for storing and retrieval from Chroma |
|
Document Store |
/logos/chroma.png |
Haystack 2.0 |
true |
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()
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}})
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.