How sabtain-dev/multimodal-ai-content-detection-agent works
This repository implements a file-based agent for AI-content detection in text, images, and audio; video detection is planned. The user workflow starts with a file, routes by extension, then returns a unified modality-specific result. Text uses preprocessing, three sequential model runs, and majority voting; audio combines two model predictions with a threshold-based primary decision; image decisions use supplied scores rather than agent-run image inference. Edges reflect shown calls or documented routing; unsampled video behavior is not inferred.
Main entry points: multimodal_agent.py Multimodal agent · text/ensemble.py Text ensemble · detector.py Text model detector · audio/ensemble.py Audio ensemble
Components 15
Agent routing
- Multimodal agent
src/agent/multimodal_agent.py - Extension router
src/agent/modality_router.py
Text detection
- Text ensemble
src/detectors/text/ensemble.py - Text model detector
src/detectors/text/detector.py - Text preprocessing
src/detectors/text/preprocessing.py - Text result schemas
src/detectors/text/schemas.py
Image detection
- Image detector adapter
src/detectors/image/image_detectors.py - Image decision ensemble
src/detectors/image/ensemble.py - Image label normalization
src/detectors/image/label_normalization.py
Audio detection
- Audio ensemble
src/detectors/audio/ensemble.py - Audio model inference
src/detectors/audio/audio_detectors.py - Audio label normalization
src/detectors/audio/label_normalization.py
Video planned
- Video detector
src/detectors/video/video_detectors.py - Video processor
src/detectors/video/video_processor.py
Other components
- File submitter
Connections 11
- File submitter → Multimodal agent: submits file
README.md - Multimodal agent → Extension router: detects modality
src/agent/multimodal_agent.py - Multimodal agent → Text ensemble: runs text detection
src/agent/multimodal_agent.py - Multimodal agent → Image detector adapter: requests score decision
src/agent/multimodal_agent.py - Multimodal agent → Audio ensemble: runs audio detection
src/agent/multimodal_agent.py - Text ensemble → Text model detector: runs sequentially
src/detectors/text/ensemble.py - Text model detector → Text preprocessing: cleans and chunks
src/detectors/text/detector.py - Text model detector → Text result schemas: builds results
src/detectors/text/detector.py - Text ensemble → Text result schemas: builds ensemble result
src/detectors/text/ensemble.py - Audio ensemble → Audio model inference: runs both models
src/detectors/audio/ensemble.py - Audio model inference → Audio label normalization: normalizes prediction
src/detectors/audio/audio_detectors.py