RAIA™ Specification

ETL Method

How RAIA™ (Real estate Artificial Intelligence Agent) OS extracts, transforms, and loads data from any legacy PropTech application into a unified, AI-ready data layer — using a three-method extraction trio that cross-references itself for completeness and accuracy.

← Back to Developer Hub TEXTBOOK SPECIFICATION
RAIA™ (Real estate Artificial Intelligence Agent) Specification

How RAIA™ (Real estate Artificial Intelligence Agent) OS extracts, transforms, and loads data from any legacy PropTech application into a unified, AI-ready data layer.

🧩 Section A: In Plain English

ETL Method — Legacy Data Extraction, Transformation & Loading

RAIA™ (Real estate Artificial Intelligence Agent) OS uses a three-method extraction trio that cross-references itself for completeness and accuracy — extracting, transforming, and loading data from any legacy PropTech application into a unified AI-ready data layer.

§ 4.2 — ETL Method

ETL Method

3
Extraction methods (A·B·C)
2-phase
Dry-run → Write discipline
100%
Nightly autonomous operation
0
Manual data entry required
This page defines the universal ETL standard applied to all legacy data integration work on the RAIA™ (Real estate Artificial Intelligence Agent) platform. It explains the principles and pipeline architecture. For the concrete implementation of this method against a specific PropTech application, see § 4.1 Legacy Data Sources & Systems. For the gold standard tool example, see § 3.2b RentProfile R2R Scraper.

1.Why — Principles of Legacy Integration

🧱

Every Source Is Hostile Territory

Legacy PropTech systems were not designed to share data with competitors. APIs are partial, rate-limited, and quietly incomplete. We treat every source as a black box and verify independently rather than trusting vendor documentation.

⚖️

Three Methods, One Truth

No single extraction method is sufficient. API, MCP, and browser scraping each have blind spots. The three run in parallel and cross-reference each other. Consensus between methods is the source of truth; divergence is a data quality signal.

🔁

Dry-Run Before Write, Always

Every extractor runs in two phases: dry-run (generates a plan with record counts and field mapping) then write (executes from the plan). The plan is reviewed before any data is committed. This is non-negotiable discipline that prevents silent partial-loads.

🛡️

Idempotent, Auditable, Reversible

Loads are idempotent — re-running the same ETL never creates duplicates. Every load event writes to the audit log with timestamp, source, method, and record count. Data can be rolled back to any prior state from the audit trail.

This methodology was first fully articulated when building the RentProfile R2R Scraper. The API (Method A) could only retrieve records by request_id — with no list endpoint. We red-teamed the limitation, confirmed MCP was absent (Method B), then built a Playwright browser scraper (Method C) that could paginate the full R2R list without needing prior IDs. Both A and C now run together: the scraper extracts the bulk dataset; the API performs targeted status lookups. This combination is now the template for all legacy PropTech integrations.

2.How — The Three-Phase ETL Pipeline

E

Extract — Pull data from source using all available methods

Run Method A (API), Method B (MCP), and Method C (Browser) concurrently for each target application. Each method operates independently — no method waits for another. Each produces its own raw output file: /tmp/{source}-api-raw.json, /tmp/{source}-mcp-raw.json, /tmp/{source}-browser-raw.json. The Extract phase is always read-only. No writes to any source system ever occur during extraction.

T

Transform — Normalise, cross-reference, and deduplicate

The three raw outputs are merged into a single canonical record set. Fields are normalised to the RAIA™ (Real estate Artificial Intelligence Agent) unified schema (see config reference). Duplicates between methods are collapsed — the most complete record wins. Discrepancies between methods (e.g. API shows "active" but browser shows "expired") are flagged to the data_quality_issues table for human review. PII fields are pseudonymised before any AI scoring occurs. The Transform output is a clean, validated JSON plan: /tmp/{source}-etl-plan.json.

L

Load — Upsert into db_esoteric with full audit trail

The validated plan is loaded into db_esoteric (Supabase) via upsert — never raw INSERT. Upsert key is always the RAIA™ (Real estate Artificial Intelligence Agent) person_id or tenancy_id, never the source system's internal ID. Each loaded record writes an audit entry: {source, method, record_id, loaded_at, etl_run_id}. The Load phase is executed from the dry-run plan only — never re-scraped inline. After load, record count is verified against the plan; any shortfall triggers an alert.

Full Pipeline Architecture

EXTRACT TRANSFORM LOAD A — API REST / GraphQL B — MCP If available C — Browser Playwright scrape api-raw.json /tmp/{source}- mcp-raw.json /tmp/{source}- browser-raw.json /tmp/{source}- Merge & Normalise Unified RAIA (Real estate Artificial Intelligence Agent) schema Field mapping + coercion Dedup & Cross-Ref Consensus wins Divergence → DQ flag Validate & Pseudonymise Schema check · PII mask → etl-plan.json DQ Issues data_quality_issues Upsert → db_esoteric Person · Tenancy · Asset IDs Idempotent on person_id Audit Log source · method · loaded_at etl_run_id · record_count Count Verify Actual vs plan count Shortfall → alert RAIA™ (Real estate Artificial Intelligence Agent) Dashboard AI scoring live 🕐 Nightly Cron — 02:00 UTC Hermes scheduler · self-healing DRY RUN? Method A (API) Method B (MCP) Method C (Browser) Transform layer DQ flag / alert Gate decision

Repository Code

The live codebase implementation for this specification sits within the following repository folder:

Method Decision Tree

1. Does the application have a documented REST or GraphQL API?
→ YES: Probe it. Map all endpoints. Document rate limits and missing fields. Use as Method A.
→ NO: Skip A. Proceed to B.
2. Does the application expose an MCP server or SSE endpoint?
→ YES: Subscribe and record tool registry. Use as Method B alongside A.
→ NO (expected in most legacy PropTech): Skip B. Mark as "MCP: None" in the registry.
3. Can we authenticate into the browser UI and paginate the target data?
→ YES: Build Playwright scraper. Use as Method C. Always run regardless of A/B outcome.
→ NO (blocked by CAPTCHA, 2FA, IP block): Document as manual migration. Escalate to vendor for API access.
4. After all methods, are there data fields not reachable by any method?
→ YES: Document in data availability report. Present to agency as gaps. Negotiate with vendor.
→ NO: Full coverage confirmed. Proceed to load.

Cross-Reference Protocol

When two or more methods both return data for the same record, the following resolution rules apply:

ScenarioResolutionAction
A and C agree on all fields Consensus — load with confidence Load
A has field, C missing it A wins for that field Load A field
C has field, A missing it C wins for that field Load C field
A and C disagree on same field value Conflict — flag for human review DQ Flag
A returns record; C misses it entirely Likely paginated gap in C — check C completeness Investigate C
C returns record; A misses it entirely API gap confirmed — document in proptech registry Update Registry
Neither A nor C returns expected record Data not available — manual migration required Escalate

3.What — Infrastructure & Configuration

Infrastructure Overview

🗄️

db_esoteric (Supabase)

All loaded data lands here. Project ID: bwrnydpssbudswttqbry. Key tables: tbl_persons, tbl_tenancies, tbl_tenancies_persons, data_quality_issues, etl_audit_log, tbl_agency_data_consents.

☁️

Google Cloud Storage

Binary assets (PDFs, photos, files) extracted from legacy systems are stored in gcf_public/. Avatars land at gcf_public/avatar/{person_id}.jpg. Documents at gcf_public/docs/{tenancy_id}/{doc_type}.pdf.

⏱️

Hermes Cron Scheduler

All extractors run as Hermes cron jobs. Default schedule: nightly at 02:00 UTC. Self-healing: if a run fails, the scheduler retries with exponential backoff and alerts on persistent failure.

🎭

Playwright (Browser Scraper)

Headless Chromium via playwright-extra with stealth plugin. All browser sessions are read-only. URL allowlist enforced per scraper. Session cookies stored encrypted in Hermes vault, never in plaintext config.

Extractor Configuration Reference

Each extractor is configured via a source-specific JSON file at 03_technology/09_pipelines/config/{source}.json:

{
  "source": "rentprofile",
  "agency_id": "uuid",
  "methods": {
    "A_api": {
      "enabled": true,
      "base_url": "https://api.rentprofile.co.uk/v1",
      "auth_header": "X-API-Key",
      "endpoints": ["/status/request"],
      "rate_limit_per_minute": 60
    },
    "B_mcp": {
      "enabled": false,
      "reason": "No MCP server detected as of 2025-06"
    },
    "C_browser": {
      "enabled": true,
      "login_url": "https://rentprofile.co.uk/agent/login",
      "target_url": "https://rentprofile.co.uk/agent/r2r-reporting",
      "pagination": true,
      "stealth": true,
      "read_only": true
    }
  },
  "schedule": "0 2 * * *",
  "dry_run_first": true,
  "load_target": "db_esoteric",
  "upsert_key": "person_id"
}

File Inventory

FilePurposeLocation
{source}-extractor.js Main extractor — runs all three methods 03_technology/09_pipelines/programs/
{source}-api.js Method A — API probe and poller 03_technology/09_pipelines/programs/
{source}-browser.js Method C — Playwright authenticated scraper 03_technology/09_pipelines/programs/
{source}.json Extractor configuration (per agency, per source) 03_technology/09_pipelines/config/
{source}-etl-plan.json Dry-run output — reviewed before write phase /tmp/ (ephemeral)
etl-load.js Shared load module — upsert + audit log writer 03_technology/09_pipelines/programs/
cross-ref.js Shared cross-reference and dedup engine 03_technology/09_pipelines/programs/

Pitfalls

Critical
Never skip the dry-run phase

Running --write without a prior dry-run makes data discrepancies invisible until after the database has been modified. The dry-run plan is the safety net. It costs at most 3 minutes; skipping it can cost hours of rollback work.

Critical
Browser scrapers are not APIs — treat them as fragile

Any PropTech UI update can silently break a Playwright scraper. Use text-based selectors (e.g. text="Right to Rent") not class-based ones. Add record-count assertions at the end of every run so silent breakage becomes a loud alert.

Caution
Cross-reference discrepancies require investigation, not automatic resolution

When A and C disagree, never automatically pick one. Always write the conflict to data_quality_issues and surface it. Some conflicts reveal genuine data quality problems at the source that the estate agent needs to know about.

Caution
Upsert key must always be the RAIA (Real estate Artificial Intelligence Agent) person_id — never the source system's internal ID

Source IDs (RentProfile request_id, Alto applicant_id, etc.) are not globally unique across systems. Always resolve to RAIA™ (Real estate Artificial Intelligence Agent) person_id first. If a person can't be matched, create a provisional record and flag for human review — never load against an unresolved key.

Info
PII pseudonymisation happens in the Transform phase, not the Load phase

By the time data reaches the Upsert step it should already be pseudonymised for AI scoring purposes. Raw PII (names, emails, DOBs) is stored in encrypted columns only. Never pass raw PII to LLM APIs — anonymise before scoring. This is a GDPR hard requirement.

Vibe Check

Pre-ETL Run Gates

  • ✓ Agency consent form signed (check db_esoteric.tbl_agency_data_consents)
  • ✓ All three method probes documented in PropTech registry
  • ✓ Extractor config validated against consent scope
  • ✓ Dry-run plan reviewed and record count looks sane
  • ✓ Browser scraper tested against target URL (not blocked)
  • ✓ GCS credentials active and bucket writable
  • ✓ Hermes cron scheduled with notify_on_complete=true

Post-Load Verification

  • ✓ Actual record count ≥ 95% of plan count
  • ✓ Zero rows in data_quality_issues with severity = critical
  • ✓ Audit log has one entry per ETL run with correct timestamps
  • ✓ No write operations detected in browser session logs
  • ✓ RAIA™ (Real estate Artificial Intelligence Agent) dashboard shows populated historical data for agency
  • ✓ Next nightly cron scheduled and showing in Hermes cron list
  • ✓ Agency notified of any data gaps via onboarding wizard
§ 4.2 ETL Method · RAIA™ (Real estate Artificial Intelligence Agent) Developer Guide · See also: § 4.1 Legacy Data Sources & Systems · § 3.2b RentProfile R2R Scraper
🔧 Section C: Developer Guide

Architecture Details

The data architecture is built on a layered pipeline model: raw ingestion → transformation → storage → access. Each layer enforces schema validation, data quality checks, and audit trails. The system uses PostgreSQL (Supabase) as the primary datastore with Redis for caching and S3-compatible storage for blobs.

  • Core Component: Data pipeline engine with ETL orchestration
  • Data Flow: Source → Ingestion → Validation → Transformation → Storage → Query
  • Integration Points: Supabase PostgreSQL, Redis cache, S3 blob storage, event bus

Configuration Reference

Key configuration parameters for this system:

Parameter Type Default Description
batch_size integer 1000 Number of records per batch operation
schema_version string v1 Target schema version for data transformation
retention_days integer 90 Data retention period in days
DATA PIPELINE — INGEST → TRANSFORM → STORE → ACCESS 1. INGESTION Raw Data Collection Schema Validation 📥 Ingest 2. TRANSFORMATION ETL Processing Enrichment & Cleanup 🔄 Transform 3. STORAGE & ACCESS PostgreSQL / Cache Query & API Layer 🗄️ Store & Serve Data pipeline: ingest → validate → transform → store → serve with audit trails at every stage Batch processing · Schema validation · Data quality checks · Retention policies Ingestion / Collection Transformation / ETL Storage / Query / Access Data flow →

Figure 2: Data pipeline architecture — component interaction and data flow.

Troubleshooting

Issue Cause Resolution
Schema migration conflicts Concurrent DDL operations on shared tables Use migration scripts with 'IF NOT EXISTS' guards
Slow query performance Missing index on join columns Add composite indexes for common query patterns
Repo Reference RAIA

This component is part of the RAIA (Real estate Artificial Intelligence Agent) platform mono-repo. Implementation details, API contracts, and integration tests are available in the repository.