Skip to main content

GenAI Observability in Customer Care

Summary

  • GenAI observability platform: This video shows how EarnIn built a GenAI observability platform on Databricks that monitors customer care chatbots in near real-time, enabling detection of hallucinations and low-value conversations.
  • Real-time monitoring with DLT: Learn how Delta Live Tables (DLT) and Kafka enable real-time monitoring of chatbot interactions, providing visibility into conversation quality and automated alerts for issues.
  • Customer empathy through AI: Discover how Databricks and AI/BI enable EarnIn to better anticipate customer needs and deliver value at scale while maintaining compliance with CFPB regulations in the fintech lending space.

GenAI Observability in Customer Care

Watch: GenAI Observability in Customer Care
Talk by Matteo Ciccozzi, Senior Machine Learning Engineer, EarnIn ; Willem Dhaeseleer, Senior Staff Software Engineer, EarnIn
Customer support is going through the GenAI revolution, but how can we use AI to foster deeper empathy with our end users? To enable this, Earnin has built its GenAI observability platform on Databricks, leveraging DLTs, Kafka and Databricks AI/BI. this video covers how we use DLT to monitor our customer care chatbot in near real-time and how we leverage Databricks to better anticipate our customers' needs.
Here’s more to explore:
Production ready data pipelines for analytics and AI: https://www.databricks.com/solutions/data-engineering
The Big Book of Data Engineering: https://www.databricks.com/resources/ebook/big-book-data-engineering-2nd-edition
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements

FAQs

Why is observability critical for AI customer support applications?

This video emphasizes that when automating customer support with AI, it's essential to detect hallucinations and low-value conversations in real-time, ensuring compliance and maintaining customer trust.

How does EarnIn use Delta Live Tables for monitoring?

According to this video, EarnIn uses Delta Live Tables (DLT) with Kafka to monitor customer care chatbot interactions in near real-time, enabling rapid detection of issues and automated quality assessment.

What regulatory constraints does EarnIn face?

This video notes that EarnIn operates as an early wage access company and is highly regulated by the CFPB, requiring not only timely customer care but also correctness and compliance in all automated interactions.

What scale does EarnIn's customer support operate at?

This video indicates that EarnIn has over 19 million downloads, provides 24/7 real-time support in-app, and has over 100 different reasons why customers might contact support, making observability and automation critical.

Full transcript

Welcome everyone. At Ernon, we have an ambitious goal of automating 80% of all our customer support traffic by the end of the year. And we've made great progress getting there in the last year, but we're not there yet. But before we get to 80%, what would it mean if we automated 100% of all our customer support traffic? How would we know such a system is operating in a compliant way? And how would we make sure that every interaction is creating value for our customers?
And how can we surface low value conversations and hallucinations quickly? We might not have the answer to all these questions, but we want to share with you our journey in building a chatbot and the tools we've used to monitor it and the tools we've had to build to monitor it. I'm here with my colleague and we're talking about Gen AI observability in customer care. Let's take a quick look at our agenda. We're going to talk a little bit about the complexity of customer support at Earn.
We'll look back at our journey and our timeline. Talk a little bit about the metrics we care about when we measure a chatbot. We'll dive a little deeper in the platform we use to emit data to our lake. and we'll uh do um a quick workshop looking into how to query um uh hallucinations on our conversation data by writing a SQL query and then we'll spend a few minutes looking forward. Let's get started. At Ern, uh we believe that we can make any day payday.
We're an early wage access company and we do not require a credit check or we do not have any interest. Um anyone can use our product. We have over 19 million downloads and counting. And with so many users, you can imagine our customer operation is quite substantial as well. In fact, we have over a 100 different reasons why a customer might reach out to us uh for a customer support issue. And we provide 247 real-time support directly in our app.
And all our traffic, all our support chats go to our bot. Here he is. Um and we're also highly regulated by the CFBB. While we're not a bank, there is a bunch of regulations we have to adhere to. Um, so what that means is not only do we have to provide timely customer care, we have to get it right as well. So this is why last year we started investing in making our customer support even better through Geni innovation.
Let's take a look at our journey. So last year we released our first version of our bot in March. We released an FAQ rack style bot. This allowed uh this was able to answer a single question of a user. We would the user can initiate a conversation with the bot. We'll try to match their question to an existing knowledgebased article from our website and then we'll use that context to generate their reply. We actually saw relatively low coverage for this initial use case.
So we identified a key use case where the bot could help the user update their account. So in June we released our first tool calling capability allowing the bot to update user's account after confirming with the user into a multi-step conversation multi-turn conversation. Uh and we saw a massive increase in usage 500%. So it's really here where we started to realize that our observability tooling wasn't really scaling the way we wanted it and so we made a decision to emit all metrics directly to the data lake.
Before that we were using um data dog mostly and custom metrics from source code to uh measure our bot. But what we found really is that even with metrics, logs and traces, it's not enough to create a comprehensive or a holistic view of how your bot is behaving in production. So in August we migrated our metric system from data do to data bricks. And as we kept adding use cases to our bot, we realized we needed a central place to advertise these metrics, publish these metrics, visualize these metrics.
So we released our first AI BI dashboard in October. This really was a gamecher, not just because it created a central place for everyone to be aligned on our metrics, but also because it became the operational tool for our bot. So when we push code to production, we're looking at this dashboard to monitor the bot. Um, keep in mind that this dashboard is backed by delta life tables. So the latency or the freshness of the data can be as slow as 10 seconds.
So that rivals data do log ingestion in some cases even. So we're using this dashboard to monitor deployments, do experiments, AB tests. We've even used it during incidents to quickly scope how many users might be impacted during an outage. In February, we released our first agentic refactor, giving the bot more conversational control over the conversation. And we could not have done this without with having all the events stored in the lake because in an agentic system, your conversational permutations explode and it becomes much more harder to isolate the pieces of the conversation you care about from a metric perspective.
Then in April, we released our first multimodel capability where we could take in a screenshot, extract the entities through an LM and match it to the correct tool call. And now recently, we're exploring reasoning to use using reasoning models to really diagnose issues across all the data we have in the lake. So to recap here, we migrated our metric system from data do to data bricks. So what do we really need from a metric system?
Let's talk a bit about that. So we need immediate feedback during experimentation. When we're pushing code to production, we're looking at metrics and we need to immediately review these uh conversations as well. These go hand in hand. We also deal with an evolving definition of metrics. Let me give an example of what that means. An easy way to measure a chatbot is in a binary fashion. The bot helped the user or the bot did not help the user and had to hand it off to a human agent for further help. um when when you only have the what we learned during uh monitoring and production however is that the bot can do useful work before it hands it over to the human agent.
So um if you learn a new fact like this and you want to incorporate it into your data set after the fact, it can be challenging to do if you only have the time series data. But if you recorded all the events and calculated your metrics on top of the events, you have a little bit more freedom to redefine the metrics as you're measuring them and you can recalculate them historically or start calculating them without having to push new code.
We also deal with high cardality metrics. So like I mentioned uh it's really important for us to be able to break down metrics and so in data do we can do that by adding a tag to a metric but this doesn't really scale well with data do pricing model because data do will charge you for each metric as a for each tag as a separate metric. So it is and you're not you do not have the same limitation when you are just emitting events to data bricks.
Let's talk about the metrics we care about when we measure a bot. Um so we have two metrics that we really care about containment and um coverage. Why do we have two metrics? Because our bot is able to do multiple things. Our bot has multiple capabilities. So we do want to measure each capability individually. So containment is our single use case evaluation. So here we really want to answer questions like was the body able to help the customer?
Did we contain the conversation or did we have had to hand it over to a human customer agent? And we're also measuring the intent precision here like did we match the question from the user to the correct capability that the bot is able to perform. Coverage is measured over all our customer support traffic. So that means all the capabilities of the bot and all the work that is being done by human agent. This is really our northstar.
Like I said in the beginning of the talk, we're looking for we're aiming for 80% coverage by the end of the uh year. This is also a measurement of our intent recall because if we weren't able to measure the intent of the user to the correct capability, we'll lose some coverage. Although that is somewhat more nuanced. Sometimes the intent of the user is to talk to a human. So if you have any solutions for that, please I would love to talk to you after the talk.
So containment is really the unit of our measurement. So let's take a closer look at how containment flows through a conversation. The green path here is our happy path. We'll focus on that going from left to right here. So a user can initiate a conversation. We'll try to match them to the correct workflow. And workflow here is really just a prompt plus tools. If we fail to match them to the correct workflow, then uh we lose out on coverage.
If we are able to match them to the correct workflow, we'll execute the workflow. We'll confirm with the user, did we really resolve your issue? And if they confirm, we'll actually measure count it as contained. But at any step in this process, the user, the customer or the agent might decide that they want to escalate it to a human agent and then we would go through the wreck path or what also happens is users often go away like they might go away even right after we help them.
So they might not confirm whether we've resolved their issue with them. In this case, we wait 72 hours to see if they return again before we mark it as contained. This is also a variable number. It's a it's actually a parameter in our AIBI dashboard. Sometimes we look at 12 hours, 24 hours, 72 hours. So how do we get these metrics in the lake? I'll hand it over now to talk a little bit more about the platform we've built.
Thank you. So this is a very high level overview of the customer care architecture at Ern. So we have Zenesk which is a third party uh service that we basically use as a back-end ticketing system. So when we do have a customer care interaction, we want to keep track of that interaction in tickets and Zenesk provides that for us. Zenesk's data enters our system via web hook events. So we have web hook events for ticket life cycle updates.
We have ticket events for conversation updates. So imagine messages that a customer either sends or receives. Um all of these are processed by uh services running on Kubernetes. uh they maybe update uh process out some kind of internal domain logic and then publish application events to Kafka. These application events produced to Kafka are consumed by downstream uh consumers who are interested in these application events.
One such consumer is a DT pipeline which uh is part of our material materializer capability. Uh it basically consumes these Kafka events and persists them to Delta Lake tables uh which are then available to be queried in the lake. Of course with Unity catalog managing access control. Um in the case of the chat service obviously we also have you know services that are consuming these events and one such service I guess is kind of the star of the show our chatbot uh which is a langraph application consumes the event and tries to assist the customer.
So maybe focusing first on kind of this red path highlighted here. So ticket events are stateful events. they carry state when a customer reaches out maybe for the first time um you know we want to create a ticket to track this interaction once they've been helped you know this obviously the life cycle of the ticket might change to solved um so the ticket service really is responsible for carrying out some domain logic updated its own updating its own domain tables and publishing to Kafka the way it does this is by leveraging what the platform offers as a outbox capability which we'll cover in the following slide once these messages are processed process by the materializer which like I said is a DT pipeline.
We create an event log table. So the event log table as the name suggests is just a simple log of events that are produced to Kafka. Um since these are stateful events which carry events that carry state effectively uh we might be also interested in the latest states for a given ticket instance. So effectively we also have the snapshot table. So the snapshot table is the result of basically applying the events in the event log table uh in order and you would end up with the state in the snapshot table.
The next flow here in red is like I mentioned the chat service. So these are messages that customer sends or receives. These are processed again by a Kubernetes service published to Kafka and like in the previous case we also do have the DT materializer enabled. These are stateless events. So it's just kind of messages. Imagine we only keep an event lock table for this. And then like I mentioned the star of the show processes these messages um tries to resolve the issue for the customer and surfaces the response back to so that the customer can actually uh see the response.
In the case of there's a lot of things that we actually want to persist to the lake. Uh we might care about the trajectory the agent or the chatbot took to assist the customer. What tools did it call? What order did it call them? So there's a lot of things that we actually want to have in the lake to use for observability. In fact, that's the next step. We have all this data in the lake which basically creates like an integrated data ecosystem that we can use for various use cases.
One such use cases is kind of our observability AI BI dashboard. So the cool thing about this is that we can actually query and support I guess different personas here. You might have engineers who are running like an AB test or an experiment. Um, and they might be more interested in near realtime uh metrics and in some cases also they might want to spot check some of the tickets, right? So we have ticket links embedded in the dashboard so that engineers can maybe see oh why did this conversation uh report this kind of behavior and just look at a conversation as a whole.
You might have product personas who maybe are more interested in querying it on like a weekly basis just to see general trends. Finally, you might also have obviously leadership who might be more interested in looking at containment by use case over a larger time frame. So let's dive a bit deeper into the outpox capability like I mentioned. So the problem is that with the tickets service, right, we process ticket events and then we effectively need to carry out some sort of domain logic which mutates the services domain and at the same time we want to notify downstream consumers which are in turn other services, the materializer and so on of this state change.
So it turns out that to do this reliably is actually not that straightforward because you might update your database tables and that you you have the transactionality guarantee there the asset guarantee but then what happens if you have a partial failure you don't produce the message now you updated your own state but the other consumers that were interested in these state updates actually don't see that update so this is where the outbox capability comes in so the first step is to basically leverage the database's kind of transactional boundary and asset guarantees to make sure that we produce these messages.
So when you uh have a insert, update or delete to your internal domain tables, you also append an application event to the outbox table. The outbox table is basically like a outgoing mail uh of sorts where you publish the events there and once you commit a transaction, you have a guarantee that your domain tables are updated and also your outbox table application application event has been appended to the outbox table.
Then there is the kind of outbox capability. This is a Kafka connect application which basically listens to the transaction log of the database and specifically picks out a outbox event outbox table events, formats them and does some other kind of magic there and then routes to the correct Kafka topic that is configured. So this was publishing. What about materialization? How do we ensure that you can publish in different ways from different sources in different um domains and it just flows through the system and everything gets materialized properly.
So this is where having a common message standard uh which is basically earning an extension of the cloud events specification comes into play. So this is the anatomy of a message uh a simplified version of the anatomy of a message. We have some headers and some of the most important ones are mainly the entity ID which is basically the primary identifier of the instance that you're producing almost like a primary key.
Then you have the entity version which helps us resolve ordering in this distributed setup. So in the case in which you do process events out of order uh on the consumer side you can still resolve the true order that the source intended based on this entity version. Finally we have the change type. change type is simply telling downstream consumers is this like a create event are you updating state is this a delete event and such forth and then the body that's just the body of the payload the raw payload this is where the materializer comes in so the materializer like I said we can imagine a DT pipeline which is reading from this Kafka topic uh which is the source and then it consumes this events from Kafka and produces an event log table or appends to an event log table if one already exists this is pretty straightforward just an append only table the cool thing is Now in use cases in which you are publishing stateful events and you do want that snapshot table uh we can actually create another table that uses the event log as a source and basically applies the changes in order to create the snapshot table.
Obviously in the case in which this has been running these would just be incremental updates. So this is pretty efficient. However, how do you make this self-s serve? uh you know not everybody is experienced or well-versed in data bricks DT Kafka and there's a lot of hidden complexity especially when it comes to Kafka um and learning DT APIs so the idea is like can we make it config driven uh is there anything really that an engineer needs to know aside from what's my topic that I'm producing to what's the schema um is this data stateful and maybe other things around kind of you know do you want this run on a schedule always on and such touch forth.
So we found that GitHub actions was actually a good uh format of automating a lot of this. An engineer uh comes onto the data platform repository trig opens the action fills in the ingestion template provides just the information they care about like I mentioned topic schema and so on uh or schema name so that is then resolved. Um and then that action once it runs creates a PR template that is then reviewed uh by members of the data data team at Ern.
Once that PR is reviewed and everything looks good, uh we can basically provision that infrastructure which is the DT pipeline effectively and then this is the next step. For those of you who are familiar with uh DT, this is essentially the result. So as an engineer, a backend engineer perhaps again who's not familiar from data bricks, you don't need to worry about DT APIs or whatnot. You just end up with the nice user experience and you can do custom things like define data quality rules and so on.
So to recap, what's the developer experience again? So the first step is you define the contract for your events. We support both protobuff and JSON schema. Um and these schemas are managed in a schema registry with proper life cycle management. So schema validation checks when you go to make a change to your schema, making sure we don't introduce any breaking changes. Uh the second step is you publish your events to Kafka.
You don't need to use the outbox capability. Uh you can also publish directly in cases where that is appropriate. uh as long as you adhere to the cloud event specification uh that we set out at turnin uh you're guaranteed that the materializer will work for your events. Uh finally obviously like I just displayed the self-s served materialization. So to recap delta live tables uh we use unity for access control and near realtime option actually enables a lot of use cases.
So that's cool and all but uh what do we do with all this data? Um, so maybe the best part of this is really having this integrated data environment. So what I mean by this is that we have all the data from all our backend systems that's flowing into the lake and as long as we can find a way to correlate that with tickets which is kind of what we operate on in customer care interactions. We can actually add behavior or understand behaviors of the chatbot.
So this has turned out to be a really helpful aspect. Uh needless to say obviously you know notebook exploration also lowers a bit the bar. So you can anybody can write SQL and kind of slice and dice the data any way they want. Engineers use it to track experiments. The near realtime option is a great capability for that. Uh and also an incident response. It's actually surprisingly helpful obviously to be able to kind of dive deep into the data during an incident understand behaviors.
Um needless to say the dashboard does get pretty complicated. there's a lot of SQL queries and so uh we wanted to version control this. So how did we do that? Uh originally we tried version controlling the SQL queries that did not work too well. So then we tried okay uh let's use the datab bricks version control for the dashboard and I don't know if any of you have used it but basically reviewing this lv-json file is not really uh ergonomic developer experience.
So then uh the next step is basically using asset bundles. But really the core idea here is treating these queries as kind of assets um because we are using them for observability and monitoring. So making sure that we uh port over kind of software engineering best practices onto that. I'll pass this now. Okay, great. Thank you. All right, so we have all our data in the lake and we find out our bot is not behaving the way we expected.
Let's walk through a scenario where we can find the instances this happened. We'll walk through a chat scenario on the left here and then we'll put the data structures on the right and we'll try to write this SQL query together here. So let's walk through the expected scenario first. Our users in um is interacting with our customer support. They want to modify a payment. So the first thing our bot is going to do is going to verify that this payment is currently active and that it can actually help the user.
So after it verifies this bot will confirm with the user, yes, I can make that change for you. Would you like to make that change? And this is going to be our first question and answer pair which will represent one row in our table. So this is our table, our chatbot replies table which where we have the user ID, the message of the user, the reply of the chatbot, the tool messages that were called and the received time.
So now we'll generate the second row in our table. The user is going to confirm yes please. Can you make that change? The chatbot will invoke the tool to actually perform the change. We'll call the modify transaction tool and the chatbot will confirm at the user. I've made a change for you and that's the end of our interaction. So this is our second throw in our table. So but what if the bot hallucinated the confirmation and it didn't actually realize it had to call the tool.
This can happen. How can we now find all the instances this happened? When we notice that something like this is happening, your first order of business, of course, is to update your prompt or your workflow to ensure it's not happening again. But you also need to look back and find all the cases it did happen so we can potentially reach out to those users, update their account, make sure that we can meet their expectation.
So let's establish conversation context so we can query over these conversations because we're able to query over the first row here very easily. We can write a select statement over our chatbot replies. But how can we query the second row? We want to be able to uh query this row. So we need to query both rows together. So maybe question for the audience if we have any SQL experts in the room. How can I get the next row in my result set?
Anyone want to try? We don't have a prize but you'll get the credit. Union maybe. Okay. Something else. What's that? Lead. Exactly. Yes. The lead function. That's exactly right. So we can use the lead function to get the next result from our user message. uh and we want to partition it by the user ID and order it by the time stamp. So this way we have the first message and the second message in our query. And we can do this not just for the message but also for the reply and the tool messages.
So let's put it all together. Now we can query over our data. We're going to um query our conversation context and we're going to filter on the the first tool call which is really going to be our anchor point uh because we want to find all the times this the bot went through this workflow and we know it went through this workflow if it uh called this first tool. So we're going to filter for the first tool here. We're just doing a simple string check here to filter over the first tool message.
And then we're going to find all the instances where the bot did not perform the actual modification in the next message which we can do easily by just quering the next tool message. So this will give us almost all our um uh um halls. We're missing one more thing here though. Uh we need to also consider the confirmation of the user. The user said yes please here. If the user had said no, we of course also would not have called the tool.
So our user here is replying in English. They're saying yes please. They might have said something like okay or that's great or they might even have replied in Spanish. We have Spanish users as well. So we need to actually classify the reply of the user as well. And we can do this relatively easy in data bricks as well using the AI classify function which is available in data bricks if you're using serverless and you can easily classify text uh into two labels here yes and no.
So this way we are able to query over all our conversations and find all the users that were impacted by this specific hallucination. So this is just one example of how we're using the data lake. Uh what we found is that this pattern using lead is actually very useful and it's all over a dashboard. We're not just using it for hallucinations but we're also using it for during incidents we've used it or just categorizing the conversations into different uh buckets.
Um, and you can only do this if you have all your data in the lake. And that's really the takeaway here. Like make sure your data is available for querying. Okay, I'm going to hand it over now back to for um the rest. Yeah. So looking forward uh what did we learn really with this whole experience? So the first part is what I alluded to earlier which is how important it is to have this integrated data ecosystem. Um so it's really easy with especially when you're developing langraph with lang graph it's really easy to focus on that part of the system as it it is kind of the most uncertain but really when you look at the system as a whole you realize that there's a lot of potential for leveraging data from other parts of it to kind of uh perform observability and understand where things went wrong and in fact I believe that it's much easier when you look at it from that lens so really the importance of Having this data ecosystem uh helped us a lot.
Uh the next part is kind of geni observability is a must. Generally I'd say observability in for any service is a must and to clarify uh you know there's monitoring which is knowing when something goes wrong and then there's observability which is understanding why something went wrong. And in this case, you know, with Ernin and the use cases that the chatbot assists with, there is a very high degree of domain expertise that is required on behalf of the chatbot to assist the user.
So, it's very important for us to understand the behaviors of the chatbot. When it doesn't behave the way we expect, it's really important for us to understand why. And sometimes this why is uh very nuanced. So having kind of this observability uh system in place is very very important and as your use cases that you want to onboard onto the chatbot become more complex the observability needs to grow uh in parallel with it.
Finally the importance of quick feedback cycles. So this is also a sort of a standard practice and in traditional software engineering maybe even things like unit test that you can step through locally to understand how things work. So having all this data into the lake allows us to basically achieve something like this which allows us to review uh chatbot behavior uh measure things that we want more of or less of and then iterate on it.
So where to next? Um like just showed an example of how we leverage this data for hallucination um detection essentially. So the idea is like let's try to do this in a proactive fashion. we're streaming all this data. Um there is an opportunity for us to actually be able to catch issues like that in near real time and proactively address those for the user. Uh use case discovery. So this is also a big one. We have all this data in the lake and like I said there's a lot of domain expertise that is required.
Uh we have also all the human agent support chats in the lake. So can we leverage all the cases where the chatbot maybe was not able to assist the customer and then this was handed off to a human agent. Can we learn from all this data and can we use this to build a large offline evaluation set that covers use cases that we don't know about also not only the use cases that we do know about. Uh finally model improvements.
Uh can we use data again from human agents to improve the chatbot in more intelligent ways? Ways that will allow us to expand our use cases without knowing what the specific use case is beforehand. So these are three key pillars that we're hoping to uh expand into next. Uh with that, thank you for attending. Uh please do complete your surveys on this section. Uh and that's all. Yeah, we ended a bit early, but we have time for questions if anyone has questions.

Learn more about the Databricks Data and AI platform.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.