Architecture note
Available for software engineering roles - backend systems, production reliability, cloud deployment, and AI-assisted workflows.
AI-assisted network traffic review prototype using anomaly signals, entropy-style scoring, FastAPI, React, SQLite, and local/hosted AI summaries.
01
Network events can be noisy, difficult to prioritize, and hard to explain quickly without structured signals.
AI summaries are useful only when they stay grounded in observable data and avoid overstating security impact.
02
A FastAPI and React prototype for reviewing traffic signals and producing AI-assisted summaries.
A detection direction using anomaly-style scoring, entropy-oriented features, and structured event storage.
A privacy-aware AI path that can use local models such as Ollama, with hosted model fallback where appropriate.
03
FastAPI backend for ingestion and analysis endpoints.
React interface for reviewing network and security signals.
SQLite-backed prototype storage.
Isolation Forest-style anomaly detection direction.
Entropy-style scoring for suspicious or unusual patterns.
Local/hosted AI summary boundary using Ollama and Gemini.
04
Prototype. It should not be described as a production security control or a verified threat-detection system.
05
Primary language: Python
Technologies: Python, FastAPI, React, SQLite, AdGuard, Ollama, Gemini, Isolation Forest, Entropy, TypeScript, JavaScript, HTML, CSS, Docker, NumPy, Pydantic, Pytest, Scikit-learn, Uvicorn, Docker Compose
Topics: Not specified
Last updated: 2026-05-27T04:54:01Z
Stars: 0
Forks: 0
Status: Active
Architecture note
Visual notes
Network Guardian AI is a real-time network security platform with multi-tenant support. It intercepts DNS queries via AdGuard, performs multi-layered behavioral analysis, and provides threat intelligence through a modern dashboard UI.
Security-as-a-Service: Ready for commercial offering with tenant isolation, billing integration, and tier-based access control.
┌─────────────────────────────────────────────────────────────┐
│ Docker Compose │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────────────┐ ┌─────────────────────────┐ │
│ │ Network Guardian │ │ AdGuard Home │ │
│ │ (Backend + UI) │ │ (DNS Interceptor) │ │
│ │ Port: 8000 │ │ Port: 8080, 53 │ │
│ └─────────────────────┘ └─────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Components:
| Layer | Method | Purpose |
|---|---|---|
| Layer 1 | Shannon Entropy | Detects random DGA strings locally |
| Layer 2 | Isolation Forest (ML) | Unsupervised anomaly detection |
| Layer 3 | Gemini AI | Semantic threat analysis |
| Layer 4 | Blocklist Lookup | Known threat database |
| Tier | Features | Rate Limit |
|---|---|---|
| Free | 100 requests/min | Basic ML heuristics |
| Pro | Unlimited + Gemini AI | Full analysis pipeline |
| Enterprise | Custom + SLA | Priority support |
POST /billing/checkout - Create Stripe checkout session
POST /billing/portal - Get customer portal URL
POST /billing/webhook - Stripe webhook handler
GET /billing/tiers - List subscription tiers
POST /api/v1/analyze - Analyze domain
GET /api/v1/stats - Get tenant statistics
GET /api/v1/history - Get threat history
WS /ws/public - Real-time updates
| Tier | Requests/Minute |
|---|---|
| Free | 100 |
| Pro | 1000 |
| Enterprise | Unlimited |
cp .env.example .env
# Edit .env with your API keys:
GEMINI_API_KEY=your_key
STRIPE_API_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Build and start
docker compose up --build -d
# Or just start (if image exists)
docker compose up -d
| Service | URL |
|---|---|
| Dashboard | http://localhost:8000 |
| AdGuard UI | http://localhost:8080 |
| API Docs | http://localhost:8000/docs |
# Core
GEMINI_API_KEY=your_gemini_key
ADGUARD_URL=http://adguard:80
ADGUARD_USER=admin
ADGUARD_PASS=your_password
# Stripe Billing
STRIPE_API_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
STRIPE_PRO_PRICE_ID=price_...
STRIPE_ENTERPRISE_PRICE_ID=price_...
# Ollama (optional)
OLLAMA_ENABLED=false
OLLAMA_BASE_URL=http://host.docker.internal:11434
OLLAMA_MODEL=nomic-embed-text
OLLAMA_CHAT_MODEL=llama3.2
# Multi-Tenancy
ENVIRONMENT=development # Set to production for production
API_RATE_LIMIT_PER_TENANT=100
DEFAULT_TENANT_ID=1
# All tests
PYTHONPATH=. python -m pytest Tests_AI/ -v
# Single test
PYTHONPATH=. python -m pytest Tests_AI/test_heuristics.py -v
# With coverage
PYTHONPATH=. pytest Tests_AI/ -v --cov=backend
# Linting
ruff check backend/ && ruff check backend/ --fix
mypy backend/ --ignore-missing-imports
network-guardian-ai/
├── backend/
│ ├── api/ # FastAPI routes
│ │ ├── stats.py # Statistics endpoints
│ │ ├── chat.py # Chatbot
│ │ ├── billing.py # Stripe billing
│ │ ├── tenant_router.py
│ │ └── developer_router.py
│ ├── core/
│ │ ├── config.py # Settings
│ │ ├── tenant_middleware.py
│ │ └── websocket_manager.py
│ ├── db/
│ │ ├── models.py # SQLAlchemy models
│ │ ├── repository.py # Data access
│ │ └── database.py # DB connection
│ ├── logic/
│ │ ├── ml_heuristics.py
│ │ ├── anomaly_engine.py
│ │ └── metadata_classifier.py
│ └── services/
│ ├── adguard_poller.py
│ ├── gemini_service.py
│ └── blocklist_loader.py
├── frontend/
│ ├── components/
│ │ ├── Dashboard.tsx
│ │ ├── StatsPanel.tsx # 12-panel overview
│ │ ├── AdminDashboard.tsx
│ │ ├── LoginPage.tsx
│ │ └── TenantSelector.tsx
│ ├── services/
│ │ ├── tenantService.ts
│ │ └── websocketService.ts
│ └── App.tsx
├── docker-compose.yml # Production
├── docker-compose.dev.yml # Development with hot-reload
├── Dockerfile # Multi-stage build
└── Tests_AI/ # pytest tests
Next field note
Open to software engineering roles across full-stack systems, platform and reliability work, workflow automation, and applied AI.
Write to Himanshu Lade →