Create a vector DB in persistent storage

A basic question that i have not yet found a straightforward answer:

Situation: I have a streamlit RAG app deployed in one of my huggingface spaces. The user has to upload their PDFs in order for the app to chunk them, embed them and upload them to a vector DB (lets say Chroma). The problem is that this vector DB is ephemeral as i dont have persistent storage

Question: If i purchase persistent storage from huggingface, how can i:
a) create a persistent Vector DB using Python
b) Access this vector DB from my RAG streamlit app so that the users do not have to manually upload the same PDFs again and again every time they run the app?

1 Like