run-llama / LlamaIndexTS

Data framework for your LLM applications. Focus on server side solution
https://ts.llamaindex.ai
MIT License
1.89k stars 354 forks source link

SummaryIndex expects vector_store.json; causes continual recreation of this file #839

Open reidperyam opened 5 months ago

reidperyam commented 5 months ago

I noticed that when creating the default storage context from persistDir, it defaults to trying to load the vector_store.json file. However, the summary index does not create this file (or it does not persist it), so the "No valid data found at path: .../vector_store.json starting new store." pops up every time.

vectorStore =

Originally posted by @pelikhan in https://github.com/run-llama/LlamaIndexTS/discussions/649#discussioncomment-8832260

reidperyam commented 5 months ago

a workaround to avoid rebuilding the vector_index continually is to pass an empty VectorIndex in the constructor of the storageContext:

  const storageContext = await storageContextFromDefaults({
    persistDir,
    vectorStore: new SimpleVectorStore(),
  });
marcusschiesser commented 5 months ago

@reidperyam this is a good workaround. The SummaryIndex indeed doesn't need a vector store and the current design of the storage context must contain a vector store. I added a PR to ignore the warning: https://github.com/run-llama/LlamaIndexTS/pull/861 @himself65 please have a look and merge