How synapsysesprit/aigis works
Project Type and Purpose
• This is a full-stack application combining a browser extension (“Aigis”) with a Django-based backend.
• Purpose: real-time AI-powered detection of online threats in chat, audio, video, images, and text, plus a parental dashboard for alerts and reports.
File Structure
• Top-level:
• Backend/ – Django project (“Backend”)
– Backend/Backend – core Django settings, ASGI/WSGI, URLs
– manage.py
– apps: audio, chatbot, image, text, video
– cache/models… – local HuggingFace model snapshots
– tools/espeak – embedded TTS engine
– templates/*.html – chat interface & dashboard
• extension/ – Chrome extension
– manifest.json, background.js, popup.html/css/js, dashboard.html/css/js
– content_scripts/ – scripts for audio, text, video, nudity, behavior, deepfake, usage pattern
README for Additional Insights
• AI Models & Detection: OpenAI Whisper & Gemini, DeepFace/Deepware, MediaPipe, OpenCV, custom NLP
• External Services: HuggingFace, ElevenLabs, GROQ API
• Dashboard: React + Shadcn UI (though code shows Django templates – treat as a web UI layer)
Main Components & Their Interactions
a. Browser Extension
• Content Scripts (audio_script.js, video_script.js, etc.) detect events in the page.
• background.js orchestrates data collection & forwards to backend.
• popup.html/js & dashboard.html/js are the extension’s front-end UIs.
b. Backend Web Service (Django)
• URL router delegates to apps: /audio/, /text/, /image/, /video/, /chatbot/
• Views invoke local models (cache/) or external AI APIs for inference.
• Data persisted to Django ORM (DB).
• templates/ serve the parental dashboard & chat interface.
c. AI Inference Layer
• Local: HuggingFace models (cached), Espeak for TTS, OpenCV for frames.
• Remote: OpenAI/Gemini (audio/text), ElevenLabs (voice), GROQ, DeepFace/MediaPipe services.
d. Database
• Stores user sessions, alerts, logs, parental settings, knowledge base references.
e. External Services
• Cloud AI endpoints, model hubs, PDF/text knowledgebase for chatbot.
[Web Page] → content_script → background.js → HTTP POST → [Django API View]
→ AI Inference (local or external) → results → ORM → response → background.js → extension UI
Architectural Patterns & Principles
• Backend: MVC (Django apps separated by concern), caching layer for heavy models.
• Extension: event-driven content scripts + background page.
• Modular AI layer: abstract interface to local vs. remote inference.
• Separation of concerns: detection domains (audio, video, text, image, chatbot).
Essential Details to Capture
• All detection domains as separate modules.
• Local vs. external inference paths.
• Data storage & retrieval points.
• UI data flows: extension popup vs. parental dashboard.
• Model caching and espeak integration.