RAG-Based AI Assistant – Project 1 (AAIDC Module 1)
Author
Deepthi Reddy
Module
Module 1 – Agentic AI Developer Certification
Project Overview
This project demonstrates a Retrieval-Augmented Generation (RAG) AI assistant that answers questions from a custom document collection. Unlike standard chatbots, this system retrieves relevant content before generating responses.
Key Features:
Load and process multiple document types (.txt, .pdf)
Chunk documents for efficient retrieval
Embed documents in a vector database (ChromaDB / FAISS / alternatives)
Perform semantic search to find relevant information
Generate context-aware answers using LLMs (OpenAI GPT, Groq, Google Gemini)
Architecture
User Query
↓
Document Retrieval (Vector Database)
↓
Context Assembly
↓
LLM Response Generation
↓
Answer to User
Components:
Vector Database: Stores embeddings for semantic search
Embedding Model: Converts text chunks into vectors
LLM: Generates natural language responses using retrieved context
Implementation Steps
Document Loading: Read documents from the data/ folder.
Text Chunking: Split documents into smaller chunks for better retrieval.
Document Ingestion: Embed chunks and store in vector database.
Similarity Search: Retrieve top-k relevant chunks for a query.
Prompt Design: Use a template to instruct the LLM with context + question.
Query Pipeline: Combine search and LLM generation to answer user queries.
Code Snippet Example:
from src.app import RAGAssistant, load_documents
assistant = RAGAssistant()
docs = load_documents()
assistant.add_documents(docs)
response = assistant.invoke("What is machine learning?")
print(response)
Example Output:
Machine Learning is a field of AI that enables systems to learn from data, identify patterns, and make predictions without being explicitly programmed...
Project Repository