Find answers from the community

Updated 9 months ago

im working on a chat system where a

At a glance
im working on a chat system where a document is indexed, and the index is persisted to the storage directory, then i want to load the index later from the SimpleIndexStore within the storage directory and query against it. For some reason, i can get it to work correctly with a note book test, but not with my create-llama-app application. any ideas why this isnt working?
L
R
8 comments
I mean, whats the issue?
I cannot load the index from storage. Nothing loads. I specify the id, save the index, try to load it later and it doesn’t exist.
So I end up recreating the index every time I want to query against it, because the application cannot find the existing index by its id in storage.
Qdrant doesn't "save" and "load" tbh -- everything is saved in the vector store.

Just make a new collection for each index, or use metadata filtering to seperate indexes
You don't need the index store in that case
I mean it does work in the notebook tho. I’m able to create the index, name it, and persist it and query against it. I see it’s in the vectorDB, and it’s all good. Then I try to retrieve it from the index store by the id and make a new index and query engine to query against this new index from storage. That works as well. So it does seem to load the index just fine, in the notebook. It’s just that if I use the same code in my fastAPI backend, then it can’t find the indexes in the index store by id. I guess the real crux of the issue is just how do I not repeat the work of creating an index for a document every time someone wants to ask about the document? It takes like 10-15 seconds to do all that, while querying against an existing index in storage only takes a split second, so I’m trying to avoid all that overhead
I would just refactor your code as I mentioned. No idea why it works in the notebook and not fastapi, but it will be even faster without the index store (you'll notice the index store is largely empty anyways)

Plain Text
vector_store = QdrantVectorStore(
  collection_name=<collection_name>,
  client=q_client,
  parallel=4
)

index = VectorStoreIndex.from_vector_store(vector_store)
Ok I’ll try that, thank you
Add a reply
Sign up and join the conversation on Discord