How sentineml/sentinelml works
This repository implements a Kafka-based transaction anomaly-detection pipeline. Events are generated, consumed and transformed into feature events, then an inference service validates them, scores them with an Isolation Forest loaded from MLflow, publishes predictions, and persists scores through a shared ORM. The README is empty, and the generator and processing internals were not excerpted, so their documented or detailed behavior and some event wiring cannot be verified; dashed edges mark those pipeline links.
Main entry points: inference_service/main.py Inference loop · data_process_service/main.py Processing loop · model.py Isolation Forest · producer.py Prediction producer
Components 20
Event generation
- Event generator
services/event_generator_service/generator.py - Raw events
Feature processing
- Processing loop
services/data_process_service/main.py - Feature extraction
services/data_process_service/data_processing.py - Feature events
Anomaly inference
- Inference loop
services/inference_service/main.py - Feature consumer
services/inference_service/consumer.py - Feature schema
services/inference_service/schema.py - Isolation Forest
services/inference_service/model.py - Service settings
services/inference_service/config.py - MLflow registry
- Prediction producer
services/inference_service/producer.py - Prediction schema
services/inference_service/schema.py - Predictions
Persistence
- ORM API
services/orm/__init__.py - Persistence repository
services/orm/repository.py - Database setup
services/orm/database.py - Data entities
services/orm/models.py - PostgreSQL
Other components
- Event source
Connections 21
- Event source → Event generator: initiates
- Event generator → Raw events: publishes events
- Raw events → Processing loop: delivers events
- Processing loop → Feature extraction: processes event
services/data_process_service/main.py - Processing loop → Feature events: publishes features
services/data_process_service/main.py - Feature events → Feature consumer: delivers features
- Inference loop → Feature consumer: consumes events
services/inference_service/main.py - Feature consumer → Feature schema: validates events
services/inference_service/consumer.py - Inference loop → Isolation Forest: scores features
services/inference_service/main.py - Isolation Forest → Service settings: reads settings
services/inference_service/model.py - Isolation Forest → MLflow registry: loads model
services/inference_service/model.py - Inference loop → Prediction producer: publishes prediction
services/inference_service/main.py - Prediction producer → Prediction schema: serializes prediction
services/inference_service/producer.py - Prediction producer → Predictions: sends predictions
services/inference_service/producer.py - Inference loop → ORM API: initializes and saves
services/inference_service/main.py - ORM API → Persistence repository: exports save operation
services/orm/__init__.py - ORM API → Database setup: exports setup
services/orm/__init__.py - Persistence repository → Data entities: queries and creates
services/orm/repository.py - Database setup → Data entities: creates schema
services/orm/database.py - Persistence repository → PostgreSQL: reads and writes
- Database setup → PostgreSQL: connects