How anesthesiaprovider/narrativelens-ai- works
NarrativeLens AI is a moderation and OSINT workbench for detecting harmful content, investigating narratives, and analyzing civil-unrest and coordination signals. The principal workflow is to submit or collect content, analyze it with classification and enrichment, then explore results in the dashboard. The README also documents scraping, multimodal OCR, explainability, and counter-narrative capabilities. Evidence is partial: unsampled APIs and services are represented where the README establishes a capability, but uncertain implementation links are omitted.
Main entry points: main.py API Gateway · database.py Relational Database · ingestion.py Ingestion API · enrichment_pipeline.py Enrichment Orchestrator
Components 26
Moderator Workbench
- React Dashboard
frontend/src/App.tsx - Analysis Views
frontend/src/pages - Investigation Views
frontend/src/pages
Content Collection
- Ingestion API
backend/app/api/ingestion.py - Narrative Scraper
backend/app/services/narrative_scraper_service.py - Platform Scraper Router
backend/app/services/scrapers/router.py - Scraped Content Model
backend/app/services/scrapers/base.py - Meme OCR
backend/app/services/ocr_service.py
Content Analysis
- Analysis API
backend/app/api/analysis.py - Hate Detection
backend/app/services/comment_hate_detector_service.py - Classifier Models
backend/app/ml/model_manager.py - Enrichment Orchestrator
backend/app/ml/enrichment/enrichment_pipeline.py - Target Detection
backend/app/ml/enrichment/target_detector.py - Harm Classification
backend/app/ml/enrichment/harm_classifier.py - Severity Scoring
backend/app/ml/enrichment/severity_engine.py
Investigation Intelligence
- Investigation API
backend/app/api/investigations.py - Narrative API
backend/app/api/narratives.py - Civil Unrest API
backend/app/api/civil_unrest.py - Coordination API
backend/app/api/coordination.py - Civil Unrest Analysis
backend/app/services/civil_unrest_service.py - Coordination Detection
backend/app/coordination/detector.py
Application Platform
- API Gateway
backend/app/main.py - Relational Database
backend/app/core/database.py - Domain Records
backend/app/db/models.py - Input Security
backend/app/core/security.py
Other components
- Moderator
Connections 26
- Moderator → React Dashboard: uses
README.md - React Dashboard → Analysis Views: routes to
frontend/src/App.tsx - React Dashboard → Investigation Views: routes to
frontend/src/App.tsx - Analysis Views → API Gateway: requests analysis
- Investigation Views → API Gateway: requests investigation
- API Gateway → Relational Database: initializes
backend/app/main.py - API Gateway → Analysis API: mounts routes
backend/app/main.py - API Gateway → Ingestion API: mounts routes
- Ingestion API → Input Security: sanitizes input
backend/app/api/ingestion.py - Ingestion API → Domain Records: persists documents
backend/app/api/ingestion.py - Ingestion API → Narrative Scraper: uses scraping
backend/app/api/ingestion.py - Platform Scraper Router → Scraped Content Model: returns content
backend/app/services/scrapers/router.py - Analysis API → Hate Detection: runs detection
- Hate Detection → Classifier Models: predicts content
backend/app/services/comment_hate_detector_service.py - Classifier Models → Enrichment Orchestrator: enriches predictions
backend/app/ml/model_manager.py - Enrichment Orchestrator → Target Detection: detects targets
backend/app/ml/enrichment/enrichment_pipeline.py - Enrichment Orchestrator → Harm Classification: classifies harm
backend/app/ml/enrichment/enrichment_pipeline.py - Enrichment Orchestrator → Severity Scoring: scores severity
backend/app/ml/enrichment/enrichment_pipeline.py - Investigation API → Relational Database: uses sessions
- Narrative API → Relational Database: uses sessions
- Civil Unrest API → Civil Unrest Analysis: analyzes events
- Coordination API → Coordination Detection: detects coordination
- Civil Unrest Analysis → Relational Database: stores analysis
- Meme OCR → Classifier Models: supplies extracted text
- Narrative Scraper → Classifier Models: classifies results
backend/app/services/narrative_scraper_service.py - Relational Database → Domain Records: maps records
backend/app/db/models.py