----------------------
I'm sorry, but the provided knowledge sources do not contain information on how to use the AutoMergingRetriever alongside ChromaDB. The sources provide separate examples of how to use the AutoMergingRetriever and how to set up a ChromaDB collection, but they do not provide an example of using them together.
Here's what we know from the sources:
- The AutoMergingRetriever is a part of the LlamaIndex project. It is designed to merge context into parent context. It first retrieves chunks from a vector store and then tries to merge the chunks into a single context. You can initialize and use it as follows:
from llama_index.core.retrievers import AutoMergingRetriever
base_retriever = base_index.as_retriever(similarity_top_k=6)
retriever = AutoMergingRetriever(base_retriever, storage_context, verbose=True)
query_str = "Your query string here"
nodes = retriever.retrieve(query_str)
(Source:
GitHub ())
- ChromaDB is a vector database that can be used with LlamaIndex. You can set up an empty Chroma collection as follows:
import chromadb
chroma_client = chromadb.EphemeralClient()
chroma_collection = chroma_client.create_collection("quickstart")
(Source:
GitHub ())