Skip to content

AI educational chatbot with document upload and intelligent Q&A using RAG and Google Gemini Flash

License

Notifications You must be signed in to change notification settings

lakshitavyas02/eduChatBot_RAG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 AI Educational Chatbot with RAG

An AI chatbot that allows users to upload documents and ask questions using Retrieval-Augmented Generation (RAG) powered by Google Gemini Pro. Features user authentication, document processing, and intelligent query suggestions.

image

🌟 Features

  • Document Support: PDF, TXT, DOCX, PPTX, Markdown, HTML files (up to 16MB)
  • Vector Search: FAISS-powered similarity search for content retrieval
  • AI Responses: Google Gemini Pro generates contextual answers
  • Chat History: Persistent conversation storage
  • User Authentication: Secure registration/login with JWT tokens
  • Query Suggestions: AI-generated question suggestions
  • Analytics: Usage statistics and insights
  • Modern UI: Responsive interface with drag-and-drop

🛠️ Tech Stack

  • Frontend: HTML5, CSS3, JavaScript
  • Backend: Flask (Python)
  • Database: SQLite
  • Vector DB: FAISS with Sentence Transformers
  • LLM: Google Gemini Pro API
  • Embeddings: all-MiniLM-L6-v2

📁 Project Structure

RAG/
├── frontend/               # Web interface
├── backend/               # Core logic and APIs
├── data/                  # SQLite database
├── uploads/               # User files
├── vectorstore/           # FAISS index
├── app.py                 # Main Flask app
├── run.py                 # App runner
└── requirements.txt       # Dependencies

🚀 Quick Start

1. Prerequisites

2. Setup

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env and add your GOOGLE_API_KEY

# Run application
python app.py

Visit: http://localhost:5000

📖 Usage

  1. Upload: Drag & drop documents (PDF, TXT, DOCX, etc.)
  2. Ask: Type questions about your documents
  3. Get Answers: AI responses with source attribution

🔧 Key API Endpoints

  • POST /upload - Upload documents
  • POST /ask - Ask questions
  • POST /auth/register - User registration
  • POST /auth/login - User login
  • GET /chat/history - Chat history
  • GET /analytics - Usage analytics

🔒 Security Features

  • JWT-based authentication
  • bcrypt password hashing
  • Input validation and sanitization
  • User data isolation
  • Guest mode support

🔧 Configuration

Create .env file with:

GOOGLE_API_KEY=your_api_key_here
SECRET_KEY=your_secret_key
FLASK_ENV=development

🐛 Troubleshooting

  • API Key Error: Check .env file has valid GOOGLE_API_KEY
  • Module Errors: Run pip install -r requirements.txt
  • Upload Fails: Check file size (max 16MB) and format support
  • Auth Issues: Verify SECRET_KEY in .env

📝 License

MIT License

🙏 Acknowledgments

  • Google Gemini flash for AI capabilities
  • Sentence Transformers for embeddings
  • FAISS for vector search
  • Flask for web framework

Happy Learning! 🎓

About

AI educational chatbot with document upload and intelligent Q&A using RAG and Google Gemini Flash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published