Skip to content

AI-Powered Tutoring Platform - Real-time voice AI with sub-500ms latency, adaptive learning & persistent memory

License

Notifications You must be signed in to change notification settings

aditya-ai-architect/EdGrab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

E D G R A B

Personalized AI Tutor

EdGrab :- Deployed Link

License React TypeScript Gemini API

Your personal intelligence engine. Master your syllabus, schedule your success, and never forget a thing.


โšก The Purpose

EdGrab is not just a chatbot. It is a Context-Aware Educational Intelligence designed to simulate the experience of a dedicated human tutor.

Unlike generic LLM wrappers, EdGrab maintains a persistent "Memory Bank" of your school schedule, upcoming exams, and syllabus. It leverages Gemini 3.0 Pro for deep reasoning and complex math, while utilizing Gemini 2.5 Flash Native Audio for real-time, low-latency voice coaching sessions. It turns the chaos of student life into a structured path to mastery.


๐Ÿ›‘ Problem Statement

Students face significant challenges in self-regulated learning:

Challenge Impact
Generic Assistance AI tools lack context of grade level, school, or curriculum, leading to irrelevant answers.
Passive Learning Text-only interactions fail to build retention compared to oral active recall.
Disorganized Schedules Students cram 48 hours before exams due to poor time management.
Math Hallucinations Standard LLMs struggle with complex STEM derivation without specific reasoning capabilities.

Solution

EdGrab addresses these challenges through a multi-modal architecture that combines deep reasoning, structured data generation (JSON exams), and real-time voice interaction to create a holistic learning environment.


๐Ÿš€ Educational Impact

Learning Efficiency

  • Context Injection: No need to explain "I'm in 10th grade" every time. EdGrab knows.
  • Active Recall: "Live Mode" quizzes you verbally to ensure true understanding.

Strategic Advantages

  • Thinking Models: Uses gemini-3-pro-preview with thinking budgets for high-accuracy STEM solving.
  • Structured Practice: Generates strict JSON-based mock exams for objective scoring.

๐Ÿ”— The AI Architecture

EdGrab employs a multi-model approach powered by the Google GenAI SDK, routing specific tasks to the most efficient model.

1. โšก The Tutor Core (gemini-3-pro-preview)

  • Role: The Professor.
  • Task: Handles complex chat interactions, math problems (LaTeX output), and deep concept explanation.
  • Config: Uses thinkingConfig to allocate token budgets for reasoning before answering.

2. ๐ŸŽ™๏ธ Live Voice Agent (gemini-2.5-flash-native-audio)

  • Role: The Coach.
  • Task: Establishes a WebSocket connection for real-time, interruptible voice conversations.
  • Latency: Optimized for sub-500ms interaction.

3. ๐Ÿ“ Exam Generator (gemini-2.5-flash)

  • Role: The Examiner.
  • Task: Generates strictly typed JSON arrays of multiple-choice questions based on specific syllabus topics.

4. ๐Ÿ—ฃ๏ธ Speech Synthesis (gemini-2.5-flash-tts)

  • Role: The Narrator.
  • Task: Converts text responses into lifelike audio for accessibility and auditory learning.

๐Ÿ“‚ File Structure

/EdGrab
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ Auth.tsx             # User authentication flow
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ Chat.tsx             # Main chat interface with Markdown/Math support
โ”‚   โ”œโ”€โ”€ Dashboard.tsx        # Visual progress tracking
โ”‚   โ”œโ”€โ”€ Live.tsx             # Real-time audio visualizer & connection
โ”‚   โ”œโ”€โ”€ Memory.tsx           # Schedule & Exam management
โ”‚   โ”œโ”€โ”€ MockExams.tsx        # AI-generated testing center
โ”‚   โ””โ”€โ”€ Profile.tsx          # User settings
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ audioUtils.ts        # PCM encoding/decoding for Live API
โ”‚   โ””โ”€โ”€ geminiService.ts     # Centralized GenAI SDK implementation
โ”œโ”€โ”€ App.tsx                  # Routing & State Management
โ”œโ”€โ”€ types.ts                 # TypeScript interfaces
โ””โ”€โ”€ metadata.json            # Permissions config

๐Ÿ—๏ธ Implementation Details

1. Context Injection (System Instructions)

EdGrab injects the user's "Memory Bank" (Schedule/Exams) directly into the model's system instruction, ensuring every response is personalized.

Sample (geminiService.ts):

const getSystemInstruction = (user, schedule, exams) => {
  return `You are EdGrab, a tutor for ${user.firstName}.
  Context: ${user.grade} at ${user.school}.
  Upcoming Exams: ${exams.map(e => `${e.subject} on ${e.date}`).join(', ')}.
  
  IDENTITY RULES:
  - Remind them if they are wasting time near an exam.
  - Use LaTeX for math.
  `;
};

2. Real-time Audio (Live API)

Implemented via ai.live.connect with bi-directional streaming. We handle raw PCM audio processing in the browser.

Sample (services/geminiService.ts):

export const connectLiveSession = async (user, exams, callbacks) => {
  const ai = new GoogleGenAI({ apiKey: process.env.API_KEY });
  return ai.live.connect({
    model: 'gemini-2.5-flash-native-audio-preview-09-2025',
    config: {
      responseModalities: [Modality.AUDIO],
      systemInstruction: `Speaking to ${user.firstName}. Context: ${user.grade}...`
    },
    callbacks
  });
};

3. Structured Data (Mock Exams)

Uses responseSchema to force the model to output valid JSON for the exam engine, eliminating parsing errors.

Sample (services/geminiService.ts):

const response = await ai.models.generateContent({
  model: "gemini-2.5-flash",
  config: {
    responseMimeType: "application/json",
    responseSchema: {
      type: Type.ARRAY,
      items: { type: Type.OBJECT, properties: { ... } }
    }
  }
});

๐Ÿ”‘ Key Features

๐Ÿ“Š Visual Intelligence Dashboard

  • Metrics: High-contrast tracking of exams, streaks, and study hours.
  • Up Next: Dynamic cards showing the immediate next class in your schedule.

๐ŸŽ™๏ธ Live Tutor Mode

  • Visualizer: Real-time audio wave visualization driven by RMS amplitude.
  • Bi-directional: Interrupt the AI anytime, just like a real conversation.

๐Ÿง  Thinking Mode

  • Toggleable "Thinking" mode in chat that allocates a 32k token budget for the model to "think" before answering complex physics or calculus questions.

๐Ÿ› ๏ธ Tech Stack

  • Core: React 19, TypeScript, Vite.
  • AI: @google/genai SDK.
  • Styling: Tailwind CSS (Custom "EdGrab Dark" Theme).
  • Visualization: Recharts.
  • Math Rendering: KaTeX + React Markdown.

โš ๏ธ Important Note

For the best experience, please use the deployed application.

If you encounter quota-related errors when running locally with a free-tier Gemini API key, this is expected behavior due to API rate limitations. The deployed version is configured with appropriate API access to ensure uninterrupted service.


๐Ÿ Getting Started

Prerequisites

  • Node.js 18+
  • A Google Cloud Project with Gemini API enabled.

Installation

  1. Clone the repository

    git clone https://github.com/aditya-ai-architect/EdGrab.git
    cd EdGrab
  2. Install dependencies

    npm install
  3. Configure Environment Create a .env file in the root (or rely on the app's internal handling if configured differently):

    API_KEY=your_google_gemini_api_key_here
  4. Run the Tutor

    npm run dev

๐ŸŽฎ Usage

  1. Initialize: Create your profile (Grade, School).
  2. Memory: Go to the "Memory" tab and add your weekly schedule and upcoming exams.
  3. Chat: Ask questions. EdGrab will reference your exams ("Don't forget your Calculus test on Friday!").
  4. Live: Click the microphone icon to practice orally.
  5. Exam: Generate a mock test to check your readiness.

Created for the Future of Education.

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •