This project is a simple Python implementation of Retrieval-Augmented Generation (RAG).
It demonstrates how to:
- Load and split
.txtdocuments - Generate embeddings using OpenAI
- Store and query embeddings in ChromaDB
- Generate concise answers with context retrieved from documents
It was created to practice document retrieval, vector databases, and LLM-based question answering.
The project uses the following Python libraries:
- openai → to generate embeddings and chat responses
- chromadb → as the vector database for storing and retrieving document chunks
- python-dotenv → to manage API keys securely in a
.envfile
main.py→ Entry point to run the pipeline and ask questions interactivelyconfig.py→ Handles environment variables and configurationdata_loader.py→ Loads documents and splits them into chunksembeddings.py→ Generates embeddings using OpenAIvector_store.py→ Sets up and manages ChromaDB collectionrag.py→ RAG pipeline logic (retrieval + response generation)articles/→ Folder containing.txtfiles used as knowledge baserequirements.txt→ List of dependencies
- Load documents → split into chunks
- Create embeddings for each chunk
- Store embeddings in ChromaDB
- User asks a question
- Retrieve top matching chunks
- LLM generates an answer using context