🚀 Project Overview
This project is a fully functional Retrieval-Augmented Generation (RAG) Assistant built as part of the AAIDC Module 1 Certification. While the initial template provided the skeleton, I implemented the "muscles" of the system—logic for document loading, chunking, embedding, and vector retrieval.
Going beyond the basic requirements, I enhanced the application by replacing the command-line interface with a Streamlit Web UI. This transforms the project from a script into a user-friendly product where users can visually manage their knowledge base and chat with their PDF documents in real-time.
🌟 Key Features
interactive Web Interface: A clean, chat-like UI built with Streamlit that replaces the standard terminal loop.
Universal PDF Loader: Automatically scans, loads, and parses PDF files from the data/ directory using pypdf.
Smart Context Retrieval: Uses ChromaDB and Sentence Transformers to semantically search for the most relevant document chunks.
Multi-Model Intelligence: The system is agnostic to the LLM provider. It seamlessly switches between:
OpenAI (GPT-4o)
Groq (Llama 3.1)
Google (Gemini 2.0 Flash)
Robust Error Handling: Specifically engineered to handle version conflicts, ensuring stability on Python 3.11/3.12 environments.
🛠️ Technical Implementation
text_splitter = RecursiveCharacterTextSplitter(
chunk_size=500,
chunk_overlap=50,
length_function=len,
separators=["\n\n", "\n", " ", ""]
)
2. Vector Database & Embeddings
I utilized ChromaDB as the vector store. When documents are loaded, they are converted into dense vector embeddings using the sentence-transformers/all-MiniLM-L6-v2 model. This allows the system to perform "Semantic Search"—finding text that matches the meaning of the user's question, not just the keywords.
Retrieve: The user's question is embedded, and the top 5 most similar chunks are fetched from the database.
Augment: These chunks are combined into a single "Context" block.
Generate: A strict system prompt instructs the LLM to answer only based on the provided context.
🚧 Challenges & Solutions
One of the significant hurdles I faced during development was the "Dependency Civil War" between modern AI libraries.
The Issue: The latest Python 3.14 release is not yet supported by onnxruntime (required by ChromaDB), while newer LangChain versions required Pydantic v2, clashing with older database dependencies.
The Solution: I engineered a specific requirements.txt and enforced a Python 3.11 environment. This resolved the symbol compatibility issues and allowed pydantic-settings to function correctly with the latest LangChain orchestration.
💻 How to Run This Project
Prerequisites: Python 3.11 and an API Key (OpenAI, Groq, or Google).
Clone the Repo:
git clone https://github.com/HEPTA-111/rt-agentic-ai-certification.git
Install Dependencies:
pip install -r requirements.txt
Run the App:
streamlit run src/app.py
🔮 Future Improvements
Upload Button: Adding a drag-and-drop file uploader directly in the UI (currently it loads from a folder).
Chat History Persistence: Saving chat logs to a local file so conversations aren't lost on refresh.
Source Citation: Modifying the prompt to strictly cite which document file provided the answer.