code: from dotenv import load_dotenv
  load_dotenv()
  
  from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader, load_index_from_storage, StorageContext
  from llama_index.storage.docstore import SimpleDocumentStore
  from llama_index.vector_stores import SimpleVectorStore
  from llama_index.storage.index_store import SimpleIndexStore
  from llama_index.graph_stores import SimpleGraphStore
  
  documents = SimpleDirectoryReader('news').load_data()
  
  index = GPTVectorStoreIndex.from_documents(documents)
  
  # save to disk
  index.storage_context.persist()
  
  # load from disk
  storage_context = StorageContext(
      docstore=SimpleDocumentStore.from_persist_dir('storage'),
      vector_store=SimpleVectorStore.from_persist_dir('storage'),
      index_store=SimpleIndexStore.from_persist_dir('storage'),
      graph_store=SimpleGraphStore.from_persist_dir('storage')
  )
  index = load_index_from_storage(storage_context)
  
  query_engine = index.as_query_engine()
  r = query_engine.query("Who are the main exporters of Coal to China? What is the role of Indonesia in this?")
  print(r)
  
apis: llama_index.storage.docstore.SimpleDocumentStore.from_persist_dir llama_index.GPTVectorStoreIndex.from_documents llama_index.graph_stores.SimpleGraphStore.from_persist_dir llama_index.SimpleDirectoryReader llama_index.storage.index_store.SimpleIndexStore.from_persist_dir llama_index.load_index_from_storage llama_index.vector_stores.SimpleVectorStore.from_persist_dir
extract_api: [((31, 44), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (42, 44), False, 'from dotenv import load_dotenv\n'), ((450, 495), 'llama_index.GPTVectorStoreIndex.from_documents', 'GPTVectorStoreIndex.from_documents', (['documents'], {}), '(documents)\n', (484, 495), False, 'from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader, load_index_from_storage, StorageContext\n'), ((855, 895), 'llama_index.load_index_from_storage', 'load_index_from_storage', (['storage_context'], {}), '(storage_context)\n', (878, 895), False, 'from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader, load_index_from_storage, StorageContext\n'), ((399, 428), 'llama_index.SimpleDirectoryReader', 'SimpleDirectoryReader', (['"""news"""'], {}), "('news')\n", (420, 428), False, 'from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader, load_index_from_storage, StorageContext\n'), ((609, 656), 'llama_index.storage.docstore.SimpleDocumentStore.from_persist_dir', 'SimpleDocumentStore.from_persist_dir', (['"""storage"""'], {}), "('storage')\n", (645, 656), False, 'from llama_index.storage.docstore import SimpleDocumentStore\n'), ((675, 720), 'llama_index.vector_stores.SimpleVectorStore.from_persist_dir', 'SimpleVectorStore.from_persist_dir', (['"""storage"""'], {}), "('storage')\n", (709, 720), False, 'from llama_index.vector_stores import SimpleVectorStore\n'), ((738, 782), 'llama_index.storage.index_store.SimpleIndexStore.from_persist_dir', 'SimpleIndexStore.from_persist_dir', (['"""storage"""'], {}), "('storage')\n", (771, 782), False, 'from llama_index.storage.index_store import SimpleIndexStore\n'), ((800, 844), 'llama_index.graph_stores.SimpleGraphStore.from_persist_dir', 'SimpleGraphStore.from_persist_dir', (['"""storage"""'], {}), "('storage')\n", (833, 844), False, 'from llama_index.graph_stores import SimpleGraphStore\n')]