from langchain.indexes import VectorstoreIndexCreator
from langchain_community.document_loaders import CSVLoader
from langchain_community.vectorstores import FAISS

loader = CSVLoader("/Users/harrisonchase/Downloads/titanic.csv")

docs = loader.load()
index_creator = VectorstoreIndexCreator(vectorstore_cls=FAISS)

index = index_creator.from_documents(docs)

index.vectorstore.save_local("titanic_data")

langchain_community.document_loaders.CSVLoader langchain.indexes.VectorstoreIndexCreator
[((174, 229), 'langchain_community.document_loaders.CSVLoader', 'CSVLoader', (['"""/Users/harrisonchase/Downloads/titanic.csv"""'], {}), "('/Users/harrisonchase/Downloads/titanic.csv')\n", (183, 229), False, 'from langchain_community.document_loaders import CSVLoader\n'), ((268, 314), 'langchain.indexes.VectorstoreIndexCreator', 'VectorstoreIndexCreator', ([], {'vectorstore_cls': 'FAISS'}), '(vectorstore_cls=FAISS)\n', (291, 314), False, 'from langchain.indexes import VectorstoreIndexCreator\n')]