A Retrieval-Augmented Generation (RAG) chatbot that answers questions from PDF documents using semantic search and large language models.
Built from scratch using FAISS, Sentence Transformers, and Groqβs LLaMA-3.1 model.
This project is designed for internship and portfolio use, demonstrating real-world AI engineering skills.
- π Ingests one or multiple PDF documents
- βοΈ Smart text chunking with overlap
- π Semantic search using FAISS vector database
- π§ Context-aware answers using LLaMA-3.1
- π¬ Chat-style UI with conversation history
- π Uses PDF context first, with intelligent fallback
- π§Ύ (Optional) Source-aware responses
PDF Documents β Text Extraction (PyPDF) β Chunking with Overlap β Embeddings (Sentence Transformers) β FAISS Vector Database β Top-K Context Retrieval + Reranking β LLaMA-3.1 (Groq API) β Final Answer (Chat UI)
- Programming Language: Python 3.13
- Embeddings: Sentence Transformers (all-MiniLM-L6-v2)
- Vector Database: FAISS
- LLM: LLaMA-3.1 via Groq API
- Frontend: Streamlit
- PDF Parsing: PyPDF
RAGChatBot/ βββ backend/ β βββ load_pdf.py # PDF text extraction β βββ chunker.py # Text chunking logic β βββ vector_store.py # FAISS index creation β βββ rag_answer.py # Final RAG pipeline β βββ test_rag.py # Backend testing βββ data/ β βββ pdfs/ # Input PDF files βββ faiss_index/ β βββ index.faiss # FAISS vector index β βββ chunks.txt # Stored text chunks βββ frontend/ β βββ app.py # Streamlit chat UI βββ requirements.txt βββ README.md
git clone https://github.com/your-username/RAGChatBot.git
cd RAGChatBot
2οΈβ£ Create and activate virtual environment
python -m venv venv
venv\Scripts\activate
3οΈβ£ Install dependencies
pip install -r requirements.txt
4οΈβ£ Build the FAISS vector index
python backend/vector_store.py
5οΈβ£ Run the chatbot UI
python -m streamlit run frontend/app.py