Automotive / sales and fleets · Agents in production

Two AI agents in production for a car maker

The problem

The Spanish subsidiary of a car maker had two sales processes that did not scale.

In retail, web leads went cold before turning into a dealer appointment. In fleets, sales reps had to watch the national and regional public procurement portals by hand and read every tender to decide whether to bid, and with which model.

I took over an inherited project with 12 diagnosed defects. In a first evaluation against a general-purpose assistant, the system lost: 21 points to 40.

The architecture

Two agents on Microsoft Foundry Agent Service, built on one shared idea: the model proposes, the code decides.

  • Leads (B2C): the lead comes in through Front Door and Azure Functions and is handled over WhatsApp with templates and buttons (dealer, confirmation, close). A Foundry agent steps in once the lead is confirmed and queries the real vehicle catalogue through OpenAPI tools. It has a content guardrail, continuity across days and a pinned version for instant rollback. Finally, the lead is pushed to the corporate CRM.
  • Fleets (B2B): crawlers on an isolated machine download and consolidate each tender. That machine never talks to the model: the AI stays server-side. Functions then chain classification, extraction of about 90 fields and a model recommender over the catalogue, and the agent reasons over the full tender with structured output.

How quality was assured

  • A dedicated evaluation bench, red teaming, mutation testing and A/B comparisons across more than 19 prompt versions.
  • 1,600+ automated tests and an independent code review.
  • Built with a team of specialised AI subagents, with shared memory and around 60 lessons indexed by symptom.

What I take away

A 200 OK does not mean the operation happened: the CRM and the classifier returned their errors inside the body. And when the evaluation bench goes red on correct behaviour, you fix the bench, not the agent.

Impact

  • Both agents are in production and the fleet pipeline runs end to end without human intervention
  • The lead agent answers from the real vehicle catalogue and the CRM hand-off is verified
  • Acceptance signed off in November 2026
  • The fleet agent was reused, anonymised, as a demo for a leasing company

Stack

  • Microsoft Foundry
  • Agent Service
  • Azure Functions
  • WhatsApp (ACS)
  • .NET
  • Python