Skip to content

About

User-friendly AI Interface For explaination of topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AI Study Topic Explainer

Project Description

An AI-powered web application that helps students understand complex study topics through simple, student-friendly explanations. Students can enter any topic and receive instant, easy-to-understand explanations generated by advanced AI models.

Key Features:

  • Clean, responsive web interface
  • Real-time AI-generated explanations
  • Support for various study topics (science, math, history, etc.)
  • Markdown-formatted output for better readability
  • Daily rate limiting (30 requests per API)

How AI API Was Used

The application integrates two AI APIs with automatic fallback:

Primary API: Google Gemini

  • Used for generating initial explanations
  • Model: gemini-2.5-flash (configurable via GEMINI_MODEL)
  • Provides high-quality, student-friendly explanations

Fallback API: Groq

  • Automatically used if Gemini fails
  • Model: openai/gpt-oss-120b (configurable via GROQ_MODEL)
  • Ensures reliability with fast inference

Implementation Details:

  • API calls made from Next.js API routes (/api/explain)
  • Prompts designed to generate concise, educational content
  • Comprehensive logging of usage statistics and metadata
  • Error handling with graceful degradation
  • Daily rate limiting: 30 requests per API (resets daily)

Setup Instructions

Prerequisites

  • Node.js 18+ installed
  • API keys for Google Gemini and Groq

Installation

  1. Clone and install dependencies:

    git clone https://github.com/MagicalCoder-12/AI-study-Explainer.git
    cd ai-study-explainer
    npm install
  2. Configure environment variables:

    Create .env.local file:

    # Get from https://makersuite.google.com/app/apikey
    GOOGLE_API_KEY=your_gemini_api_key_here
    
    # Get from https://console.groq.com/
    GROQ_API_KEY=your_groq_api_key_here
    
    # Optional: override default models
    GEMINI_MODEL= gemini-2.5-flash
    GROQ_MODEL= openai/gpt-oss-120b
  3. Run the application:

    npm run dev
  4. Open in browser:

    • Navigate to http://localhost:3000
    • Enter a study topic and click "Explain Topic"

API Key Setup

The application will automatically use Gemini first, falling back to Groq if needed.

About

User-friendly AI Interface For explaination of topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages