AI Engineering Internship: Building a Document Q&A Bot with RAG

1. Objective

Large Language Models (LLMs) are trained on massive public datasets, giving them a broad, general understanding of world knowledge. However, they suffer from two major limitations:

  1. Knowledge Cutoffs & Lack of Private Data: They do not know about your private files, recent enterprise reports, or proprietary documents.
  2. Hallucinations: When asked about details outside their training data, they often make up realistic-sounding but completely incorrect answers.

Retrieval-Augmented Generation (RAG) solves this problem. Instead of retraining or fine-tuning a massive model, we supplement the user's query with relevant context retrieved from a custom document library.

                                 +--------------------+
                                 |  Custom Documents  |
                                 | (PDF, DOCX, TXT)   |
                                 +---------+----------+
                                           |
                                           v
+-------------------+            +---------+----------+            +------------------+
|    User Query     +----------->|   Vector Database  +----------->| Retrieved Chunks |
+---------+---------+            |  (Semantic Search) |            +--------+---------+
          |                      +--------------------+                     |
          |                                                                 v
          |                      +--------------------+            +--------+---------+
          +--------------------->| Prompt Formulator  |<-----------+  Source Citations|
                                 +---------+----------+            +------------------+
                                           |
                                           v
                                 +---------+----------+
                                 |  Language Model    |
                                 |   (Gemini/LLM)     |
                                 +---------+----------+
                                           |
                                           v
                                 +---------+----------+
                                 | Grounded Answer &  |
                                 |    Citations       |
                                 +--------------------+

2. Technical Requirements

To build a robust and clean python-based RAG system, you will need the following technical stack.

Language & Runtime

Core Libraries & Packages

Prerequisites