Skip to content

manan-monani/Aarohan-AI

Repository files navigation

🚀 Aarohan AI

An Offline-First, Agentic AI Tutor for Indian Students powered by Gemma 4


📖 About The Project

Aarohan AI is an advanced, offline-capable AI educational assistant specifically tailored for Class 11 and 12 Science students in India. Built to bridge the educational resource gap, it provides instant, textbook-accurate answers, multimodal problem solving (camera & voice), and interactive quizzes—all running locally on the student's mobile device.

By leveraging Google's latest Gemma 4 E2B-it model, Aarohan AI eliminates the need for an active internet connection or expensive cloud subscriptions to democratize education.


🧠 How We Used Gemma 4

This project explores the cutting edge of On-Device Local AI. We utilized the Gemma 4 E2B-it (1.5GB) model to achieve the following:

  1. True Offline Execution: Compiling the model via LiteRT (TensorFlow Lite) using the flutter_gemma package allowed us to run billion-parameter LLM inference directly on average consumer Android hardware.
  2. Multimodal Capabilities: The multimodal nature of Gemma 4 enables students to take pictures of their textbook problems or hand-written equations. The app passes both the captured image and the prompt context directly to the Gemma 4 engine for comprehensive visual analysis.
  3. Low Latency Inference: The context window is optimized to 1,024 tokens to strictly protect the device's RAM and prevent OOM (Out-of-Memory) crashes on budget smartphones, producing fast generative text speeds.

⚡ Technical Approach & RAG-First Architecture

We implemented a highly optimized Retrieval-Augmented Generation (RAG) pipeline to make the app incredibly fast and completely hallucination-free for textbook questions.

The "RAG-First" Strategy

Because running local LLMs can be computationally expensive (taking 5-15 seconds per response), we implemented a clever fallback mechanism:

  1. We parsed and extracted 3,575 pages of official NCERT textbooks into a local JSON bundle.
  2. Upon first launch, Aarohan AI injects this data into a native SQLite database using Full-Text Search indexing.
  3. Execution: When a student asks a textbook question (e.g., "What is Newton's Third Law?"), the App queries the local DB.
    • If a highly confident NCERT match is found (90% of textbook questions), the app instantly streams the exact, formatted textbook text to the student in < 1 second without ever making the Gemma model calculate!
    • If it is a novel question, or an image upload, the app defaults back to the Gemma 4 LLM to creatively solve the problem.

Technology Stack

  • Frontend UI: Flutter & Dart (Cross-platform, highly responsive dynamic UI)
  • Local AI Inference: flutter_gemma (LiteRT-LM)
  • Vector/Relational Data: SQLite (sqflite plugin)
  • Voice/Speech-to-Text: Native Android speech-to-intent APIs
  • Fine-Tuning Engine (Optional): Unsloth via Kaggle Notebooks (PyTorch, HuggingFace TRL)

🛠️ Features

  • 100% On-Device AI: Total privacy; no user data or images ever leave the smartphone.
  • Multimodal Chat: Ask doubts via Voice, Text, or Camera captures.
  • Instant RAG Retrieval: Millisecond-level retrieval of official NCERT text.
  • Automated Model Lifecycle: The app automatically checks, downloads, and initializes the 1.5GB .litertlm file on device setup.
  • Backend Fail-safes: For development, the app cascades its backend: LiteRT (Primary Phone Native) → Ollama (PC Localhost) → Simulated (Demo mode).
  • Subject Specific Quizzes: Interactive MCQs designed for competitive exams (JEE/NEET).

💻 Installation & Setup

Prerequisites

  • Flutter SDK (v3.19+)
  • Android Studio / ADB debug tools
  • A physical Android device with Android 10+ and > 4GB of RAM (Required for local inference)

Running the App

  1. Clone the repository:
    git clone https://github.com/your-username/aarohan-ai.git
    cd "aarohan-ai"
  2. Install dependencies:
    flutter pub get
  3. Connect your Android phone via USB Debugging.
  4. Run the app:
    flutter run

On the first launch, the app will download the E2B Gemma model and index the local SQLite database. Please ensure you have wifi for the initial 1.5GB download!


🚀 Custom Fine-Tuning (Kaggle)

Want to train Gemma 4 to answer questions in a specific teaching tone? We included our exact fine-tuning pipeline!

  1. Run the auto-uploader script provided in the repository:
    python Data/push_to_kaggle.py
  2. When prompted, enter your Kaggle username. (Requires Kaggle API Key PAT).
  3. The script will securely upload your QA datasets (train_dataset.json).
  4. Import Data/Kaggle_Finetuning.ipynb into a new Kaggle kernel, attach the T4 x2 GPUs, and hit Run All!

Built with ❤️ using Flutter & Google Gemma 4 for the Future of Education Hackathon.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages