All projects

Case study · Cabify Spain · Sep 2026 to now · flagship project, in delivery

DQM · Driver Quality Management

Driver quality lived in eight different tools, reset every week and mostly only punished. DQM is the missing layer on top: one score per driver that combines productivity, rider experience, conduct, fraud and documentation, compares each driver only with comparable drivers, and triggers a graded response. I am the delivery lead: data architecture, score design, business rules, the simulator and the pipeline.

Presented at All HandsPython + PostgreSQL
Amazon RedshiftAmazon RedshiftPostgreSQLPostgreSQLPythonPythonClaudeClauden8nn8nMac mini (macOS)Mac mini (macOS)SlackSlack
My roleDelivery lead: data architecture, score formula, rules, simulator and pipeline. A sponsor group and fleet owners decide scope and sanctions.
WhenKickoff 21 Sep 2026 · phase 0 until week 47
Built withPython, PostgreSQL, Redshift, Claude for analysis, n8n and Braze for messaging, the Mac mini as a 24/7 bridge
StatusPhase 0: designing and validating the model on real data. The simulator already runs on synthetic data.
0–100
Driver Quality Score, recomputed every cycle
28 days
rolling memory with decay, instead of a weekly reset
5
zoom levels, from the whole country down to one driver
16
simulator screens in 7 categories, all on synthetic data
The local AI agent mascotThe score engine runs 24/7 on the team's Mac mini, next to my local AI agent, until the final infrastructure is in place.
DQM simulator · fleet statesynthetic data
DQM simulator fleet state screen
Fleet state: the offer at a glance, where to act today ordered by urgency, and the driver distribution by band. Every number is simulated.
DQM · mobilesynthetic data
DQM fleet state on a phone
The same screen at phone width.

The simulator is a single HTML file with a synthetic population built in, so it opens anywhere, phone included, with no server and no real data.

The idea in one paragraph

Detecting bad practices is already mature and spread across several tools. Acting on them is fragmented, and nobody aggregates them. That empty aggregation layer is DQM, which is why the project did not start by building new detectors but by consuming the ones that already exist. The risk is not technical; it is scope.

The model

A number from 0 to 100 over a rolling 28-day window, expressed as a percentile inside the driver's cohort: city × fleet type × tenure. A driver in their first month and one in their third year are not scored the same way. Scoring by percentile inside the cohort is also the only version you can defend in front of a fleet manager.

Five blocks

Productivity and reliability, rider experience, conduct, fraud and documentation. Each block has an explicit weight and the breakdown is always visible behind the number.

Two gates outside the sum

A confirmed harassment or safety case sends the driver straight to the critical band. Fraud does not average in: it triggers. The car's condition is shown for context but never moves the band, because the driver does not choose the car.

Three clocks that never mix

Data flows continuously, the score looks at 28 days, and the decision is frozen once a week on Monday. Intraday signals alert; they do not score.

Bands by percentile, not by fixed cut-offs

When I simulated fixed cut-offs on a synthetic population, more than half of the drivers fell into watch or critical. That would not describe the fleet; it would describe a badly calibrated threshold.

Why a memory and not a weekly reset

With a weekly reset, a driver who alternates a good week and a bad one never builds up enough to be sanctioned. The pattern is invisible today, and it is exactly what DQM has to see. The chart below is an illustrative simulation of that same behaviour under both models.

Weekly reset: the counter restarts every Mondaysanction thresholdweek 1: 1week 2: 9week 3: 1week 4: 9week 5: 1week 6: 9week 7: 1week 8: 9week 9: 1week 10: 9week 11: 1week 12: 9week 13: 1week 14: 9week 15: 1week 16: 9week 1week 1628-day memory with decaysanction thresholdweek 1: 1.0week 2: 9.6week 3: 7.0week 4: 13.3week 5: 9.3week 6: 14.7week 7: 10.1week 8: 15.3week 9: 10.5week 10: 15.5week 11: 10.6week 12: 15.6week 13: 10.7week 14: 15.6week 15: 10.7week 16: 15.6week 1week 16
Illustrative simulation, not real data. Shaded weeks are the bad ones. Under a weekly reset the counter never reaches the threshold; with a 28-day memory and decay the same driver crosses it in week 4.

Eight principles the rules follow

  1. The three clocks do not mix. Continuous data, a 28-day score, a weekly frozen decision.
  2. One source of truth per metric. The same working-time measure can come out quite differently in two tools, so before accusing anyone we have to know which number rules.
  3. No rule reaches production without a manual audit of a sample. Accusing wrongly burns the credibility of the whole system.
  4. Thresholds are editable, versioned and dated. "No sanctions this month because there is no supply" is a one-minute decision that stays recorded.
  5. Cohort percentile, not absolute thresholds. Madrid is not Santander, and a three-month driver is not a veteran.
  6. Concentrated or spread before choosing the intervention. If a few drivers explain most of the events, it is individual follow-up; if it is everyone, it is communication.
  7. If an incentive is paying for the bad practice, removing the payment beats any warning.
  8. No rule goes live without its impact in euros. Each rule carries what it protects and what it puts at risk: lost supply, agent hours, the cost of blocking a profitable driver.
Informfirst time in the watchband: in-app nudge andpushAccompanysecond week or a fallingtrend: personal message,training, a callLimitsustained or repeated:fewer premium productsand priority, withnotice to the fleetExcludeconfirmed harassment orfraud: the fleet acts asemployer first
The score can be automatic; the sanction cannot be silent or one-sided. Limiting products is not a labour sanction, which is why that lever goes first.

Architecture

SOURCESNOWHISTORYMODELOUTPUTSWarehousetrips, offers,connection, ratings,conduct eventsPartner APIlive events over awebsocket (phase 2)driver_eventsappend-only, the truthof the daydriver_stateone row per driver, the"now"driver_dailyaggregated every cycledriver_score_historyweekly snapshot, nevereditedScore enginefull recompute every 5min, cohort percentileDQM panel5 zoom levels, driver360Alertsrule catalogue,false-positive buttonFleet reportweekly, scoped per fleet
History already exists and is free: it lives in the warehouse. What does not exist is the present. DQM builds the "now" layer and the bridge to what is already there, on its own PostgreSQL and a 24/7 service on the Mac mini until the final infrastructure arrives.
  • Now, today, history. Under 5 seconds for "what is this driver doing", under 5 minutes for "what happened today", and the warehouse for "is this normal for the cohort".
  • An immutable snapshot for every action. Every warning or limit points to the exact score that justified it. That is the legal evidence, and it is what makes an appeal answerable.
  • Reconciliation every night against the warehouse. If our own aggregate drifts by more than 2%, it is a pipeline alert, not a driver problem.
  • Spreadsheets were ruled out as storage on day one: the event volume would break them in a day.

The simulator

The feedback after the first review was to go straight to design, and there was a good reason: navigating a working prototype produces more decisions in an hour than three weeks of documents. The simulator is the design deliverable, calibrated by percentiles on synthetic data.

DQM · evolutionsynthetic data
DQM evolution and forecast screen
Evolution and forecast: the fleet score with an 8-week projection and its confidence band, and who is about to drop a band.
DQM · predictionssynthetic data
DQM band migration chart
Predictions: how the fleet moves between bands in four weeks if nobody acts.
DQM · control towersynthetic data
DQM control tower with a live map
Control tower (phase 2): what every connected driver is doing right now, coloured by the chance of a bad practice at that moment. The map is drawn from shapes inside the file; positions are simulated.
DQM · driver 360synthetic data
Driver 360 screen with the score gauge
Driver 360: the score and its four blocks, the trend against the region and what the driver could do today.
DQM · shiftsynthetic data
Driver shift timeline
Last shift against the committed schedule, trip by trip, each state explained.
DQM · deviationssynthetic data
Deviations screen
Deviations: where a driver departs from their own group, in standard deviations.
DQM · patternssynthetic data
Behaviour clusters scatter
Patterns: behaviour clusters the model finds on its own, and what each group does differently.

Phases

PhaseWhatDone when
0 · Design
Q4 2026
Corrective model on the warehouse with a 5-minute refresh, full recompute each cycle, own PostgreSQL, rule catalogue editable by the teamA model validated against the score definition: cohorts distinguished with significance and false positives down in a sample audit
1 · Corrective
Q1 2027
Deploy the score, set baseline and target by cohort, weekly snapshot, weekly report to fleets, gamified product accessMeasured impact on driver quality
2 · Preventive
2027
Live events from the partner API, control tower, alerts while the bad practice is happeningIncremental impact over phase 1
3 · Scale
2027+
The score inside the fleet managers' own app, scoped per fleetFleets use it without us

Enrichment is not a phase: telemetry, contractual schedules, documentation and chats are evaluated at the end of each phase depending on the impact reached so far.

Where it stands

Phase 0 runs from week 39 to week 47 of 2026. The access requests are out, the legal review of data use runs in parallel and blocks switching the pipeline on, not the design. Fourteen decisions are open and ordered by what they block; the first one is what exactly counts as "validated".

Every screenshot comes from the simulator running on synthetic data, with fleet and people names replaced. Weights, cut-offs, rule thresholds and all company figures from the project charter are left out on purpose.