I think your
retrieve_data
function is incorrect. You need to have
Document
objects to insert into an index. Maybe try out the db loader here:
https://llamahub.ai/l/databaseAlso, when you load an index from storage, you'll need to add the service context again
load_index_from_storage(storage_context, service_context=service_context)
(Although tbh, I wouldn't recommend the LLM you are using. I would use gpt-3.5-turbo if you need a cheap one)