System Architecture
AuditorIA follows a microservices architecture designed for scalability and modularity.
Components
1. Frontend (Next.js)
The user interface, built with Next.js 14 and Tailwind CSS. It communicates with the Backend via REST API and Server-Sent Events (SSE) for real-time updates.
2. Backend (FastAPI)
The core logic layer. It manages:
- Task Management: CRUD operations for transcription tasks.
- Notifications: Real-time alerts via SSE.
- Authorization: Validates tokens against Keycloak.
3. AI Worker
A dedicated service for heavy processing:
- Transcription: Uses WhisperX (running on GPU).
- Diarization: Pyannote.audio.
- Auditing: Send transcripts to LLMs (GPT-4o) for analysis against custom criteria.
4. Storage (MinIO)
S3-compatible object storage. Used for:
- Raw audio files.
- Processed transcripts (JSON).
5. Database (PostgreSQL)
Relational database storing:
users: User profiles.tasks: Task metadata, status, and results.notifications: User alerts.
Service Layer Breakdown
The backend logic is distributed across specialized services in app/services:
Core services
auth_service: Handles JWT verification and Keycloak integration.task_management_service: Orchestrates the lifecycle of an audit task.postgres_service: Abstraction layer for database operations.
AI & Auditing
whisperx_service: Wraps the WhisperX model for transcription.speaker_analysis_service: Handles diarization logic.operator_quality_service: The core business logic that compares transcripts against Quality Sheets.generate_questions_service: Uses LLMs to generate QA pairs for training.
Features
campaigns_service: Manages audit campaigns (grouping tasks).ai_chat_service: Powering the "Chat with Data" feature.