AttentionGuardian-AI

πŸ›‘οΈ About Attention Guardian AI

Attention Guardian AI is a productivity Chrome Extension that replaces distracting advertisements on learning websites with AI-generated study tips and interactive quizzes.

It helps users stay focused while browsing educational content by turning distractions into micro-learning moments.


✨ Features


🧩 Architecture

Chrome Extension (content.js)
        ↓
Local AI Server (Node.js + OpenRouter)
        ↓
AI‑generated Tips / Quiz
        ↓
Rendered in Webpage instead of Ads

Dashboard:

Chrome Storage β†’ React Dashboard UI

🌐 Supported Sites


πŸ“¦ Project Structure

AttentionGuardian-AI
β”‚
β”œβ”€β”€ extension/           # Chrome extension
β”‚   β”œβ”€β”€ content.js
β”‚   β”œβ”€β”€ background.js
β”‚   β”œβ”€β”€ style.css
β”‚   β”œβ”€β”€ manifest.json
β”‚   └── icons/
β”‚       β”œβ”€β”€ icon16.png
β”‚       β”œβ”€β”€ icon48.png
β”‚       └── icon128.png
β”‚
β”œβ”€β”€ dashboard/           # React analytics dashboard
β”‚   β”œβ”€β”€ src/
β”‚   └── public/
β”‚
β”œβ”€β”€ server.js            # AI tip server
β”œβ”€β”€ package.json
β”œβ”€β”€ .env                 # API key

πŸš€ Installation Guide (Step‑by‑Step)

1️⃣ Clone the Repository

git clone https://github.com/SaiKarthik29/AttentionGuardian-AI.git
cd AttentionGuardian-AI

πŸ”‘ 2️⃣ Setup AI Key

Create a .env file in the root folder:

OPENROUTER_KEY=your_openrouter_api_key_here

Get free key from: πŸ‘‰ https://openrouter.ai/keys


πŸ€– 3️⃣ Start AI Server

npm install
npm start

You should see:

AI server running at http://localhost:5000

Test in browser:

http://localhost:5000/tip?topic=javascript&concept=loop

🧩 4️⃣ Load Chrome Extension

  1. Open Chrome
  2. Go to: chrome://extensions/
  3. Enable Developer Mode
  4. Click Load unpacked
  5. Select the extension folder

Extension will appear in Chrome toolbar.


πŸ§ͺ 5️⃣ Test Extension

Open any supported learning site:

Ads will be replaced by:

Study Tip
AI‑generated learning tip

On YouTube ads β†’ AI quiz overlay appears.


πŸ“Š 6️⃣ Run Dashboard (Optional)

cd dashboard
npm install
npm start

Dashboard shows:


🧠 How It Works

  1. Content script scans page for ads
  2. Detects topic from page content
  3. Requests AI tip from local server
  4. AI generates contextual tip
  5. Extension replaces ad with tip card

YouTube ads β†’ replaced by quiz overlay.


πŸ”’ Privacy


πŸ› οΈ Tech Stack


🎯 Use Cases


πŸ“Œ Future Enhancements


πŸ‘¨β€πŸ’» Author

Sai Karthik Sriram GitHub: https://github.com/SaiKarthik29


⭐ If you like this project

Give it a ⭐ on GitHub and share!


βœ… Status

βœ” Extension working βœ” AI tips generation βœ” Quiz overlay βœ” Dashboard analytics

Production‑ready for local usage.