Before an AI model summarizes a carrier scan history, two checks have to pass. Each scan event code needs one agreed internal status, and each timestamp needs a normalized value with its time zone source recorded. Skip either check and the summary can report a delivery the data does not support, or place events in the wrong order.
Why scan history needs preparation before an AI summary
A carrier scan history is a sequence of events the carrier’s systems recorded while a parcel or load moved. Each row usually carries an event code, a text description, a location, a timestamp and sometimes a reason code. Treat that list as raw input. It records what the scanning systems saw, which may differ from what happened to the goods.
The summary step reads these rows and writes a sentence for an agent or a customer. A model fills gaps in its input with plausible wording, so a problem left in the data shows up as a confident sentence.
Map scan event codes to a status vocabulary you own
Put a code table between the carrier feed and the summary. Each raw code gets one row. The row holds the carrier, the raw code, the raw description, the internal status it maps to, and a flag showing whether the event ends the carrier’s handling. Keep the table short enough for one person to review in a single sitting. It becomes the reference when someone asks why a summary said what it said.
Build the table in this order:
- Export each distinct code and description that appears in the scan history you plan to summarize, grouped by carrier.
- Group codes that describe the same physical event, such as an item reaching a sort facility, under one internal status.
- Mark the codes that end the carrier’s handling, such as a completed delivery or a return to sender, and separate them from interim events.
- Send any code without a mapping to a review queue rather than passing its description through to the model.
- Name one owner for the table and set a date for the next review.
A summary that says a step could not be verified is more accurate than one that guesses a status from the wording of a description.
Watch for codes that change meaning
Carriers sometimes keep a code and change its description, and sometimes they do the reverse. Either change can move an event into the wrong internal status without any visible error. Compare a sample of descriptions against their codes each time the feed changes, and log each change in the table’s history so a reviewer can see when a meaning moved.
Normalize timestamps and time zones before ordering events
Scan timestamps reach you in several forms. Some are local time at the facility with no offset. Some are UTC. Some carry an offset that gets lost when the file passes through a spreadsheet. A summary that says an item was delivered at 14:05, with no zone, can mislead a reader who sits in a different zone from the facility.
Keep three values for each event:
- The original timestamp string, exactly as the carrier sent it.
- A normalized UTC value, used for sorting and for elapsed-time statements.
- The facility’s own time zone, taken from your location record, plus a note of where that zone came from.
Daylight saving transitions cause the hardest errors to spot. An event recorded in the hour that repeats in autumn can convert to the wrong UTC value when the local time carries no offset. An event in the hour that does not exist in spring can convert to a time that did not occur. Check events within a day of each clock change by hand on the first run, and send any event with a missing offset to the review queue.
Order events by when they happened, not when they arrived
Carrier feeds often arrive in batches. A scan from a handheld device can reach you a day after a scan from a sort system that happened later. Sort by the normalized event time. If the carrier supplies a sequence number, use it to break ties between events that share a timestamp. If it does not, say so in the input to the summary rather than inventing an order.
Duplicates need the same care. One physical event can arrive twice, once from a handheld and once from an automated sort system, with slightly different codes or times. Define a duplicate as the same shipment, the same internal status, and times inside a window your operations team agrees to. Keep the first record and log the drop.
Handle gaps in the scan trail
A history can show a delivery with no pickup scan, or a departure with no arrival at the next facility. Gaps are a normal feature of carrier data, and they come from scanning practice as much as from failures. The summary should state that the trail has a gap. It should not fill the gap with a step that seems likely.
Set a readiness gate before the model receives input
A readiness gate is a set of checks that a shipment record must pass before it reaches the summary step. Four checks cover the common cases:
- Each event code maps to an internal status in the table.
- Each event has a normalized UTC value and a recorded zone source.
- The events sort into one sequence, with duplicates removed and tie-breaks applied.
- Each event that needs a location resolves to a facility record.
A record that fails a check goes to a queue for review. The summary for that shipment is either held back or labeled as partial, with the reason stated.
Structure the input you pass to the model
Pass the model a fixed set of fields for each event, in a fixed order: the internal status, the normalized UTC time, the local time with its zone, the location name, and a gap flag that marks whether the event follows a missing step. Leave the carrier’s raw description out of the default input. Add it back when a reviewer needs it, because raw wording invites the model to echo carrier language the team has already mapped away.
Instruct the model to rely on the fields it receives. Tell it to state when a field is missing, to report the current status from the last ordered event, and to say when the sequence contains a gap. Where the summary sits inside a low-code app built in App Engine Studio, the field list maps onto the fields and tables that app stores. The app engine and low-code for logistics and transportation covers the app side.
Test the summaries against shipments with known outcomes
Choose a fixed test set of shipments whose outcome you already know from the final delivery record, a signed proof of delivery, or a customer contact. Include shipments that cross a clock change, shipments with duplicate scans, shipments with gaps, and shipments handed between two carriers. Run the summary step against the set and compare each output with the known outcome.
Log each failure under one of four categories: wrong status, wrong order, wrong time, or invented event. The category tells you which layer to fix. A wrong status points at the code table. A wrong time points at normalization. An invented event points at the prompt or the input fields.
Keep the test set unchanged between runs so the results compare across changes. Re-run it after any change to the code table, the conversion logic or the prompt, and before you widen the set of shipments the summary covers.
Assign ownership and scope the summary before building the table
Data readiness for scan events usually involves three groups. The operations team knows what codes mean in daily practice. The data team owns the feed and the conversion logic. The team that owns the summary output decides what the reader sees and when a summary is held back. Name one person to approve changes to the code table, because drift in that table is a common source of quiet errors.
Settle which shipment questions the summary answers before you build the code table. The scope decides which statuses matter, and the AI use case discovery work is the place to set it. Teams that run freight and parcel operations can compare these event types with the logistics and transportation pages. For help planning this work, see AI and machine learning services.
Questions about scan event data before an AI summary runs
Should the summary quote the carrier’s raw descriptions to customers?
Usually it should not. Raw descriptions vary by carrier and by facility, and some are written for internal staff. A customer-facing summary reads better when it uses your internal status wording. Keep the raw description in the record so an agent can check the source when a customer asks about one specific scan.
What should happen when a shipment passes through two carriers?
Keep the carrier on each event and treat the handoff scan as its own internal status. Order the whole trail on normalized time across both carriers, and check the handoff for a gap on either side. If one carrier’s feed arrives late, hold the summary until the handoff event appears, or label the summary as partial.
Can the model infer a time zone from the postal code?
It should not be relied on for this. A postal code can span more than one zone in some countries, and a facility can sit outside the area its postal code suggests. Use the time zone from your location record, and send events with no matching location record to the review queue.
Who reviews the summaries once the gate is in place?
Sample a set of summaries on a regular schedule and compare them with the known outcomes, using the same four categories as the test run. Include shipments from each carrier in the mix, along with any held or partial summaries. Log new failure types in the table’s history and feed them into the next revision of the code table.