Find answers from the community

Updated 4 days ago

Troubleshooting Chroma Vector Store and Docstore Setup

Hey, I'm running a chroma vector store and a very basic storagecontext and docstore setup. For some reason whenever I try to peek into my chromadb after indexing a handful of sample documents, it returns an empty dict as follows: {'ids': [], 'embeddings': array([], dtype=float64), 'documents': [], 'uris': None, 'data': None, 'metadatas': [], 'included': [<IncludeEnum.embeddings: 'embeddings'>, <IncludeEnum.documents: 'documents'>, <IncludeEnum.metadatas: 'metadatas'>]}. When I print my docstore from index.docstore.docs, it states that I do have documents. I've been debugging it for a bit, playing around with persist paths and other configs but I can't seem to find where the problem resides
L
O
21 comments
The docstore shouldn't be populated unless you explicitly populate it?
Sounds like you aren't passing in the chroma vector store properly and its defaulting the the simple vector store
When I'm persisting my index I see a deafult__vector_store.json, I guess that implies that it's using the simplevectorstore, right?
Hmmm, I am not adding any docs to my docstore anywhere as far as I'm concerned
Works fine for me
You dont need to call persist or load
Yea, its also shown in the docs
For most vector stores, everything gets tossed into the vector db itself
πŸ€¦β€β™‚οΈ apologies for not reading the manual properly
no worries! There's so many docs pages
If I'm loading an index from storage though, don't I need to persist and load it from somewhere?
thats really only for the defaults
chroma is managing its own storage
So I can just re-initialize a chroma client, initialize chromavectorstore, and then create a vectorstoreindex and I'm set?
Yes, using the from_vector_store() method
One gotcha is make sure you keep the embedding model the same. Either setting Settings.embed_model or passing it in

.from_documents(..., embed_model=embed_model)
.from_vector_store(..., embed_model=embed_model)
Thank you so much, I'll take a look at it
Add a reply
Sign up and join the conversation on Discord