Listen to this story
The Swiggy delivery personnel that arrived at your doorstep was most probably selected by an AI after taking into consideration multiple parameters. “It is almost an existential necessity because there are a lot of hard problems, which actually require the use of AI/ML,” Vijay Anand Seshadri, senior vice president and engineering fellow at Swiggy, said.
With a presence in more than 500 cities in India, Swiggy fulfils millions of orders per month. On December 31, 2022, Swiggy’s ML Platform executed more than a million ML predictions per second. Not only that, Swiggy’s data platform processed more than 10 million events per minute.
In this exclusive interview with Analytics India Magazine, Seshadri discusses how Swiggy harnesses the power of data analytics and AI/ML, potential use cases of ChatGPT, Large Language Models and AR/VR technologies, among other things.
Subscribe to our Newsletter
Join our editors every weekday evening as they steer you through the most significant news of the day, introduce you to fresh perspectives, and provide unexpected moments of joy
Please tell us about the role of data and analytics in the engineering team’s decision-making process?
Vijay: There is a lot of emphasis on the data science modelling and the tooling available for analysts to be able to do their job, which is actually very important. But what I feel is often missed in making that function effective for a business is the preparatory work that goes long before you get to analytics. Do we have standardised methods of collecting data from the marketplace or the right governance practices in terms of ensuring data quality?
A lot of the time is spent in making sure that you understand the data, how it is modelled, and the intricacies of why some columns are null in some cases and populated with certain fields. And this means that you might start having a lot of tribal knowledge in your company. So, what we have been doing is trying to move away from that model, where we have a set of tools and processes that standardise the way we collect data.
For example, we have a mechanism called continuous data capture that allows us to continuously replicate the production state into our data warehousing boundaries. And the advantage of this is that you can apply what we call quality gates. This helps us ensure that by the time it gets to the analyst, there is good confidence that the data is fresh, reliable and in a format that is easily consumable.
Besides, we have also built an online analytics system internally which allows us to monitor key business metrics at a zone level. On a near real time basis, a lot of the ground conditions change. So, we have built a business alerting tool, which is hyperlocal and allows analysts to take action according to the changing ground reality.
How does Swiggy use AI/ML to improve the customer experience and drive business growth?
Vijay: When a customer opens our app, one of the things that we show to the customer for each restaurant is the estimated delivery time. Now, if you look at the process of generating this value, we can neither be conservative, nor aggressive. If we are conservative and the estimated time of delivery is too high, the customer might not place the order. Similarly, if the time is too short, it could lead to a bad customer experience. Hence, it’s critical to strike a balance and that’s a very tough situation.
To derive the time shown, the model takes into consideration the driver fleet capacity near that particular restaurant, the driver’s waiting time at the restaurant, the preparation time by the restaurant (which also varies depending on multiple factors) and also the last mile delivery, which is the distance from the restaurant to the customer’s home. Factoring in all these parameters, the models come up with the most accurate time.
Similarly, we also use AI/ML to understand the customer’s search intent. We need to have a more topical intelligence on our menu and items on our catalogue. For example, we have built a food intelligence platform that is able to associate different types of ingredients with different menu items. A customer might search for home-style food or something bland. For all these things, you actually need to have an extra layer of intelligence that says how we categorise items in the catalogue so that we have these food intelligence attributes. This is another example of how AI and ML are very critical for us to give the right customer experience.
Furthermore, AI/ML is also used when it comes to driver assignment. When an order is placed, we have to assign the order and this turns out to be a multivariable optimisation problem because we have to balance multiple objectives for that. It’s not just the nearest driver to the restaurant. We have to look at the cost, the customer experience, and balance the delivery time. We also have to make sure that we are balancing out the earnings across our driver fleet right, so this is another problem where I think we use a lot of the machine learning and AI models.
How does Swiggy plan to continue to innovate and advance its use of AI/ML?
Vijay: There are innumerable applications where we can actually improve the experience for all the partners in the ecosystem. For example, one of the other areas that we have been exploring is on image processing and face-detection sort of capabilities.
Another area that I think is not explored that well is quality controls. It’s very important for us because the food actually is delivered as promised, which means there is no foreign object detection or any kind of tampering. Hence, I believe there’s a lot of areas where I feel that there is a lot of scope for us to improve, especially around image processing, voice recognition.
Further, we would also like to bring a more hyper-personalised experience to our customers. AR/VR could have potential use cases for our DineOut. It’s important for customers to understand the ambience that a restaurant offers. If a customer is able to experience and visualise this, it would be really interesting, but these are very early stages.
Does Swiggy plan to use ChatGPT-like chatbots?
Vijay: Conversational intelligence is a key aspect when it comes to customer support. It is important to note that customer support is not necessarily restricted to consumers. There’s a huge potential when it comes to things like driver support. We also have restaurant partners who might interface with us, so overall, given that there are so many parties in our marketplace, I think a ChatGPT-like solution could be quite effective. Besides, if you look at the language models, they are oriented towards English but I think there is also scope for building language models that are for the regional languages used in India.
What are the challenges faced by the engineering team while implementing AI/ML at Swiggy?
Vijay: One of the first challenges we encountered was the diversity in data sources. This might look like a very mundane problem, but we operate hundreds of micro services in production and a lot of them have their own data stores, stored in different formats etc. To overcome this, we developed the Continuous Data Capture tool that allowed us to capture the data.
The second stage was really trying to build a data lake that allowed us to have different views of the data being collected, because there is an analytical view and then there are also data science use cases. So the data processing pipeline had to handle all of these use cases supporting both ad hoc analysis as well as machine learning analysis and this was a challenge.
The third challenge was to have a common model that we can uniformly use across multiple domains. We have multiple domains and to produce the data in such a way that we have a very consistent model that we can expose is a challenge, and there is still work going on in that area. It is not a solved problem yet. How do we ensure that we can semantically understand the data easier is an area where we are exploring some solutions.