Healthcare’s Agent Bytecode: X12 as the Harness for AI Agents — Vasant Kearney, Onlay
AI Engineer · 20 min · 192 sentences · from YouTube's caption track
Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.
- 00:01[music]
- 00:12Hey everybody.
- 00:14How's everyone doing today?
- 00:16Good.
- 00:19So, this is a bit about my background, but I think it's always really good to learn what the audience background is if it's more on the technical side, which I know this
- 00:30conference is, healthcare side.
- 00:32Let's get a quick show hands to see who Who here is on the healthcare side?
- 00:38Ooh, wow.
- 00:38That's a lot of you.
- 00:39There's more than I expected.
- 00:40Wow.
- 00:41Okay.
- 00:41Who here is on the technical does the genetic workflows?
- 00:46Wow, okay.
- 00:47Overlap.
- 00:48All right.
- 00:48As should be expected at this conference.
- 00:50Who here has models running right now somewhere doing some work?
- 00:55Wow.
- 00:57It's like the whole audience.
- 00:58Okay.
- 00:59All right.
- 00:59So, I know who I'm talking to.
- 01:00Wonderful.
- 01:01This is the right crowd.
- 01:03So, what is the goal of this?
- 01:08Like if we're working in healthcare and we're doing some genetic workflows, we have to keep in mind the goal.
- 01:15And that goal, at least from my perspective, is to drive the overall cost down.
- 01:22So, in this talk will be about insurance cost specifically, the cost of of interacting with insurance.
- 01:31Um, but also to improve the patient experience because insurance relates back to the patient and how they experience the whole process.
- 01:41So, let's keep that in mind when we're solving problems.
- 01:43I know that if we're on the technical side, we like to get really experimental with things and get excited about just this the technology itself, but has to be grounded in one of these two concepts.
- 01:58So, a little trip down memory lane just starting from this long journey of AI machine learning and where we are today.
- 02:06And we're obviously going to talk about the last point, this agentic execution layer.
- 02:12But, we can see this evolution from the neuron convolutional neural networks large-scale unsupervised learning back in 2011 2012.
- 02:23Then, the introduction of attention is all you need, one of my favorite titles for a paper, the introduction of the the transformer.
- 02:32Then, we go into this modern chat interface with these large language models.
- 02:38And then, finally with the Claude codes, the Codexes, and our system internally, and a lot of systems you have open claw, Hermes agent, all all that kind of stuff.
- 02:50Which really brings into the into the picture this execution layer.
- 02:55So, we're going to be talking about how to do this execution layer safely and reliably in health care.
- 03:06So, let's think back to some of the earlier examples of like getting really excited about some AI technology and then realizing it has all these little bits and pieces which make it a lot more trickier than maybe it is is obvious at first.
- 03:21So, like you have a check and you want to cash it.
- 03:25You want to deposit it into your bank account.
- 03:27Um you might say, "Oh, we have solved the handwritten digit problem.
- 03:32We can recognize digits from zero to nine."
- 03:34Right?
- 03:35Wow, oh oh, so now we're ready to um deposit this check into this person's account and transfer money.
- 03:41Well, not quite because as you dig in a little bit deeper you see that you have to identify all sorts of characters in the check.
- 03:50You have to make sure it matches up with all these other pieces of the infrastructure.
- 03:56You have to make sure that it is um that it is um going to the target account that you're interested in.
- 04:04So, parts of this can be thought of as as the harness.
- 04:08Um in claims, we have a similar challenge that there's a lot of these little AI steps involved in fulfilling that whole patient journey of eligibility to getting the insurance company to deposit
- 04:25money in the provider's bank account.
- 04:28A whole bunch of little steps.
- 04:30And we have to make sure that we're safely doing this, that we're operating like in these tight con these strict confinements.
- 04:42So, another thing that comes up, just sort of setting the stage, is that um multimodal context in comes up very frequently with claims.
- 04:54So, you might have an image and it might seem like at at first for cost reasons or something else that you'd want to take that image and reduce it down to the findings, like
- 05:04here's the anatomy in the image, and maybe even extract some geometries from that anatomy.
- 05:10Here's pathologies.
- 05:11And then you would take that and then combine it with some other machine learning with some other data in a different downstream machine learning model.
- 05:20Like um EHR.
- 05:23And that might make sense from a cost perspective and also just like model capabilities.
- 05:30Um but in a lot of situations, it you lose context.
- 05:36So, it might be that you're extracting all this information and missing something that relates to some downstream procedure that you didn't that wasn't the upstream model wasn't aware of it.
- 05:48So, that introduces this concept of just multimodal processing.
- 05:53So, uh uh another place this comes up in healthcare, but not related to anatomy or anything like that, is desktop use.
- 06:01You can see that sometimes, you know, things are buttons or or or, you know, it might have some shapes that are only obvious when you do this multimodal.
- 06:16All right.
- 06:17What is the agentic execution layer?
- 06:22So, this can this can take on a lot of different forms.
- 06:25It is the ability of this model to take actions.
- 06:31So, it might be you're starting out with um database queries.
- 06:36And let's say it's just completely open.
- 06:38You're querying the database, you're finding your schema, you're figuring out what this what the data looks like, and then you might even have access to your code.
- 06:48So, then you're querying your code with the respect to your data.
- 06:53Uh and you might actually, in our system or other systems, you might be making insurance transactions.
- 06:58You might be making a phone call.
- 07:00You might be looking at a web portal.
- 07:02You might be interfacing with an EHR.
- 07:05These are all actions you can take.
- 07:08And some of these actions have right implications.
- 07:11If you're interfacing with different PMSs, you're going to the desktop, you can have at least user logs at the minimum.
- 07:20Uh and then the next concept is memory.
- 07:23So, cloud code or codex, they use local memory, they write to your desktop.
- 07:28In enterprise healthcare, we can't really do this, so we do memory in a database, just so we have that logical separation.
- 07:40Uh important concept here is that when you're introducing new and improved better models more sophisticated more parameters you can't you can't just replace the model and assume it's going to be better
- 07:56it's different right it's a it's a on certain evals it's a better model as measured by these different metrics but it doesn't necessarily mean it's better right for all the situations that you want it to be better at because of the way you've designed your system
- 08:10so you really have to redo everything from scratch just make sure your evals your testing your validation is all set up so that you can introduce these new models
- 08:22and not break your system.
- 08:31So this concept of harness different groups have different definitions of this so I'm going to use a super broad definition here which is like all the different nuts and bolts that that surround this agentic
- 08:47reasoning and that is the concept of memory that we discussed the different tools the checks the permissions the handoffs the evals but also in the context of health care and claims
- 09:01it's x12.
- 09:04So just like we have these old school languages or formats like COBOL or other stricter maybe strict languages typescript llms really thrive they work well and when they're confined they have clear
- 09:24limited values that they can predict and x12 is exactly this so it provides this underlying structure this contract between what you're trying to communicate and the insurance company.
- 09:44So, when you're reasoning in this in this healthcare, your your objective is to do something with handle a claim or research your EHR with respect to claims.
- 09:56It might be that you have like 50 steps or something like that.
- 09:59There's a lot of different steps.
- 10:01And so, you can um you at at each of those steps as you make mistakes, those mistakes can propagate down your system.
- 10:10Um and so, it's very good to have something grounded that can be rejected to.
- 10:15So, if you have a really strict got guardrails, you can reject something that happens that's incorrect.
- 10:27So, if you're reasoning over, let's say, the previous example, 50 steps, that and they're multimodal.
- 10:35You're considering and everything like that.
- 10:37That can get really expensive.
- 10:39It can also take a really long time.
- 10:41And folks might not want to wait.
- 10:43You know, it could be too expensive and people don't want to wait that long.
- 10:47And each time it each step is an opportunity to introduce an error and you can have problems.
- 10:53Um but, if you hardcode your whole system, you say we're you're going to throw out this whole agentic process, you limit yourself or your code can explode to be just unmanageable.
- 11:04So, now all of a sudden, you just have this crazy bloat and you have to have this giant engineering team, which poses its own problems.
- 11:12Um so, what we want to do is strike this balance between what we should be completely free, like um with just pure agentic reasoning and execution, and what is hardcoded.
- 11:28So, we do that internally with introducing memory, just this uh partner level memory, organizational organized memory and user memory.
- 11:41So, we say if a user, we find people in in multi-site health organizations, they tend to do the same thing day after day.
- 11:50And it might be if they mention a few words, "Oh, they usually do eligibility and they usually do it within this context, they probably mean this."
- 12:01Right?
- 12:01Where another user, they probably mean that.
- 12:05So, we want to be really careful here because as you introduce memory, you also persistent memory across chats, across days, you also introduce bias.
- 12:16So, maybe that person doesn't want to do the exact same thing that they did yesterday and now you steer them to do the exact same thing they did yesterday.
- 12:23That's a problem.
- 12:24So, you want to strike a balance somewhere in there and you want to make sure that the use any user can break out of this.
- 12:35So, for folks that are unfamiliar with the whole claim life cycle, it's many steps.
- 12:42So, each step does have an X12 correspondence with it.
- 12:46Starting with the schedule, when let's say you're showing up to the doctor's office before you even show up.
- 12:52That's insurance starts then.
- 12:54Um when you're getting treated, that also relates to insurance, what you you know, the different procedures that you are candidate for depending on your insurance.
- 13:04Um your documents, sometimes the x-ray itself is the document and you would send proof of that in.
- 13:10Submitting the claim.
- 13:12And then finally getting the payment in the provider's bank.
- 13:22So, this I think this concept is a little bit I I found it to be obvious in retrospect but let me talk you through it.
- 13:32Maybe you find it's it's interesting or not but if you're calling an insurance company that it that boils down to a transaction an X12 transaction.
- 13:45You'd say hey this is the patient I'm talking about.
- 13:48Great.
- 13:48That's a like an eligibility request a 270.
- 13:52Oh I need to do you're requesting a claim status or whatever it is you're doing that has an X12 grounding.
- 14:01And that is the whole concept here this this X12 harness.
- 14:05So you call the insurance company you have an agent interact with a desktop you have an agent interact with the browser your imaging system that's a 275 and and and your insurance your bank your ACH so
- 14:22that's not X12 but it's still that structured transaction.
- 14:32[snorts]
- 14:32So this is just a reiteration of these different transactions.
- 14:39And the other beautiful thing about it it's not you know it can you ask an agent to do something let's say you're genetically programming or let's say you're just you're you're programming
- 14:49how you know maybe half the companies I spoke with here still program today just everything by hand and they use these clock code or code X4 research.
- 15:01If you look up any of these transactions they're all public.
- 15:04Like this is not the beautiful thing about this is like this is not my schema.
- 15:08If you ask agents to make a schema for you you're going to get like all sorts of stuff.
- 15:13But now if we ground it in something standard you can look up all of these and you would know just right off the bat my schema.
- 15:20Let's say you're a new engineer coming in, like, you know.
- 15:30So, X12 is a is a system of rules and it doesn't mean that when an insurance company gives you an X12, it's true.
- 15:43So, that concept is when insurance company tells you something, it's coming from different teams potentially.
- 15:52They can have an engineering team that's It could be even a different company.
- 15:56A different company that the insurance company contracts out designed their web browser, their phone system, or their X12 layer, or their fire.
- 16:07And we have to understand that there's no ground truth.
- 16:12They also within all of these systems, they can they can all actually agree on the wrong information as well.
- 16:19Like, let's say they all say this patient is covered.
- 16:21All three You call them.
- 16:23You look in the browser and the X12 and they all say, "Yes, this patient is covered."
- 16:26And then you treat the patient, they say claim is denied due to the patient wasn't covered during that time.
- 16:32Um so, they can all disagree, but sometimes you'll learn some idiosyncrasies of these different payers that some of these systems are more reliable than others.
- 16:42But, regardless of if it originates as an X12 or not, you can boil all those transactions down to your own internal semi-correct X12.
- 16:51Correct until downstream evidence proves it otherwise uh to be incorrect.
- 17:01So, just a little bit more on that.
- 17:02So, and any of the X12, any of the information coming from the insurance company, any time can be wrong.
- 17:07It can be updated later.
- 17:09So, have fun.
- 17:13This is just an example of what it would look like if you're um in that patient journey.
- 17:19You're you're trying to figure out how much you would pay as a patient up front, and it's very important for your experience going to the doctor.
- 17:32And then the different treatments that you have in that clinic can oop.
- 17:40Yeah.
- 17:41The different treatments that you have in that clinic can be the evidence that you need.
- 17:45Like you might get a CBCT.
- 17:47Well, that those images and slices of those images might be the evidence that they're asking for.
- 18:00So, ultimately, if you're delivering that treatment, you're sending that claim, that claim is like a receipt of what you did.
- 18:08I did this, like here's the invoice.
- 18:10Right?
- 18:11Like you send it to the insurance company this invoice, and they would pay you back.
- 18:15So, that is your ultimate like contract of you're saying you did this work, it's sealed um and now the ball is in insurance company's court.
- 18:28And just a little bit about this progression of the claim from you're sending it, you're getting some acknowledgement, has like the syntax is right with that 999.
- 18:40The status has been updated.
- 18:42Hey, cool, we received it.
- 18:44Um maybe you call them and you verify the status didn't come in.
- 18:48Then you have this EOBs 835 receipt of payment.
- 19:00And then we're getting to the end of this uh this talk here, but I think that, you know, LLMs, I'm fully AI pilled, right?
- 19:09But we want to make sure that we introduce la- language models, small tiny models in a very skeptical conservative way.
- 19:20So, being AI filled is great, but you should also be very AI skeptical.
- 19:26Like these things, they make mistakes and it's not even you can't even say they make mistakes.
- 19:31Like we make mistakes designing them.
- 19:33We might set them up to fail.
- 19:35So, we have to be very skeptical of them and we have to use them in a way that's also cost-effective.
- 19:41You can't throw I mean you don't you don't want to use an overpowered over expensive model cuz then if you're going back to if you're reducing costs or not.
- 19:52Let's say it's ends up being super super expensive to deliver one of these routine things that need to be done a thousand times a day.
- 20:00You definitely don't want that.
- 20:04All right.
- 20:05Thank you very much.
- 20:22[music]