Work / AI · Logistics

Conversational AI for logistics: automating shipper churn research with LangChain and OpenAI

A regional freight and warehousing operator needed to know why commercial shippers were moving volume to other carriers. We built a LangChain agent on GPT-4.1 that asks the follow-up questions and writes the report, live in five weeks.

Live in production in 5 weeks with 2 engineersOne follow-up per reply, held to the campaign briefEvery theme linked to the shipper quotes behind itOpenAI GPT-4.1 through LangChain, no model to hostLive in production in 5 weeks with 2 engineersOne follow-up per reply, held to the campaign briefEvery theme linked to the shipper quotes behind itOpenAI GPT-4.1 through LangChain, no model to host

The challenge

The operator needed a faster way to understand why shippers reduced volume or declined renewals. Collecting comments was easy; reading open replies, grouping the real causes and writing a summary the commercial team could act on was the bottleneck. A fixed survey was not enough: “transit is slow” might mean a missed vessel, a congested warehouse or a pricing dispute, and account managers needed a relevant follow-up before the answer went stale.

What we built

A LangChain workflow that runs each campaign from brief to report. The team writes a brief (target accounts, lanes or warehouses in scope, questions to explore); the agent turns it into a short questionnaire, opens the conversation on WhatsApp and asks one follow-up per reply that builds on what the shipper just said. When collection closes, GPT-4.1 analyses the threads and returns recurring themes, a sentiment split and the quotes behind each theme.

The result

Two engineers shipped the system to production in five weeks, through four conversation-design iterations that tightened how the agent follows a reply and holds the brief. Campaign setup, WhatsApp collection and reporting now sit in one workflow, and every finding links back to the source quotes.

Example: why a shipper moved volume. Each reply drives the next question.

Shipper replyFollow-upWhat gets captured
“We moved part of our lanes to another carrier.”“Which lanes, and what tipped the decision?”Lane-level switching reasons
“Transit times have been unreliable.”“Which corridors are worst, and how does that hit your delivery commitments?”Reliability gaps and downstream impact
“Your detention charges are hard to predict.”“Where do those charges show up, and what would make them easier to plan for?”Cost friction and billing clarity
“Warehouse cut-off times don’t match our production schedule.”“What cut-off would fit your dispatch window?”Operational constraints
“We need clearer milestone updates before we commit more volume.”“Which events does your team need, and how soon after they happen?”Visibility requirements

Built with. The orchestration, model and channel behind the agent.

LangChain

Orchestrates the brief, questionnaire, WhatsApp send, reply collection, analysis and report.

OpenAI GPT-4.1

Runs the follow-up conversations and analyses the replies.

OpenAI API

Serves the model under enterprise terms: prompts and completions are not used for training.

WhatsApp Business

Delivers the questions and collects the replies.

Reporting store

Holds summaries, themes, sentiment and quotes in the operator’s existing warehouse.

At a glance.

Live in production in 5 weeks with 2 engineers

One follow-up per reply, held to the campaign brief

Every theme linked to the shipper quotes behind it

OpenAI GPT-4.1 through LangChain, no model to host

Short on time?

Ask AI to summarise this case study.

Opens your assistant with this page and a ready-made prompt. Nothing is sent from our site.

Need to know why customers are leaving?

Ready to turn your vision into reality?

Tell us the problem, the data, and where manual effort sits today. We'll map the path from MVP to scale.

What are you building?

Or email contact@avinyalabs.co

Tell us about your project

Rather talk it through? Book a call · or email contact@avinyalabs.co

What are you building?

Budget (optional)

0 / 2000
Best way to reach you

Book a call

30 minutes with the team. Pick a time that suits you. Rather write? Send project details

Loading available times

Ask Astra

Answers come only from our services, case studies and blog, with sources you can check.

Try asking

AI can make mistakes. Check the linked sources. Book a callSend project details