# Morocco Rental Market Intelligence Platform
An AI-powered pipeline that scrapes Moroccan rental listings, cleans and centralizes them, predicts missing/hypothetical prices with a trained ML model, and exposes it all through a conversational chatbot.
Built as an n8n-first system for scraping, storage, and orchestration (n8n cloud). The chat brain, retrieval, voice, and market-intelligence features on top of that data now live in standalone local Python/FastAPI services — see Beyond the original n8n scope and `CHANGELOG.md` for the full phase-by-phase build history.
## Architecture
```
┌─────────────────────────────────────────┐
│ n8n (cloud) │
│ │
agenz.ma ───┐ │ ┌─────────────────────────────────┐ │
├──▶│ │ Rental Listings Scraper - Morocco │ │
avito.ma ───┘ │ │ (daily 06:00, both sites) │ │
│ └───────────────┬───────────────────┘ │
│ │ upsert │
│ ▼ │
│ ┌─────────────────────────┐ │
│ │ Data Table: │ │
│ │ rental_listings │◀────────┐ │
│ │ scrape_errors │ │ │
│ └─────────────────────────┘ │ │
│ ▲ │ │
│ │ query │ │
│ ┌─────────────────────────┐ │ │
│ │ Morocco Rental Market │──────────┘ │
│ │ Chatbot (AI Agent) │ │
│ │ - search_listings (tool) │ │
│ │ - get_market_stats (tool) │ │
│ │ - predict_rent (tool) ────┼──HTTP──┐ │
│ └─────────────────────────┘ │ │
└───────────────────────────────────────────┼────┘
│
▼
┌──────────────────────────────┐
│ FastAPI ML service │
│ (deployed on Render) │
│ - /predict (XGBoost model) │
│ - /health, /model-info │
└─────────────────────── …