Fueling Efficiency: How Pilot Uses Vector Stores, Data Quality, and GenAI to Deliver Business Value
Summary
- Bill of lading automation: This video demonstrates how Pilot, North America's largest travel center network, used GenAI to automate fuel delivery validation, improving document parsing accuracy from 70% to 95%.
- Vector stores and vision models: The solution combines advanced text and vision models with few-shot learning and vectorized examples to handle diverse, handwritten, and mixed-format delivery documentation.
- Business impact: The automation generates millions in savings by accelerating credit reconciliation and improving financial operations at Pilot's 850+ locations.
Fueling Efficiency: How Pilot Uses Vector Stores, Data Quality, and GenAI to Deliver Business Value

Talk by Travis Lawrence, Sr Manager, Machine Learning Engineering, Pilot Travel Centers
In the complex world of logistics, efficiency and accuracy are paramount. At Pilot, the largest travel center network in North America, managing fuel delivery operations was a time-intensive and error-prone process. Tasks like processing delivery records and validating fuel transaction data posed significant challenges due to the diverse formats and handwritten elements involved. After several attempts to use robotic process automation failed, the team turned to Generative AI to automate and streamline this critical business process.
In this video, discover how Pilot leverages GenAI, powered by advanced text and vision models, to revolutionize BOL processing. By implementing few-shot learning and vectorized examples, the data team at Pilot was able to increase document parsing accuracy from 70% to 95%, enabling real-time validation against truck driver inputs, which has resulted in millions of savings from accelerating credit reconciliation and improved financial operations.
Databricks Named a Leader in the 2025 Gartner® Magic Quadrant™ for Data Science and Machine Learning Platforms: https://www.databricks.com/blog/databricks-named-leader-2025-gartner-magic-quadrant-data-science-and-machine-learning
Build and deploy quality AI agent systems: https://www.databricks.com/product/artificial-intelligence
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements
FAQs
How did Pilot improve document parsing accuracy?
By implementing few-shot learning with vectorized examples, Pilot increased accuracy from 70% to 95% for parsing bills of lading with handwritten content, mixed formats, and varying orientations.
Why did Pilot switch from RPA to GenAI?
Robotic process automation failed to handle the diversity of bill formats and handwritten content. GenAI with vision models proved more effective at processing unstructured, variable-format documents at scale.
What business outcomes did the automation deliver?
The improved accuracy and automation of document processing accelerated credit reconciliation, improved financial operations, and generated millions in savings by reducing manual work and errors.
How does this solution scale across Pilot's operations?
Pilot processes bills of lading every 22 seconds across its 850 locations. The GenAI system validates fuel transactions in real-time against driver inputs, enabling accurate financial reconciliation at unprecedented scale.
Full transcript
Just to give you guys a quick background on Pilot Travel Center. So, I've realized a lot of people don't know who we are unless you've been road trippers or professional truckering. So, we're the leading supplier and largest travel center operator in North America. You've probably seen us if you've driven any of the main freeway routes, I40, 75, I 80 across America, right? We operate 850 locations in 44 states and six Canadian provinces.
Am I good? Uh so and also to think about the scale that we're doing here and how much diesel fuel that we put out. We're actually dropping a load of diesel. So those big, you know, freight trucks every 22 seconds at a location. So and we also control all of our own logistics. So we have the third largest logistics fleet for delivering fuel. So we mainly serve professional drivers and serve um road trippers. So and we're also not just in diesel.
So we're also developing an coast to coast EV network along I40 every 50 miles. So if you're road tripping electric vehicle, you're probably stopping at a pilot. We're going to be the first one to have that available. And we're also developing hydrogen stations for heavy trucks in California right now as an alternative to diesel. So not we're actually on the cutting edge for fuel there. So to talk about the challenge that we had being a trucking company, picking up loads, dropping things off, we ended up lots of bills of lighting and delivery tickets.
And if you guys deal with any kind of freight, you're probably used to that. But what's what's unique for me is that as we go pick up fuel at these different terminals, there's not a standardized BL format for these deliveries. So they essentially have over 300 different types. And what's happening now is our truckers go to pick these up, they take a photo with their phone and send it into into our app, right? So then we have varying qualities of orientation.
All the forms are different. We got mixed of type, print, handwritten content. So you see this one's all handwritten over and this is actually valid information that we need to know about and it can be modified. We got some other examples where there additional handwriting, completely different format. Third example of another format with handwriting that we need to know. And these again, we're dropping a load every 22 seconds.
So we're getting a lot of these bills of lighting coming in from us and they're essentially scan pictures. And what we were doing before our current state was heavily humicentric. So our truck drivers were taking photos of these BS in an app that we built. These photos got uploaded to an S3 bucket and our poor truck drivers also had to enter that information manually into a form. This would trigger a queue where we had human reviewers in our headquarters that would look at the same BS and confirm that the truck drivers had entered the information correctly because some of these like product codes are really long alpha numeric really easy to fat finger.
They may have to put one field in the other field. So we had a lot of manual process going on here to actually enter this information into our database. So this was brought to us as a goal of the AI engineering team to try to automate this process in any way we can. They've already been to vendors a couple times trying to get this done and it had failed. So of course our solution journey I like to pre I'm a badass but you know it took us you know multiple uh iterations to get here.
So the first game that most businesses go is they go after RPA, right? Robot process automation, this feels right. You got OCR, you got, you know, certain fields you want to pull out. But what this ended up being, we have OCR errors coming out of these documents. Orientation's off. They could be blurry, right? Random placement of handwritten notes. Again, RPA can't handle random placements of notes. And we have over 300 templates, right, for RPA.
So this started to become unfeasible to go. So RPA team kind of did a couple and then like threw their hands up and being like this is too crazy, right? These guys are writing notes everywhere. They're crossing stuff out. You know, we have so many different types coming in and then every once in a while these terminals also decide just to change their format overnight because they feel like it. So then that template that was working perfectly all of a sudden doesn't matter anymore, right?
So RPA quickly was kind of tabled as not the way to go. So, first genai attempt, overly optimistic. Again, I like I like to think I'm really badass. So, what we went for is essentially just really straightforward. We went through OCR, extracted the text out, threw these into an LM and asked it to produce essentially the structure data that we need out all the fields, the gallons, understand the handwritten notes, thinking that OCR detects and saying the text is going to be our game, right?
So great, this is kind of our, you know, what we got in the first round. So a naive prompt, we tried to write one prompt out there for all of them. We got about a 69. 8% accuracy there, which is pretty poor. No one really liked that idea. Then we started doing these optimized prompts. We started seeing all these edge cases in the BS, right? So we started expanding this prompt out to get cover all these edge cases. When you see this, do this.
If this happens over here, do this. Right? And that started to get unsustain unsustainable with 300 variations. Those variations changing. But when we optimized that prompt, we got about to 76. 2%. 2% accuracy in pulling these fields and mapping them correctly. So unlike a good data scientist train engineer, I did not ask the humans how well they were doing. There's some assumption that of course they're 100% right. So my first lesson was once I saw those bad numbers, my first thought was let's go start to get a bunch of annotated data.
Remember I'm going to have to fine-tune a model, right? We're going to need this in general. So we had a bunch of human annotators that were experts um annotate this annotate three you know three people annotating one document. So we had replication they're only about 71% accurate right now. So people were were changing fields around they were fat fingering things themselves right um there's enough variation that there's disagreements over some fields existing or not existing depending on who you are trained by.
So at 76. 2% 2% once I got this, we're already beating the humans and those are going directly in the database. Business doesn't like that. They don't like the 76. 2%. So they're like, "No, that's not cool. I don't care that we're only at 71." But that number there were beating the vendors. The best our vendor got us was in the low was like 71 72%. So they get some comments to me at that point like maybe you'll pull this off.
So like any good AI engineer, whatever you want to call myself these days, we moved a few shop a few shop prompts, right? Let's bring in let's bring in examples, teach the LLM in context how to pull out documents, right? So we kind of stoke up this complex pipeline. We extract out the text with traditional like OCR methods. We then would use address lookup to pull in examples of how you're supposed to output this. We got better handling of variation, reduced prompt complexity, but again, we had to have labeled examples of those specific terminals.
If we got the address wrong through an OCR error, we we couldn't look it up, so I just went to that generic prompt. But this alone brought us up to 84. 7% just having that nearby. So again, the pipeline's complex. We have two prompts to maintain. We have the fuse shot and then we had a generic. if we didn't have an example default to the generic and if they default to that generic it sucks good to go you know so again 84 I was happy you know this is a win business is still like uh we're not going to let robots take over when they're going to put bad data in the in in the database even if it's better than humans so we we went another stage these documents are highly visual if you guys saw all those markings means there's literally some of them where you check certain boxes and if you check those boxes it means different stuff right so you know we decided why don't we instead of doing text let's pull out the OCR completely open up a multimodal model and do fart learning in a visual way in multimodal open up a vector database put put the you know the vectorzed images into there and then the output text and this also allowed us not to do that address lookup and uh we got this to 94.
3 And part of this is even if they were just visually similar even if they weren't the same terminal, it was pulling in examples and it was doing very well with visually similar BS. So this essentially kind of simplified the whole infrastructure of it, right? We're not pulling out OCR, doing address lookups. It's got this facial reasoning and it's actually boosted this quite a bit. So we got to 94. 3. You know, I thought my job was done.
I thought I could go home, right? I can move on to the next project. They're telling me no to. This is not good enough, right? You kept getting these jumps, man. Let's just see what happens when we push you. So, they brought us to another level. So, I didn't have time to update this slide. So, this is a little out of date, but I'll bring this up. So, really out of the bat, we know all the terminals that are out there.
We know all the potential products that are coming in to us. So, what we could do is we could build out a database of those. So when the model would get those slightly wrong, right, we could do fuzzy matching as a step to correct the addresses to correct the products to correct those things and it actually worked really well because in semantic space like this fuzzy matching strings the number of errors you'd have to get to have those overlap were really low.
So we could actually find and correct the products on the fly. We did this manually but now we actually have this as a tool to the agent as an MCP resource that it can look up structured SQL pull. So it's pulling brand new data every time. So if we do update that comes live, they got that data right away and this actually pushed us to the 98. 6% and then they were happy at that stage. So this is good to go now. This is way better than humans.
This is actually living we have a a feedback loop as these o as these forms are approved in our system. These are actually being added right back into the fshot database as examples and we're having that cyclic loop. So it is getting new and learning over and over again and getting more examples. So this is kind of self- sustaining at this stage and we'll talk a little bit about what the errors are there. Actually go back to that.
What's my time? Eight minutes. I'm good. So like 98. 6 most of those errors are we don't have a terminal set up or we don't have a certain product coding out there. So it's not in our internal database to match. So they're being kicked out and those need to be added in. So it's not necessarily that this thing is doing poorly. This is almost at actually 100%. It's that our downstream data for matching and then up to our lines of business is not there have been updated.
So they're being kicked out of the system there. So of course I talked about this feedback loop. We're adding in automatically adding in additional images with text data into that vector database for our few shot examples. So as we do that and if everyone heard the keynote talk this morning that there are more agents building Postgress databases than there are humans data observability and data alerting become a huge deal because I'm not watching these guys every day.
They're making their own decisions and adding stuff to my database. So you can quickly see this get out of control. They keep adding bad data. So what we did was kind of hacky but we use Monte Carlo as our monitoring. So as you vectorize images, right, you get this huge vector, whatever it is, you know, 1,00 2,000, you know, columns long of numbers. So what we've been doing there is we've been dumping those into a delta table on data bricks, putting a Monte Carlo monitor on those.
And I think we got lucky. Um, most of our BL's essentially cluster in multi-dimensional space the way that we see here, but you think in 2,000 dimensions, 4,000 dimensions, whatever you want. So then when we get bad images going in or they don't match, they actually make outliers that trigger these Monte Carlo alerts and we can actually go in and look. And one of these examples is our model has gotten to the point where it's so good where we had a truck driver accidentally cover up a ton of like information on the address and all this on the B and took a picture.
Well, it pulled in enough few prompt examples of the same terminal. It knew what the address was, prefilled it, it passed our fil, it passed our checks, but that image got added in. And when that image was added in, it triggered the alerts so we could actually come and look at it be like, "Yeah, cool. We don't need some guy's hand." Even though it did well, I'm happy it did well, but we don't need someone's hand in there and eventually kind of like eroding our vector databases quality unknowingly, right?
So, this is what we've done here. to plug in Marty Car again. They just released more of an official product for monitoring vector databases and I feel like this is going to be a big deal as they kind of evolve and we let agents deal with the data more and more is that we just kind of have to be able to watch what they're doing on there. Business impact, I wish that first bullet point was was true. Reassignment is staff to higher value analytics roles.
We're in that process of of training and getting the business confident with this where they feel like they can take their hands off. That's not happened. But we do have a 99% reduction in manual document processing. So they're spot checking these and watching them, but they don't really have to enter in the data anymore at this point except for those few that are kicked out. We have elimination of data backlog. This is real time serverless.
As these come in, they're processed very quickly. 90% decrease in overall processing cost. This is super cheap to run. Increased revenues or decrease our billing time so we can get our money faster. is that and this is scalable to any size serverless. So if we ended somehow had 10,000 more BS would not be an issue, right? Because it's going to scale out, we're not on that future work that about that what 1. 6% that are failing because we don't have the right data in our downstream databases.
Our goal there is to essentially remove the manual process for adding new products and terminals. This information is public and available out there. So, we're looking at testing agents real time to see if they do grab something we don't have, can they go out and verify that this does exist and add it to our database so we don't have to manually add those pieces in because this is verifiable data. So, we can get around hallucinations.
We can get around those pieces and feel confident. But that's another one where all of a sudden agents are going to be the primary adders to a database by adding the BS and also adding new products and new terminals. So being able to watch that is going to be critical. Excite. You can see that spin out of control very quickly.
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.