Technology

A serverless pipeline designed for messy freight paperwork.

SiftLading's architecture is planned on AWS. The services below are the proposed design for the product now in development; none of them are deployed in production yet. This website and the browser demo don't call any of them.

Architecture

Proposed architecture

Documents come in through an API, are stored unchanged, then are processed by event-driven functions. Extraction and language-model reasoning feed a deterministic rules step, and its results are stored for review.

SiftLading proposed AWS architecture Customer TMS or ERP sends documents to Amazon API Gateway, which triggers AWS Lambda to store raw files in Amazon S3. An S3 event triggers Lambda preprocessing, which calls Amazon Textract for extraction. Extracted fields are written to Amazon DynamoDB. A rules Lambda reads contract rules and shipment records and calculates variances. Amazon Bedrock is used to propose contract rules, match charge descriptions and draft explanations. Dispute packets are written back to S3, and webhook notifications go back to the customer. AWS · PROPOSED CustomerTMS · ERP · upload API GatewayREST ingest Amazon S3raw docs · packets Lambdapreprocess · notify Textracttables · forms · handwriting DynamoDBshipments · lines · status Bedrockcontracts · text Rules Lambdadeterministic math POSTS3 eventwebhookpacket PDF
Services & status

What each AWS service is for

Statuses are kept accurate: Proposed means the service is part of the design but hasn't been deployed or tested. We'll update this table as components go live.

ServicePlanned roleStatus
Amazon TextractExtract tables, key-value pairs and handwritten dock annotations from scanned BOLs, PODs and lumper receipts.Proposed
Amazon BedrockLanguage models to interpret carrier rate contracts into proposed rules, match free-text accessorial descriptions, and draft explanations and dispute justifications.Proposed
AWS LambdaEvent-driven functions for document preprocessing, variance calculation rules and webhook notifications.Proposed
Amazon S3Storage for raw freight PDFs, driver photos and compiled dispute packets, with lifecycle retention policies.Proposed
Amazon DynamoDBLow-latency storage for normalised shipment records, extracted invoice line items and audit status.Proposed
Amazon API GatewaySecure REST endpoints for sending documents and invoices from TMS and ERP workflows.Proposed
Data flow

One invoice through the pipeline

  1. Ingest. The customer's system posts an invoice and its documents to an API Gateway endpoint. A Lambda function validates the request and writes the files, unchanged, to an S3 prefix for that customer.
  2. Preprocess. The S3 write triggers a Lambda function that classifies each document (BOL, POD, lumper receipt, invoice), normalises page images and starts extraction.
  3. Extract. Amazon Textract returns tables, form fields and handwriting with confidence scores. Results are normalised and stored in DynamoDB, linked to the shipment.
  4. Interpret. For contracts and free-text charge descriptions, a Bedrock model proposes structured rules and charge types. Proposed rules wait for human confirmation before they are used.
  5. Calculate. A rules Lambda applies confirmed rules to the extracted evidence in ordinary code and writes each line's billed, payable and variance amounts with references to its sources.
  6. Review and act. Reviewers work the exception queue. Approved disputes are rendered into a packet stored in S3, and a webhook tells the customer's system the invoice's status.
Design principles

Why it's built this way

Serverless by default

Invoice volume is bursty: month-end, Monday mornings, carrier batch uploads. Event-driven functions scale with that without idle servers.

Models read, code calculates

Language models handle unstructured text. Every dollar amount comes from deterministic, testable code using confirmed rules.

Evidence is immutable

Source documents are stored as received. Extractions, rules and decisions reference them; they never overwrite them.

Amazon Web Services, AWS and the service names above are trademarks of Amazon.com, Inc. or its affiliates. SiftLading is not affiliated with or endorsed by AWS.