Data flows through an AI system in a continuous loop: ingestion → preprocessing → training → evaluation → deployment → inference → monitoring → feedback.
Raw data arrives from multiple sources:
Raw data is cleaned and transformed into features:
# Preprocessing pipeline (batch)
Raw data → Validate schema → Handle missing values
→ Normalize/scale → Feature engineering → Feature validation
→ Write to Feature Store (online + offline copies)
Key decisions: Do you preprocess in the pipeline (painless) or at serving time (flexible)? The answer depends on latency requirements and feature complexity.
Preprocessed features are fed into training jobs. This can happen on a schedule (nightly), on demand (triggered by drift), or continuously (online learning).
The trained model is packaged and deployed to the serving infrastructure. Common formats: ONNX, TorchScript, TensorRT, or raw Hugging Face checkpoints.
Live requests flow through the inference pipeline:
# Online inference flow
Request → Fetch features (from online feature store + cache)
→ Feature transformation (consistent with training)
→ Model prediction → Post-processing → Return result
→ Log prediction + features to audit store
The most critical and often overlooked step. Model predictions are compared against actual outcomes (once known) and fed back into the system:
# Feedback loop data flow
Inference → Store prediction + features → Wait for ground truth
→ Compute model quality metric (e.g., accuracy, precision)
→ Compare to threshold → If degraded: trigger retraining alert