Find answers from the community

Updated 2 years ago

Hello everyone

At a glance
Hello everyone!
First post on this Discord server - I hope I am using the right channel.
I have been suffering for 2 months with LangChain until I discovered LlamaIndex. What a better documentation and an easier use!
My question is related to VectorStore Indexes, and especially Chroma. I processed a large book (362k words) and tested various VectorStore solutions.
  • the default index provided in the LlamaIndex tutorials give decent results but is slow and does not seem to be designed for a production real-life app.
  • Using Pinecone gives me great results (scores at 0.83 and great responses from the LLM).
  • Chroma was my next test, since it is free and I have my own server. But I get terrible results! The scores of retrieved Nodes are around 0.23 and (not surprisingly) the LLM gives me very bad results ("junk-in, junk out" effect I guess). I tried to play with various parameters, but did not have luck.
Code extract:
Plain Text
print("Building the Chroma VectorStore...")
db = chromadb.PersistentClient(path="./laelith_chroma")
chroma_collection = db.get_or_create_collection("quickstart")
vector_store = ChromaVectorStore(chroma_collection=chroma_collection)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
embed_model = OpenAIEmbedding(OpenAIEmbeddingMode.SIMILARITY_MODE)

service_context = ServiceContext.from_defaults(
  llm=llm,
  embed_model=embed_model,
  chunk_size=400, 
  chunk_overlap=20
  )
index = VectorStoreIndex.from_documents(
  documents=documents,
  storage_context=storage_context,
  service_context=service_context,
  show_progress=True
)

Any ideas?
L
Y
T
8 comments
Actually, I think there is a small bug with chroma -- the scores are inverted (i.e. 0.23 should actually be 1 - 0.23 = 0.87). Let me double check this today
This just reminded me to fix that haha
Great to hear that I helped reminding you of a potential bug πŸ™‚
About my question: any hints why using Chroma would yield such bad results compared to Pinecone? Problem with the embeddings? Missing indexing mode parameters?
Tbh I'm not sure actually. I would expect performance/answer quality to be basically the same across vector dbs (the embeddings themselves don't change, just search/scoring methods)
So it's odd that chroma made any difference πŸ˜…
If you are looking for something free/self hosted, people seem to really like qdrant as well
I use Qdrant and absolutely love it
@Logan M & @Teemu I just tested Qdrant and it works pretty nicely so far! Thanks for the pointer πŸ™
Add a reply
Sign up and join the conversation on Discord