Find answers from the community

Updated 6 months ago

Everytime i use starge context persist

At a glance

The community member is asking whether using starge_context.persist() will erase their current data on /storage or just append the new content. The comments indicate that it will erase/overwrite the existing data, and the community members suggest that the user should always load the index first, add new documents, and then save again. One community member also asks how to append new data to an existing file on /storage, and another community member provides a solution by first loading the index from storage and then inserting the new documents.

Everytime i use starge_context.persist() it will erase my current data on /storage and save a new one or it will just "append" the new content?
L
M
5 comments
It will erase/overwrite
so should always load the index first, add your new documents, then save again
If I already have a file on my /storage how can I append my new "index = VectorStoreIndex.from_documents(documents)" to it? I cant figure it out...
Plain Text
index = load_index_from_storage(...)

for doc in documents:
  index.insert(documents)
Add a reply
Sign up and join the conversation on Discord