Skip to content

sujitha-kotyada/Study-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 Study Chatbot — LearnLoop

A lightweight AI-powered Physics and Chemistry tutor chatbot built with Flask and Google Gemini 2.5 Flash. Ask questions and get concise, conversational explanations — no textbook jargon.

Python Flask Gemini


✨ Features

  • 🧪 Physics & Chemistry Focus — Tutor specialized in Physics and Chemistry topics
  • 💬 Conversational Tone — Short, simple answers (3–5 lines) without textbook-style paragraphs
  • ⚡ Powered by Gemini — Uses Google Gemini 2.5 Flash for fast, accurate responses
  • 🌐 Web Interface — Clean chat UI served via Flask templates
  • 🔌 REST API — Simple /chat endpoint for integration with other apps

🛠️ Tech Stack

Layer Technology
Backend Python, Flask
AI Model Google Gemini 2.5 Flash
Frontend HTML, CSS, JavaScript (Jinja2 templates)

🚀 Getting Started

Prerequisites

  • Python 3.9+ installed
  • A Google Gemini API Key (Get one here)

Installation

  1. Clone the repository

    git clone https://github.com/sujitha-kotyada/study-chatbot.git
    cd study-chatbot
  2. Create a virtual environment

    python -m venv .venv
  3. Activate the virtual environment

    • Windows:
      .venv\Scripts\activate
    • macOS/Linux:
      source .venv/bin/activate
  4. Install dependencies

    pip install flask google-genai
  5. Configure your API key

    Create a .env file in the project root:

    GEMINI_API_KEY=your_gemini_api_key_here

    ⚠️ Important: Never hardcode API keys in source code. Use environment variables.

  6. Run the application

    python main.py
  7. Open in browser

    Navigate to http://localhost:5000


📖 Usage

  1. Open the chat interface in your browser
  2. Type a Physics or Chemistry question
  3. Get a concise, conversational answer in seconds

Example Questions

  • "What is Newton's third law?"
  • "Explain covalent bonding"
  • "Why does ice float on water?"
  • "What is the difference between speed and velocity?"

🔌 API Reference

POST /chat

Send a message and receive an AI response.

Request: application/json

{
  "message": "What is Ohm's law?"
}

Response: application/json

{
  "reply": "Ohm's law states that the current flowing through a conductor is directly proportional to the voltage across it, given constant temperature. The formula is V = IR, where V is voltage, I is current, and R is resistance."
}

📁 Project Structure

study-chatbot/
├── main.py              # Flask backend with Gemini AI integration
├── templates/
│   └── index.html       # Chat UI frontend
└── README.md

📜 License

This project is open source and available under the MIT License.


🙋‍♀️ Author

Sujitha Kotyada@sujitha-kotyada

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors