2.21 Systems Transition Plan — Estate Agent Customer Onboarding
When a new estate agent customer joins RAIA, we do NOT import years of old emails and chat messages into the live system. Instead, we continuously sync their legacy system data (Intercom, Streak, etc.
When a new estate agent customer joins RAIA, we do NOT import years of old emails and chat messages into the live system. Instead, we continuously sync their legacy system data (Intercom, Streak, etc.
2.21 Systems Transition Plan — Estate Agent Customer Onboarding
When a new estate agent customer joins RAIA, we do not import years of old emails into the live system. Instead we sync legacy data to BigQuery, compress histories into readable narratives, and run both systems side-by-side for 8 weeks before cutting over.
When a new estate agent customer joins RAIA, we do NOT import years of old emails and chat messages into the live system. Instead, we continuously sync their legacy system data (Intercom, Streak, etc.) to BigQuery for analytics, compress conversation histories into readable "snapshot narratives" so staff have context, and run both systems side-by-side for exactly 8 weeks. After week 8, the old system is cancelled and all new conversations flow exclusively through RAIA. This prevents data duplication, staff confusion, and compliance risks while ensuring zero disruption to ongoing conversations.
2.21 Systems Transition Plan — Estate Agent Customer Onboarding
The reusable 8-week template for migrating estate agent customers from legacy systems (Intercom, Streak, Reapit, AltoVeco) to RAIA (Real estate Artificial Intelligence Agent) without importing full message history or causing split-brain during concurrent operation.
PART 1 ELI5 — In Plain English
Why Not Just Import Everything?
When an estate agent joins RAIA (Real estate Artificial Intelligence Agent) (or when we migrate our own brand, Sovereign Pilot Agency, off Intercom), the naive approach is to import all historical conversations, emails, and contacts into the new system. This creates four major problems:
Staff see the same tenant conversation in both systems. They reply in Intercom while RAIA (Real estate Artificial Intelligence Agent) drafts a response in parallel. The tenant receives two different answers. Trust collapses.
Years of emails (500,000+ messages) bloat the RAIA (Real estate Artificial Intelligence Agent) database. Search becomes slow. The AI hallucinates context from 2019 threads that are no longer relevant. Storage costs explode.
The legacy system's data sits in their cloud (US-based Intercom). We copy it to our UK database. Now we're a data processor for data we didn't originally collect. The Data Protection Agreement is unclear. UK GDPR data-minimisation is violated (why store 5 years of spam?). Audit liability doubles.
A tenant is mid-referencing (week 3 of a 6-week process). We import their conversation history and cut over to RAIA. The legacy system still has their deposit hold, compliance notes, and ID verification state. RAIA (Real estate Artificial Intelligence Agent) has the messages but not the workflow state. The tenant falls through the cracks.
The RAIA (Real estate Artificial Intelligence Agent) Doctrine: Sync, Compress, Cutover
Instead of importing, we follow three principles:
We build a connector (TypeScript/Node.js pipeline) that pulls data from the legacy system's API every hour and writes it to Google BigQuery. This becomes the analytics layer — staff can query "how many tenant complaints did we receive last quarter?" without touching the live RAIA (Real estate Artificial Intelligence Agent) database. BigQuery handles historical reporting; RAIA (Real estate Artificial Intelligence Agent) handles operational workflow.
For each person (tenant, landlord, supplier), we generate a snapshot narrative — a 200-500 word AI-synthesised biography covering key facts: "Jane Doe, tenant at 42 High St since 2022. Paid rent on time for 18 months. Complaint history: 1 heating repair (resolved). Emergency contact: John Doe (brother)." This snapshot lives in tbl_persons.about and gives staff full context without storing 10,000 raw chat messages.
We don't flip a big switch. Instead, we move channels independently: Week 5 = email cutover (new emails land in RAIA, legacy email stays in Intercom for lookups). Week 6 = WhatsApp cutover. Week 7 = SMS cutover. Staff always know which system owns which channel. No split-brain.
Legacy vs RAIA: Side-by-Side Comparison
| Aspect | Legacy Approach (Full Import) | RAIA (Real estate Artificial Intelligence Agent) Approach (Sync + Snapshot) |
|---|---|---|
| Historical Messages | Imported into live database (500K+ rows) | Synced to BigQuery (analytics only), compressed to snapshots |
| Concurrent Systems | Undefined — staff reply in both, creating chaos | 8-week ceiling, explicit per-channel ownership rules |
| Data Protection | Unclear processor status, full history retained | DPA covers BigQuery sync, data-minimisation via snapshots (GDPR selling point) |
| In-Flight Conversations | Imported mid-process, workflow state lost | Active threads migrated selectively, rest stay in legacy (read-only) |
| Contact Deduplication | Manual matching, often results in duplicate profiles | Identity fingerprint matching (email/phone hash, ADR pattern) |
| Rollback Risk | Irreversible after import | Weekly rollback gates, legacy system kept live until week 8 |
PART 2 User Guide — Transition Overview
The 8-Week Timeline
This is the mandatory template for every customer onboarding. Do not extend beyond 8 weeks — concurrent-system costs (staff confusion, dual billing, support overhead) compound exponentially.
| Week | Phase | Activities |
|---|---|---|
| WEEKS 1-2: SHADOW MODE + DATA SYNC | ||
| Week 1 | Connector Build |
|
| Week 2 | Snapshot Build + Shadow Mode |
|
| WEEKS 3-4: GATED MODE (AI DRAFTS, HUMAN SENDS) | ||
| Week 3 | Gated Activation |
|
| Week 4 | Expand Gated Scope |
|
| WEEKS 5-6: PER-CHANNEL CUTOVER | ||
| Week 5 | Email Cutover |
|
| Week 6 | WhatsApp + SMS Cutover |
|
| WEEKS 7-8: LEGACY READ-ONLY + CANCELLATION | ||
| Week 7 | Legacy Read-Only |
|
| Week 8 | Legacy Cancellation |
|
Roles & Responsibilities
- Build/test BigQuery connector
- Generate person/property snapshots
- Monitor pipeline health (
tbl_pipeline_runs) - Execute technical cutover (MX records, number porting)
- Review AI drafts in gated mode (weeks 3-4)
- Report split-brain incidents immediately
- Follow ownership rules post-cutover (reply in RAIA (Real estate Artificial Intelligence Agent) only)
- Access legacy system for pre-cutover history lookups
- Staff training (RAIA (Real estate Artificial Intelligence Agent) UI, approval workflow)
- Weekly check-ins during weeks 1-8
- Escalation path for rollback triggers
- Coordinate legacy system cancellation
- Review/sign Data Processing Agreement (DPA) for BigQuery sync
- Approve snapshot compression (data-minimisation justification)
- Audit final export before legacy cancellation
- Update Records of Processing Activities (ROPA)
Per-Channel Cutover: Ownership Rules
The critical anti-pattern is per-conversation cutover ("move this tenant thread to RAIA"). This creates split-brain: staff forget which system owns which conversation. Instead, we cut over per channel and per date.
Email: All emails received on/after [EMAIL_CUTOVER_DATE] land in RAIA. Pre-cutover emails stay in legacy (read-only). Staff reply to post-cutover emails ONLY via RAIA.
WhatsApp: All WhatsApp messages received on/after [WHATSAPP_CUTOVER_DATE] land in RAIA. Pre-cutover threads stay in legacy (read-only). Staff reply to post-cutover messages ONLY via RAIA.
SMS: All SMS received on/after [SMS_CUTOVER_DATE] land in RAIA. Pre-cutover SMS stay in legacy (read-only). Staff reply to post-cutover SMS ONLY via RAIA.
Phone Calls: If using RAIA (Real estate Artificial Intelligence Agent) voice (Twilio integration), port phone number on [PHONE_CUTOVER_DATE]. Pre-cutover call logs stay in legacy (read-only).
Problem: A tenant is mid-referencing (week 3 of 6-week process). Email cutover happens. The tenant's next email lands in RAIA, but their deposit hold, ID verification, and compliance notes are still in the legacy system.
Solution: For actively-open threads (defined as: ≥ 1 message exchanged in last 7 days), staff manually create a "handover note" in RAIA (Real estate Artificial Intelligence Agent) summarising workflow state BEFORE cutover. Example: "Tenant Jane Doe — deposit £1,200 held in Intercom deposit module (legacy), ID verified via Sumsub on 2026-07-10, awaiting guarantor proof of income." This note is stored in tbl_conversations.human_notes so AI has full context.
Alternative (Advanced): Selectively migrate actively-open threads to RAIA (Real estate Artificial Intelligence Agent) during Week 4 (move conversation history + workflow state). Complexity: high. Benefit: smoother tenant experience. Recommended only for customers with < 50 in-flight threads at cutover.
Rollback Criteria (Per-Week Gates)
Each week has explicit rollback triggers. If criteria are met, halt forward progress and revert to the prior phase for 1 week. Do not proceed to the next phase without resolving root cause.
| Week | Rollback Trigger | Rollback Action |
|---|---|---|
| Week 1 | BigQuery pipeline failure rate > 10% (cron jobs failing silently) | Fix pipeline + re-run backfill before proceeding to Week 2 |
| Week 2 | Snapshot quality < 70% (staff report "snapshots missing key context") | Improve snapshot prompt + regenerate before shadow mode |
| Week 3 | AI approval rate < 80% (humans reject > 20% of drafts in gated mode) | Revert to shadow mode for 1 week, re-tune AI prompts/context |
| Week 4 | Split-brain incidents > 2/week (staff reply in both systems to same conversation) | Halt cutover planning, re-train staff on ownership rules |
| Week 5 | Email delivery failure rate > 5% OR staff bypass RAIA (Real estate Artificial Intelligence Agent) > 3 incidents/day | Rollback MX record changes, investigate routing issues |
| Week 6 | Message delivery < 95% OR customer complaints > 10/day | Rollback number porting, investigate Twilio integration |
| Week 7 | Staff still logging into legacy system > 5x/day (suggests insufficient snapshot quality) | Investigate missing context, regenerate snapshots, defer cancellation to Week 9 (emergency extension ONLY) |
| Week 8 | Customer requests extension (legitimate: mid-audit, regulatory hold, etc.) | Maximum 2-week extension (total 10 weeks). Charge customer for dual-system overhead. Document in DPA. |
The 8-week timeline is not arbitrary. Concurrent-system operation costs compound: staff confusion grows, dual billing accumulates, and the risk of data drift (legacy and RAIA (Real estate Artificial Intelligence Agent) databases diverging) increases exponentially. Beyond 8 weeks, rollback becomes exponentially harder (which system is the source of truth?). If rollback gates are triggered multiple times, abort the onboarding and re-evaluate customer readiness. Do not let concurrent operation drag to 12+ weeks.
PART 3 Developer Guide — Technical Architecture
BigQuery Sync Pattern
The BigQuery ETL pipeline is the analytics backbone of the transition. It serves three purposes:
- Historical Reporting: Staff query "how many complaints last quarter?" without touching RAIA's live database.
- Snapshot Generation: AI reads BigQuery tables to synthesise person/property narratives.
- Audit Trail: Post-cancellation, BigQuery is the immutable record of what existed in the legacy system.
Connector Architecture (Reference: Slack/Gmail/automated bank reconciliation gateway Patterns)
Each legacy system requires a custom connector. Existing patterns in 03_technology/09_pipelines/connectors/:
- API Client: Legacy system SDK or REST API wrapper (handle auth, rate limits, pagination)
- Deduplication: Maintain in-memory Set of
message_idortransaction_id. Skip rows already in BigQuery (query last 24h before each run). - Schema Mapping: Transform legacy system fields to BigQuery schema (see table below)
- Error Handling: Retry transient failures (429 rate limit, 503 service unavailable). Log permanent failures to
tbl_pipeline_runs. - Scheduling: GitHub Actions cron (hourly recommended, daily minimum). CRITICAL: every run MUST log to
tbl_pipeline_runs(ADR-158 pattern — silent cron failure hid 34 days of broken sync).
BigQuery Destination Schema (Standardised Across Connectors)
| BigQuery Column | Type | Description | Source Mapping (Legacy System) |
|---|---|---|---|
message_id |
STRING | Unique message identifier (primary key for dedup) | Intercom: conversation_id:message_idStreak: boxKey:timestamp |
conversation_id |
STRING | Thread/conversation grouping ID | Intercom: conversation_idStreak: boxKey |
sender_email |
STRING | Sender email address (for identity matching) | Intercom: author.emailStreak: from |
sender_phone |
STRING | Sender phone number (normalised: E.164 format) | Intercom: author.phoneWhatsApp: from |
sender_name |
STRING | Sender display name | Intercom: author.nameStreak: fromName |
recipient_email |
STRING | Recipient email address | Email systems: to field |
body |
STRING | Message body (plain text or HTML, max 1MB) | Intercom: bodyStreak: bodyText |
sent_at |
TIMESTAMP | Message send timestamp (UTC) | Intercom: created_atStreak: timestamp |
channel |
STRING | Channel type: email, sms, whatsapp, chat, phone |
Derived from legacy system API endpoint |
direction |
STRING | inbound or outbound |
Intercom: conversation_parts[].part_type |
legacy_system |
STRING | Source system: intercom, streak, reapit, altoveco |
Hardcoded in connector config |
legacy_url |
STRING | Deep link to message in legacy system (for staff lookups) | Intercom: https://app.intercom.com/a/inbox/... |
organisation_id |
STRING | Customer's RAIA (Real estate Artificial Intelligence Agent) organisation UUID (for multi-tenancy) | Configured per connector deployment |
extracted_at |
TIMESTAMP | When this row was written to BigQuery (ETL timestamp) | Generated by connector (NOW()) |
Pipeline Monitoring: tbl_pipeline_runs
Every connector run MUST log to tbl_pipeline_runs (PostgreSQL, live RAIA (Real estate Artificial Intelligence Agent) database). This is the heartbeat monitor that prevents silent cron failures.
-- Example log entry (Node.js connector)
INSERT INTO tbl_pipeline_runs (
pipeline_name, status, started_at, completed_at,
rows_processed, rows_failed, error_message, organisation_id
) VALUES (
'intercom-bigquery-sync', 'success', '2026-07-17 10:00:00', '2026-07-17 10:15:32',
1247, 0, NULL, 'a1b2c3d4-...'
);
Alert Rule: If no tbl_pipeline_runs entry for a given connector in > 25 hours (hourly schedule + 1h buffer), send Slack alert to #raia-engineering. Investigation required immediately.
Snapshot Compression: Person & Property Narratives
Snapshot compression is the data-minimisation mechanism that avoids full history import. For each person (tenant, landlord, supplier) and each property, we generate a concise narrative summary.
Person Snapshot Schema (tbl_persons.about)
The snapshot narrative is stored in tbl_persons.about TEXT column. It follows a 4-section structure:
§1 Identity & Role: Name, role (tenant/landlord/supplier), current/past tenancies, contact channels.
§2 Relationship History: How long they've been a customer, key milestones (moved in, lease renewal, moved out), payment track record.
§3 Communication Patterns: Preferred channel (email vs SMS vs phone), response time expectations, tone (formal/casual), language barriers.
§4 Issues & Resolutions: Complaint history (heating repairs, noise complaints, deposit disputes), how they were resolved, outstanding items.
Snapshot Generation Pipeline (AI-Powered)
- Query BigQuery:
SELECT * FROM legacy_messages WHERE sender_email = 'jane@example.com' ORDER BY sent_at DESC LIMIT 200;(last 200 messages, not all 10,000) - AI Prompt (Claude Sonnet 4): "Synthesise the following email/SMS history into a 200-word person snapshot. Focus on: identity, relationship history, communication patterns, and key issues. Omit marketing spam and generic pleasantries."
- Human Review (Optional, Week 2): Staff review 10-20 sample snapshots for quality. Adjust prompt if hallucinations or missing context detected.
- Insert to RAIA:
UPDATE tbl_persons SET about = '[SNAPSHOT]', updated_at = NOW() WHERE email = 'jane@example.com';
Property Snapshot Schema (tbl_assets.notes)
Similar 4-section structure for properties:
§1 Property Details: Address, property type (flat/house), bedrooms, landlord, managing agent.
§2 Tenancy History: Current tenant(s), move-in date, lease term, rent amount, deposit amount, previous tenants (if relevant).
§3 Maintenance History: Recurring issues (boiler, damp, appliances), repair frequency, outstanding work orders.
§4 Compliance Notes: EPC rating, gas safety cert expiry, electrical cert expiry, HMO licence (if applicable), landlord licensing notes.
Snapshots are not static. After cutover (Week 5+), as new conversations happen in RAIA, the AI continuously appends to snapshots (e.g., "2026-08-10: Tenant reported leaking tap, resolved same day"). This keeps context fresh without storing raw message logs forever. Regenerate full snapshots quarterly (merge BigQuery historical data + RAIA (Real estate Artificial Intelligence Agent) live data).
Contact Identity Matching: Deduplication Strategy
When importing contacts from legacy systems, avoid creating duplicate tbl_persons rows. Use identity fingerprinting (email/phone hash match).
Identity Matching Algorithm (PostgreSQL)
-- Pseudocode (actual implementation: Node.js ETL script)
FOR EACH contact IN legacy_system_contacts:
-- Step 1: Email match (exact, case-insensitive)
existing_person = SELECT person_id FROM tbl_persons
WHERE LOWER(email) = LOWER(contact.email)
AND organisation_id = current_org_id()
LIMIT 1;
IF existing_person FOUND:
-- Update existing person: merge names, add new phone/email to tbl_persons_channels
UPDATE tbl_persons SET
name = COALESCE(name, contact.name),
updated_at = NOW()
WHERE person_id = existing_person.person_id;
-- Insert new channel if not exists
INSERT INTO tbl_persons_channels (person_id, channel_type, channel_value)
VALUES (existing_person.person_id, 'email', contact.email)
ON CONFLICT (person_id, channel_type, channel_value) DO NOTHING;
CONTINUE;
END IF;
-- Step 2: Phone match (normalised E.164 format)
normalised_phone = normalise_e164(contact.phone); -- +447123456789
existing_person = SELECT person_id FROM tbl_persons_channels
WHERE channel_type = 'phone'
AND channel_value = normalised_phone
AND person_id IN (SELECT person_id FROM tbl_persons WHERE organisation_id = current_org_id())
LIMIT 1;
IF existing_person FOUND:
-- Same merge logic as email match
CONTINUE;
END IF;
-- Step 3: No match found — create new person
INSERT INTO tbl_persons (
person_id, organisation_id, name, email, created_at, about
) VALUES (
gen_random_uuid(), current_org_id(), contact.name, contact.email, NOW(), '[SNAPSHOT PENDING]'
);
END FOR;
Repository Code
The live codebase implementation for this specification sits within the following repository folder:
Identity Fingerprint Field (Future: ADR Pattern Reference)
For advanced deduplication (fuzzy name matching, detect "John Smith" vs "J. Smith" as same person), implement identity_fingerprint TEXT column:
-- Example fingerprint (SHA-256 hash of normalised identifiers)
identity_fingerprint = SHA256(
LOWER(TRIM(name)) ||
LOWER(TRIM(email)) ||
normalise_e164(phone)
);
-- Dedup query
SELECT * FROM tbl_persons WHERE identity_fingerprint = '[HASH]';
This pattern allows matching even when email changes (tenant moves, uses new email, but name+phone stay same).
Risk: Two tenants with same name ("John Smith") at different properties get merged into one tbl_persons row because legacy system only provided name, no email/phone.
Mitigation: During Week 2 (snapshot build), run a duplicate detection audit: SELECT name, COUNT(*) FROM tbl_persons GROUP BY name HAVING COUNT(*) > 1; Review common names manually. If duplicate confirmed, split the person row (create two separate person_id entries, re-link conversations).
Data Protection & UK GDPR Compliance
The transition architecture has significant data protection implications. This section is the DPA checklist and GDPR justification for snapshot compression.
Data Processing Agreement (DPA) — BigQuery Sync
When we sync customer's legacy system data to our BigQuery instance, we become a data processor for that data. DPA must cover:
- Purpose Limitation: BigQuery data used ONLY for: (a) snapshot generation, (b) historical reporting, (c) audit trail. NOT for marketing, NOT for cross-customer analytics.
- Data Retention: BigQuery tables retained for 90 days post-cancellation of legacy system. After 90 days, either (a) delete entirely, or (b) transfer to customer's own GCP project (customer becomes controller).
- Sub-Processors: Google Cloud Platform (BigQuery) is a sub-processor. Customer must consent. Include Google's DPA by reference: https://cloud.google.com/terms/data-processing-addendum
- Security Measures: BigQuery dataset encrypted at rest (Google-managed keys). Access restricted to RAIA (Real estate Artificial Intelligence Agent) engineering team (IAM roles). No public access. Audit logs enabled (Cloud Audit Logs).
- Data Subject Rights: If customer receives a GDPR erasure request (Article 17 "right to be forgotten"), RAIA (Real estate Artificial Intelligence Agent) must delete that person's data from BigQuery within 30 days. Document the deletion procedure in DPA.
- Data Breach Notification: If BigQuery access compromised (unauthorised access to customer data), RAIA (Real estate Artificial Intelligence Agent) notifies customer within 72 hours (GDPR Article 33).
GDPR Data-Minimisation: Why Snapshot Compression is a Selling Point
UK GDPR Article 5(1)(c) requires data minimisation: "Personal data shall be adequate, relevant and limited to what is necessary." Full history import violates this. Snapshot compression complies with it. This is a competitive advantage over legacy CRMs.
Legacy Approach (Full Import): Store 500,000 raw emails from 2019-2026. 80% are marketing spam, duplicate threads, or irrelevant. Storage of irrelevant data = GDPR violation (data not "limited to what is necessary").
RAIA (Real estate Artificial Intelligence Agent) Approach (Snapshot Compression): Store 200-word summary per person. Captures "adequate, relevant" context without storing spam, duplicates, or 5-year-old complaint threads that were resolved. Audit-defensible: "We retained only what was necessary for ongoing customer service."
Benefit to Customer: Reduced liability in GDPR audits. Reduced storage costs. Faster GDPR erasure requests (delete 1 snapshot row vs 10,000 message rows).
Records of Processing Activities (ROPA) Update
After cutover (Week 8), update customer's ROPA (GDPR Article 30) to reflect:
- Legacy System Removed: Intercom/Streak no longer a processor. Remove from ROPA.
- RAIA (Real estate Artificial Intelligence Agent) Added: EstateAigents.com Ltd (RAIA) is now the processor for customer communication data.
- BigQuery Retention: Document 90-day BigQuery retention policy in ROPA.
- Snapshot Generation: Document AI-powered snapshot compression as the data-minimisation mechanism.
Legacy System Connectors: Inventory & Build Patterns
Each legacy system requires a custom connector. Below is the inventory of common estate agent systems and their integration complexity.
| Legacy System | Integration Method | Complexity | Estimated Build Time | Notes |
|---|---|---|---|---|
| Intercom | REST API + Webhooks | Medium | 3-5 days | API well-documented. Rate limit: 500 req/min. Pagination: cursor-based. Export: conversations, messages, contacts. |
| Streak CRM | Gmail API + Streak API | Medium-High | 5-7 days | Streak wraps Gmail. Must authenticate both APIs. Export: boxes (pipelines), emails, notes. No official BigQuery connector — build custom. |
| Reapit | Reapit Foundations API | High | 7-10 days | Estate agent property management system (UK-focused). API covers properties, tenancies, landlords. Complex auth (OAuth2). Rate limit: 1000 req/hour. Export: applicants, offers, tenancies, documents. |
| AltoVeco | REST API | Medium | 4-6 days | Student accommodation platform. API covers bookings, payments, maintenance. Export: tenants, bookings, payments, messages. |
| enterprise CRM | enterprise CRM Bulk API 2.0 | Medium | 4-5 days | Enterprise CRM (rare in small estate agencies). Use Bulk API for large exports. Export: leads, opportunities, cases, emails. OAuth2 auth. |
| Gmail (Direct) | Gmail API | Low-Medium | 2-3 days | Reference pattern: 03_technology/09_pipelines/connectors/email/gmail.md. OAuth2 auth. Rate limit: 250 quota units/sec. Export: messages, threads, attachments. |
| WhatsApp Business | WhatsApp Business API | Medium | 3-4 days | Webhook-based (real-time). Backfill via Graph API (last 7 days only). Export: messages, media. Requires Facebook Business Manager access. |
| Twilio (SMS/Voice) | Twilio REST API | Low | 1-2 days | Export: messages, calls, recordings. Pagination: page-based. Rate limit: none (but costs per API call). CSV export available (manual fallback). |
| Slack | Slack Web API | Low | 2-3 days | Reference pattern: 03_technology/09_pipelines/connectors/messaging/slack.md. OAuth2 auth. Export: channels, messages, users. Rate limit: Tier 3 (50+ req/min). |
| automated bank reconciliation gateway | automated bank reconciliation gateway API | Low-Medium | 2-3 days | Rent payment reconciliation. Reference pattern: 03_technology/09_pipelines/connectors/rent_payment/lettspay.md. Export: transactions, mandates, reconciliations. |
| Custom / Legacy DB | Direct SQL Export | High (varies) | 5-14 days | Customer has bespoke Access/MySQL/SQL Server DB. Requires VPN access, schema discovery, custom ETL. High risk: undocumented schema, data quality issues. |
Connector Build Checklist (Per Legacy System)
- Authentication: Obtain API keys / OAuth2 credentials from customer. Test in sandbox/staging environment first.
- Schema Discovery: Run sample API calls, document response schema, map to BigQuery table design.
- Backfill: Recommend 2 years of data (balance between context richness and API cost). Do NOT backfill > 5 years unless customer explicitly requires (diminishing returns, high cost).
- Deduplication: Implement message_id / transaction_id primary key. Query BigQuery for existing IDs before each run.
- Error Handling: Retry transient failures (429, 503) with exponential backoff. Log permanent failures (401, 404) to
tbl_pipeline_runs. - Rate Limiting: Respect API rate limits. Use queueing (BullMQ) if necessary. Monitor API usage dashboards (avoid surprise overage charges).
- Monitoring: Set up Slack alert for pipeline failures (see
tbl_pipeline_runssection above). - Documentation: Write connector README in
03_technology/09_pipelines/connectors/[system]/README.mdfollowing Slack/Gmail/automated bank reconciliation gateway format.
Red Team Analysis: Deltas vs Founder's Skeleton
This section documents the red-team critique of the founder's original transition doctrine (2026-07-17) and the changes/additions made in this specification.
- (1) Continuous sync of legacy data to BigQuery
- (2) Compress histories into person/property snapshots
- (3) Transition period = CONCURRENT systems, hard ceiling 8 WEEKS
- (4) At cutover, move ONLY inbound messaging forward: new emails/whatsapp/texts flow into RAIA; historical lookups go to BigQuery or legacy (read-only)
- (5) Legacy system cancelled at week 8
- (6) Week-by-week skeleton: W1-2 BQ sync + snapshot build + shadow mode; W3-4 GATED; W5-6 per-channel cutover; W7-8 legacy read-only + cancel
Red Team Findings & Deltas
Risk: Staff reply in Intercom while RAIA (Real estate Artificial Intelligence Agent) drafts response in parallel. Tenant receives two conflicting answers. No clear ownership rule.
Delta (Added to Spec): Explicit per-channel ownership rule (§ Cutover section): "From day X, ALL new inbound email lands in RAIA (Real estate Artificial Intelligence Agent) only. Staff reply ONLY via RAIA." Per-conversation cutover rejected (too complex, high split-brain risk). Rollback Gate 2 added: "If split-brain incidents > 2/week, halt cutover planning."
Justification: Founder's skeleton did not specify per-channel vs per-conversation cutover. Per-channel is simpler, more auditable, and reduces staff cognitive load.
Risk: Tenant mid-referencing (week 3 of 6). Email cutover happens. New emails land in RAIA, but deposit hold + ID verification state still in legacy. Workflow state lost.
Delta (Added to Spec): Handover note pattern for actively-open threads (≥ 1 message in last 7 days). Staff manually summarise workflow state in tbl_conversations.human_notes BEFORE cutover. Alternative (advanced): selectively migrate actively-open threads during Week 4 (recommended only for < 50 in-flight threads).
Justification: Founder's skeleton assumed "move ONLY inbound messaging forward" but did not address how to preserve workflow state for in-flight conversations. Handover notes are the pragmatic solution.
Risk: We become a data processor for data originally collected by the legacy system. DPA terms unclear. UK GDPR data-minimisation violated if we sync 5 years of spam.
Delta (Added to Spec): DPA checklist section (§ Data Protection): purpose limitation, 90-day retention, sub-processor consent (Google Cloud), data subject rights procedure, breach notification. GDPR justification section: snapshot compression framed as data-minimisation compliance (selling point vs legacy CRMs).
Justification: Founder's skeleton did not address DPA or GDPR. This is a legal liability if not documented. Snapshot compression is defensible as GDPR-compliant; full history import is not.
Risk: Legacy contacts imported without deduplication. Result: duplicate tbl_persons rows (same tenant appears twice, different UUIDs). Staff confusion, data integrity issues.
Delta (Added to Spec): Identity fingerprint matching algorithm (§ Identity Matching): email match (exact, case-insensitive), phone match (normalised E.164), fingerprint hash for fuzzy matching. Week 2 audit: detect common-name false positives ("John Smith" x2).
Justification: Founder's skeleton referenced "contact dedup" but did not specify the algorithm. Without a documented pattern, every connector would implement dedup differently (inconsistent results).
Risk: Poor AI quality in Week 3, but no trigger to halt forward progress. Team proceeds to cutover despite red flags. Customer experience degrades.
Delta (Added to Spec): Rollback criteria table (§ Rollback Criteria): explicit triggers per week (AI approval rate < 80%, split-brain > 2/week, email delivery < 95%, etc.). If trigger met, halt and revert to prior phase. Emergency 2-week extension allowed (max 10 weeks total), but only for legitimate reasons (mid-audit, regulatory hold).
Justification: Founder's skeleton had week-by-week phases but no abort conditions. Without rollback gates, teams push forward even when quality is poor (sunk cost fallacy). Explicit triggers prevent bad onboardings.
Risk: Sales team promises 8-week onboarding to customer using bespoke legacy system. Engineering discovers system has no API, requires custom SQL export, takes 14 days to build connector. Timeline blows up.
Delta (Added to Spec): Legacy system connector inventory table (§ Connectors): 11 common systems (Intercom, Streak, Reapit, AltoVeco, enterprise CRM, Gmail, WhatsApp, Twilio, Slack, automated bank reconciliation gateway, Custom DB) with integration method, complexity, estimated build time. Connector build checklist (8 steps: auth, schema discovery, backfill, dedup, error handling, rate limiting, monitoring, docs).
Justification: Founder's skeleton assumed connectors exist. This is not true for new customers. Inventory + build time estimates allow sales to qualify leads ("Do you use Intercom or Streak?" → 3-5 day build vs "Custom SQL Server DB" → 10-14 day build).
Added to Spec: BigQuery destination schema table (§ BigQuery Sync): 14 standard columns (message_id, conversation_id, sender_email, sender_phone, body, sent_at, channel, direction, legacy_system, legacy_url, organisation_id, extracted_at). Every connector maps legacy system fields to this schema.
Justification: Founder's skeleton referenced BigQuery sync but did not define the schema. Without a standard schema, snapshot generation pipeline would need custom queries per legacy system (unmaintainable). Standardising the schema allows one snapshot generation script to work across all connectors.
Added to Spec: Roles & Responsibilities section (§ User Guide): 4 roles (RAIA (Real estate Artificial Intelligence Agent) Engineering, Customer Staff, RAIA (Real estate Artificial Intelligence Agent) Customer Success, Data Protection Officer) with explicit responsibilities per role.
Justification: Founder's skeleton did not assign ownership. In practice, this causes "whose job is it to cancel the legacy system?" confusion. Explicit role assignment prevents dropped tasks.
Summary of Deltas
| Founder's Skeleton Element | Delta / Addition | Rationale |
|---|---|---|
| Per-channel cutover (vague) | Explicit ownership rule: "From day X, ALL new email in RAIA (Real estate Artificial Intelligence Agent) only" | Prevents split-brain during concurrent operation |
| In-flight conversations (not addressed) | Handover note pattern for actively-open threads | Preserves workflow state at cutover |
| DPA / GDPR (not addressed) | DPA checklist + GDPR justification section | Legal compliance, frames snapshots as selling point |
| Contact dedup (mentioned, not specified) | Identity fingerprint matching algorithm | Prevents duplicate tbl_persons rows |
| Rollback criteria (not defined) | Per-week rollback gates table | Prevents bad onboardings, explicit abort conditions |
| Connector inventory (assumed to exist) | 11-system inventory + build time estimates | Allows sales qualification, realistic timeline planning |
| BigQuery schema (not defined) | 14-column standard schema | Allows one snapshot script to work across all connectors |
| Roles (not assigned) | 4-role responsibility matrix | Prevents dropped tasks, clear ownership |
Conclusion
The founder's transition doctrine (BigQuery sync + snapshot compression + 8-week ceiling + per-channel cutover) is sound but underspecified. This specification addresses the following gaps:
- Split-brain prevention: Explicit per-channel ownership rules, rollback gates.
- In-flight conversation handling: Handover note pattern for active threads.
- Legal compliance: DPA checklist, GDPR justification, snapshots as data-minimisation selling point.
- Technical precision: Identity matching algorithm, BigQuery schema standard, connector build checklist.
- Operational clarity: Roles & responsibilities, per-week rollback triggers, connector inventory.
This specification is repeatable: use it as the template for every estate agent customer onboarding. Adapt connector build times and rollback thresholds per customer, but do NOT extend the 8-week ceiling without documenting the reason in the DPA.