The problem
Dealers price used cars by gut feel and by browsing a few listing sites. The data exists, but it is scattered across portals, duplicated, and written inconsistently. The same car can appear as "Onix 1.0 LT", "ONIX LT 1.0 FLEX" or with a typo in the version.
What I built
An end-to-end pipeline that collects listings every day, normalises them into one clean model of make, model, version and year, and serves the result through dashboards and an AI assistant. I designed and built it, from scraping to the product a customer sees, and it was sold to a Brazilian car dealer.
Normalisation
Free-text ads are mapped to a single catalogue of make, model, version and year. The cleanup cut 5,114 model spellings down to 641 real models across 26,071 ads. Without this step a price comparison means nothing.
Database
About 250,000 listings in PostgreSQL, with standardised columns, materialised views for market statistics, data-quality checks and a read-only role for the assistant.
Business output
Dashboards answer the questions a dealer actually asks: what similar cars sell for, where a car sits against the market, and which stock is priced out of line.
Result
A before-and-after analysis of the dealer's data showed savings of about R$2,000 (roughly €300) per vehicle negotiation, and time in stock down to 1–3 months.
v1Function calling
OpenAI and Grok models call predefined functions to fetch data. A test suite compares the models' answers on the same questions.
v2SQL agent
The model writes SQL against the modelled tables, reading only from an approved list of tables.
v3 · finalClaude tool use
Anthropic Claude API with tool use. Prompt caching on the system prompt and tool definitions keeps cost and latency down.