Skip to content

theHoodguy4587/AI-Assessment-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

AI Assessment Assistant (RAG Chatbot)

An AI-powered chatbot built using Retrieval-Augmented Generation (RAG) that delivers accurate, context-aware answers for educational and assessment-related queries.

The system combines semantic search, embeddings, and Large Language Models (LLMs) to retrieve relevant information from a custom knowledge base and generate intelligent responses in real time.


Live Demo

Streamlit UI

http://18.224.111.129:8501

Flask API

http://18.224.111.129:5000/chat

Note: The demo may be temporarily unavailable if the AWS EC2 instance is stopped to remain within AWS Free Tier limits.


Features

  • Semantic search using vector embeddings
  • Context-aware AI responses using Gemini 2.5 Flash
  • Retrieval-Augmented Generation (RAG) pipeline
  • Knowledge base stored in AWS S3
  • REST API built with Flask
  • Interactive Streamlit chat interface
  • Cloud deployment using AWS EC2 and Elastic IP
  • Real-time retrieval from custom educational dataset

System Architecture

User Query
    ↓
Streamlit UI
    ↓
Flask API
    ↓
Sentence Embeddings
    ↓
Cosine Similarity Retrieval
    ↓
Gemini 2.5 Flash
    ↓
Generated Response

Tech Stack

Backend

  • Flask - Web framework for API
  • Python - Programming language

Frontend

  • Streamlit - Interactive chat interface

LLM

  • Gemini 2.5 Flash API - Language model for response generation

Embeddings

  • sentence-transformers - Embedding model library
  • all-MiniLM-L6-v2 - Pre-trained embedding model

Cloud Services

  • AWS EC2 - Virtual machine for hosting
  • AWS S3 - Dataset storage
  • IAM Roles - Access management
  • Elastic IP - Stable public address

Libraries

  • Transformers
  • NumPy
  • boto3
  • scikit-learn

API Testing

Example Request

curl -X POST "http://18.224.111.129:5000/chat" \
  -H "Content-Type: application/json" \
  -d '{"query":"What is machine learning?"}'

Example Response

{
  "answer": "Machine learning is a subset of artificial intelligence that enables systems to learn from data.",
  "query": "What is machine learning?",
  "top_results": [
    "Machine learning is a subset of artificial intelligence that enables systems to learn from data.",
    "Supervised learning uses labeled data to train models."
  ]
}

UI Preview

Home Page

Home Page

Chat Output

Chat Output


Installation

Clone Repository

git clone https://github.com/theHoodguy4587/AI-Assessment-Assistant.git
cd AI-Assessment-Assistant

Create Virtual Environment

Windows:

python -m venv rag-env
rag-env\Scripts\activate

Linux / Mac:

python3 -m venv rag-env
source rag-env/bin/activate

Install Dependencies

pip install -r requirements.txt

Running the Project

Start Flask Backend

python app.py

The backend will run on: http://localhost:5000

Start Streamlit UI

streamlit run ui.py --server.address 0.0.0.0 --server.port 8501

The UI will run on: http://localhost:8501


AWS Deployment

This project is deployed using AWS cloud services:

  • EC2 Instance - Hosting backend and frontend
  • S3 Bucket - Dataset storage
  • IAM Role - Secure S3 access
  • Elastic IP - Stable public access

How the RAG Pipeline Works

  1. User submits a question through the Streamlit UI
  2. The Flask API receives the query
  3. The query is converted into embeddings
  4. Cosine similarity retrieves the most relevant documents
  5. Retrieved context is sent to Gemini 2.5 Flash
  6. The generated response is returned to the user

Current Limitations

  • Small educational dataset
  • CPU-based inference on EC2
  • No vector database integration yet
  • Limited conversational memory

Future Improvements

  • Add FAISS or Pinecone vector database
  • Improve prompt engineering
  • Add chat history memory
  • Dockerize the application
  • Add authentication system
  • Deploy with Nginx and Gunicorn
  • Add conversation analytics dashboard
  • Expand dataset with more educational topics

Author

Senitha Gunathilaka

Aspiring Data Scientist | AI & RAG Enthusiast


Support

If you found this project useful, consider giving the repository a star ⭐

About

An AI-powered chatbot built using Retrieval-Augmented Generation (RAG) that delivers accurate, context-aware answers for educational and assessment-related queries.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors