This project implements a Retrieval-Augmented Generation (RAG) assistant that answers questions about Deep Learning using custom data scraped from Wikipedia pages.
The pipeline performs document ingestion, embedding generation, vector storage, and semantic retrieval to ground LLM responses in verified domain knowledge.
The system uses LangChain, ChromaDB, Groq LLM API, and sentence-transformers embeddings.
A ChatGPT-style UI is implemented using Gradio, allowing interactive querying and real-time responses.
This project follows a structured pipeline to build a domain-specific Retrieval-Augmented Generation (RAG) assistant capable of answering deep-learning related questions using Wikipedia knowledge.
Data Collection
Selected key Wikipedia topics: Deep Learning, Neural Networks, Backpropagation, Gradient Descent
Retrieved and stored raw text locally using the wikipedia Python API
Preprocessing & Chunking
Cleaned text (removed headings, references)
Split into ~300-500 token chunks for efficient embedding & retrieval
Total chunks generated: ~400
Embedding Generation
Embeddings generated using:
sentence-transformers/all-MiniLM-L6-v2
Chosen for:
lightweight footprint
strong semantic similarity performance
fast CPU inference
Stored embeddings in ChromaDB
Persisted to local storage for reuse
Retriever configured for top-k=2 semantic matches (token-safe)
User input → Retrieve embedding matches → Feed context + question to LLM → Generate grounded response
Model: Groq Llama-3.1-8B-Instant
Invoked through langchain_groq
Custom natural-language prompt to produce clear, accessible summaries
Built interactive chat UI using Gradio ChatInterface
Continuous conversation format like ChatGPT
Trimmed chunks to avoid 413 token-overflow errors
Exception handling for retrieval and inference errors
System Performance & Output Quality:
The assistant successfully provides accurate and grounded explanations for deep-learning topics
Responses remain simple, non-technical, and beginner-friendly
No hallucinations observed when topics are within dataset scope
Unknown questions result in safe responses (“not in docs” behavior retained when out-of-scope)
Example Outputs:
User: How can I learn deep learning ?
Bot:
To learn deep learning, start by getting familiar with the basics of machine learning and neural networks. Online courses like Andrew Ng's Machine Learning course or Stanford's CS231n are great resources. You can also explore books like "Deep Learning" by Ian Goodfellow, Yoshua Bengio, and Aaron Courville.
Next, practice building and training neural networks using popular libraries like TensorFlow, PyTorch, or Keras. You can find many tutorials and examples online, or work on projects like image classification, natural language processing, or speech recognition.
Join online communities, forums, and social media groups dedicated to deep learning to stay updated on the latest developments and learn from experts and enthusiasts. Participate in Kaggle competitions or other machine learning challenges to apply your skills in real-world scenarios.
Lastly, be patient and persistent – deep learning is a complex and challenging field that requires dedication and practice to master.
User: Deep learning is a type of machine learning that focuses on using multilayered neural networks to perform tasks such as classification, regression, and representation learning. These neural networks, inspired by the human brain, are made up of layers of artificial neurons that work together to process and analyze data. The "deep" in deep learning refers to the use of multiple layers, which can range from three to several hundred or thousands, allowing the network to learn complex patterns and relationships in the data. Deep learning has been applied to various fields, including computer vision, speech recognition, natural language processing, and more, and has produced results comparable to and sometimes surpassing human expert performance. Understanding deep learning is important because it has the potential to revolutionize many areas of life, from healthcare and education to finance and transportation, by providing more accurate and efficient solutions to complex problems.
The system demonstrates a working end-to-end RAG pipeline with domain-specific data, real-time chat UI, and grounded LLM responses. The final assistant delivers accurate, accessible explanations suitable for beginners learning deep learning topics.
Abstract: Github Repo: https://github.com/Sudheer-029/rag-deep-learning-assistant/tree/main
Methodology: Github Repo: https://github.com/Sudheer-029/rag-deep-learning-assistant/tree/main
Abstract: Github Repo: https://github.com/Sudheer-029/rag-deep-learning-assistant/tree/main
Methodology: Github Repo: https://github.com/Sudheer-029/rag-deep-learning-assistant/tree/main