Skip to content

Latest commit

History

History
71 lines (57 loc) 路 2.36 KB

chroma-documentstore.md

File metadata and controls

71 lines (57 loc) 路 2.36 KB
layout name description authors pypi repo type report_issue logo version toc
integration
Chroma
A Document Store for storing and retrieval from Chroma
name socials
Massimiliano Pippi
github
masci
name socials
deepset
github twitter linkedin
deepset-ai
deepset_ai
deepset-ai
Document Store
/logos/chroma.png
Haystack 2.0
true

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.

License

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