Case Study · AI Engineering · Property Market
UK Housing Market Intelligence
An end-to-end data and AI build: England and Wales property sales turned into an interactive dashboard, quarterly price forecasts and an assistant that answers questions in plain English.
Executive Summary
PERRA built this demonstration on HM Land Registry Price Paid Data for England and Wales, enriched with the ONS Postcode Directory so every sale can be analysed by local authority. The goal: show what applied AI engineering looks like in practice. This is not a chatbot bolted onto a report, but a clean data layer, a measured forecasting model and an LLM that answers from the database, all in one dashboard.
The data is public and the project is a showcase, but the engineering pattern is the one PERRA uses for client solutions: a structured data layer first, statistical models on top, and an AI agent that queries the data directly instead of answering from memory.
Tech stack: Python, DuckDB, MotherDuck, scikit-learn, statsmodels, Google Gemini, Streamlit.
The Dashboard
Key figures, price trends, forecasts and the AI assistant in one interactive app, filterable by district, postcode district, property type, new-build status, tenure and period.
- Key Figures
- Transaction count, latest median and average price, and year-on-year growth for the current selection.
- Trends & Breakdowns
- Quarterly median and average prices, transaction volumes and a split by property type, so shifts in the market are visible at a glance.
- Price Forecast
- A four-quarter outlook for the median price, with the model checked against a held-out backtest rather than taken on trust.
- Ask the Data
- A plain-English query box. Questions become SQL, the SQL runs on the real database, and the answer is summarised from the result.
The Challenge
HM Land Registry data is freely available, but the raw files are very large and unfriendly to non-technical stakeholders. Decision-makers end up waiting on analysts or static reports for basic market insight.
PERRA set out to make this data immediately usable without an analyst in the loop. Four questions guided the build:
- Market Trends
- How have prices and sales volumes moved across different areas, property types and tenures?
- Outlook
- Where are median prices heading over the next four quarters, and how far can that forecast be trusted?
- Instant Answers
- Can non-technical users query the dataset in natural language and get an answer in seconds?
- Trustworthy AI
- How do you make sure the LLM reports real figures from the database instead of inventing plausible ones?
The PERRA Approach
A modular three-layer architecture, built in sequence.
-
01
The Data Foundation Layer
Price Paid records are loaded into DuckDB and cleaned at the pipeline stage: prices are limited to £10k–£10M so extreme records do not distort averages, and the ONS Postcode Directory maps each postcode to its local authority. The processed database is hosted in MotherDuck, so the app queries it directly and the large data file stays out of the code repository.
-
02
Measured Forecasting
Quarterly median prices are forecast with Exponential Smoothing using an additive trend. Each model is evaluated with a four-quarter backtest, reporting MAPE and RMSE, so forecast quality is measured instead of assumed.
-
03
Grounded AI Agent (Text-to-SQL)
This is the core AI engineering feature. The LLM (Google Gemini) translates a question into a DuckDB SQL query. That query runs against the actual database, so the model does not answer from internal memory, and the returned result is turned into a short, readable answer.
Before: "Ask an analyst, wait for the next scheduled report."
After: "Type the question, get an answer traceable to the database in seconds."
Key Capabilities
Data-Grounded Answers
Every response comes from an executable SQL query on the live database.
Forecasts With a Track Record
A backtest on recent quarters shows how well the model would have performed.
Filtered & Comparable Metrics
Cleaned data and consistent filters keep comparisons between areas fair.
Zero SQL Barrier
Any team member can explore a large transactional dataset in plain English.
From Open Data to Enterprise Decision Support
The same architecture applies to proprietary client data.
Estate agencies, mortgage providers, property funds and local authorities all hold large amounts of transaction and operational data. With these three layers — a clean data layer, forecasting models and a grounded AI agent — organisations remove reporting bottlenecks and give their teams self-service intelligence.
Data sources: HM Land Registry Price Paid Data (Crown copyright, released under the Open Government Licence v3.0) and the ONS Postcode Directory. Forecasts are illustrative baselines, not financial advice.
Want AI engineering applied to your own data?
Book a free 30-minute chat to talk through what's possible with the data you already have.
Need an interim AI engineer in the UK? Get in touch — PERRA works on fixed-term and project engagements as well as ongoing retainers.