How to build an AI Agent with Upsonic and the ClickHouse MCP server

What I computed (how)
I ran aggregations on the uk.price-paid tables in ClickHouse:
- overall 2025 summary (count, mean, median, min, max) from uk.uk_price_paid_simple_partitioned
- monthly breakdown for 2025 (transactions, mean, median)
- top towns in 2025 by average price (towns with >= 50 transactions)
- year comparison: 2024 vs 2025 (count, mean, median)
- breakdown by property type for 2025 (counts, avg, median) using uk.uk_price_paid

Key numbers (from the dataset)
- Overall 2025 (recorded transactions): transactions = 376,633; mean price = £362,282.66; median price = £281,000; min = £100; max =
£127,700,000.
- By month (2025): (month, transactions, mean price, median price)
  - Jan: 53,927, mean £386,053, median £285,000
  - Feb: 58,740, mean £371,803, median £285,000
  - Mar: 95,274, mean £377,200, median £315,000
  - Apr: 24,987, mean £331,692, median £235,000
  - May: 39,013, mean £342,380, median £255,000
  - Jun: 41,446, mean £334,667, median £268,500
  - Jul: 44,431, mean £348,293, median £277,500
  - Aug: 18,815, mean £364,653, median £292,999
  (Only months 1–8 are present in the dataset.)
- Top towns by average price (2025, towns with ≥50 transactions)
  - TRING: 126 txns, avg £1,973,274
  - BUCKHURST HILL: 98 txns, avg £1,441,331
  - ASCOT: 175 txns, avg £1,300,748
  - RADLETT: 69 txns, avg £1,160,217
  - COBHAM: 115 txns, avg £1,035,192
  - EAST MOLESEY, BEACONSFIELD, ESHER, CHALFONT ST GILES, THAMES DITTON are also in the top 10 (all high-average commuter/affluent towns).
- Year comparison (2024 vs 2025 as recorded)
  - 2024: 859,960 transactions, mean £390,879, median £280,000
  - 2025: 376,633 transactions, mean £362,283, median £281,000
  (2025 counts are much lower because the dataset only includes part of the year.)
- By property type (2025)
  - detached: 85,362 txns, avg £495,714, median £415,000
  - semi-detached: 107,580 txns, avg £319,922, median £270,000
  - flat: 62,975 txns, avg £298,529, median £227,000
  - terraced: 112,832 txns, avg £286,616, median £227,000
  - other: 7,884 txns, avg £1,087,765 (median £315,000) — note small-group and outlier effect

Important caveats and data quality notes
- The dataset appears partial for 2025 (only months Jan–Aug present). Any “2025” totals are not full-year figures.
- Large outliers exist (e.g., max £127.7M, and min £100). These likely include data-entry errors or non-standard records and inflate the
mean. Median is often a more robust measure here.
- “other” property-type averages are unstable due to low/heterogeneous counts and outliers.
- I did not filter by is_new, duration, or other metadata; those filters can change results (for example excluding new-builds or
leaseholds).
- The tables are Price Paid-style transaction records (recorded sales) — they do not directly represent asking prices or valuations.

Suggested next steps (I can run these)
- Clean out obvious outliers (e.g., prices < £10k or > £10M) and recompute averages/medians.
- Produce regional / county / postcode-area summaries and maps.
- Compute month-on-month or rolling 3-month median to show trend through 2025.
- Produce year-on-year (YoY) growth rates by month (e.g., Mar 2025 vs Mar 2024).
- Forecast for full 2025 using simple extrapolation or time-series modelling (but better after deciding how to handle missing
months/outliers).

If you want, I can:
- Re-run the same aggregations after removing extreme outliers and show cleaned results.
- Produce YoY monthly growth and charts (I can return CSV or JSON aggregates you can chart).
Which would you like me to do next?
[INFO] 2025-10-10T11:27:51 mcp_agent.mcp.mcp_aggregator.database-anayst - Last aggregator closing, shutting down all persistent
connections...
[INFO] 2025-10-10T11:27:51 mcp_agent.mcp.mcp_connection_manager - Disconnecting all persistent server connections...
[INFO] 2025-10-10T11:27:51 mcp_agent.mcp.mcp_connection_manager - clickhouse: Requesting shutdown...
[INFO] 2025-10-10T11:27:51 mcp_agent.mcp.mcp_connection_manager - All persistent server connections signaled to disconnect.
[INFO] 2025-10-10T11:27:52 mcp_agent.mcp.mcp_aggregator.database-anayst - Connection manager successfully closed and removed from context
[INFO] 2025-10-10T11:27:52 mcp_agent.mcp_basic_agent - MCPApp cleanup
{
  "data": {
    "progress_action": "Finished",
    "target": "mcp_basic_agent",
    "agent_name": "mcp_application_loop"
  }
}
```

- [Prerequisites](#prerequisites)- [Install libraries](#install-libraries)- [Setup credentials](#setup-credentials)- [Initialize MCP server and Upsonic agent](#initialize-mcp-and-agent)

Was this page helpful?