AI Engineer Study Library

Q&A Over Your Own PDFs with LlamaIndex, OpenAI and Python (2023)

Melvin Vivas · melvinvivas.com article · 2023-04-08 · Open on melvinvivas.com

Topics: Retrieval-Augmented Generation (RAG), Embeddings & Vector Databases, LLM Fundamentals · Level: beginner

Summary

Melvin Vivas introduces generative text AI, the OpenAI API, LangChain and LlamaIndex (formerly GPT Index). He then walks through a basic Python RAG example in Google Colab. It indexes PDFs (his LinkedIn resume) from a /data folder, saves the vector index to disk and queries it in natural language. It also shows how to swap the default text-davinci-003 for the cheaper gpt-3.5-turbo. The code uses the early 2023 llama_index API (GPTSimpleVectorIndex, LLMPredictor), which has since been removed, so treat it as a lesson in concepts rather than code to copy.

Key points

Resources mentioned

Try this

More in Retrieval-Augmented Generation (RAG)

All of Retrieval-Augmented Generation (RAG)