Leyton — consulting engagement
Real-time personalisation with a RAG persona pipeline
A cosmetics platform was recommending from frozen segments while ignoring all the text it already owned. Moved to per-person, real-time recommendation built on retrieval — and explainable by the business team.
- Role
- Data science consultant
- Period
- September 2023 — February 2024
Stack
The problem
A segment is not a person. “Woman, 25-34, combination skin” groups people whose needs have nothing in common: the average recommendation suits precisely nobody.
And the richest signal was dormant. Product descriptions, compositions, customer reviews, editorial content: a great deal of unstructured text, full of information, completely invisible to a rules-based engine.
Constraints
Real time: the recommendation lands during the session, inside a web-page latency budget. A nightly batch was off the table.
Cold start: a new visitor has no history, and the system had to be useful from the first interaction.
Explainability: the business team had to be able to answer “why this product?”. Nobody hands their merchandising to a black box.
Consulting engagement: anything the internal team could not take over after I left had no value.
What I built
A RAG-driven persona layer. Rather than raw product embeddings, an interpretable intermediate space between user and catalogue, built by retrieval over the text corpus. That is what solves explainability: the recommendation is not “the model said so”, it is “this profile matches this persona, which matches these products, for these textual reasons”. The business team reads the reasoning and can argue with it.
Two speeds, not one. Offline: embeddings, personas, product associations — expensive, precomputed. Online: session signal, persona matching, final ranking — light, per request. Real time is not “compute everything fast”, it is precompute everything that can be precomputed.
A deliberately plain service. Flask, MongoDB, Docker, AWS. The internal team had to take over maintenance, so nothing clever for its own sake.
Results
- +15 % conversion rate, reported by the client
- −20 % analysis cycle time for the business team
- Explainable recommendations, taken over and maintained in-house after the engagement ended
What I’d do differently
Set the measurement before the build. The +15 % was reported; an A/B protocol defined on day one would have produced a defensible number rather than a credible one. It is now the first thing I scope: how will we know it worked, and who accepts that number?
Treat cold start as a strategy, not a degraded path. On a consumer site, new visitors are a huge share of traffic. Making them a fallback from the happy path means serving most people badly.