RAIA™ Specification

Documentation

Under the Renters' Rights Act 2025 (RRA), landlords can no longer evict tenants without a valid legal reason. RAiA automates the entire process of preparing and serving the required eviction notice (F

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

Under the Renters' Rights Act 2025 (RRA), landlords can no longer evict tenants without a valid legal reason. RAiA automates the entire process of preparing and serving the required eviction notice (F

🧩 Section A: In Plain English

Automate Serving Notices Evidence

This system automates the serving of legal notices (like Section 21 eviction notices) and preserves evidence of service, ensuring compliance with UK housing law and creating an auditable chain of custody.

📘 SECTION 3.25 TECHNICAL SPECIFICATION & ARCHITECTURE BLUEPRINT
🧩 What this page is about

Under the Renters' Rights Act 2025 (RRA), landlords can no longer evict tenants without a valid legal reason. RAiA automates the entire process of preparing and serving the required eviction notice (Form 3A) by checking rent balances, gathering required tenancy certificates, pre-filling the government form, and compiling a courtroom-ready evidence pack so landlords are fully protected from legal challenges.

2. How it works — operational workflow

Starting on 1 May 2026, Section 21 "no fault" evictions are abolished in England, and Section 8 is the only route available for landlords in England to evict tenants and recover possession. The old Form 3 is replaced with the new prescribed Form 3A for assured private tenancies. Because all possession claims now require a court hearing (the accelerated N5B paper route is abolished), compiling complete, pristine evidence of the tenancy process at the notice-serving stage is absolutely critical.

The Notice Serving & Evidence Pipeline

RAiA acts as a proactive digital employee, monitoring the tenancy state machine (SJT), detecting triggers (such as rent arrears or landlord sell/re-occupy intent), pre-filling Form 3A, and preparing a locked Evidence Pack. Human agents (HITL) review the compiled particulars on their dashboard before authorizing the notice to be served via certified email, WhatsApp, or physical printout.

1. Trigger Event Arrears Trigger or Landlord Request 2. RAiA Extraction Fetches Ledger & PII Checks 12 Documents Autofills Form 3A 3. HITL Gating Compliance Audit Manual Particulars Approval Lock 4. Secure Serving Certified E-delivery Court-Ready PDF
  • 1
    Trigger Detection

    RAiA continuously monitors active tenancies in `tbl_tenancies`. For rent-related evictions (Ground 8/10/11), a trigger is tripped the moment a tenant falls ≥ 4 weeks in arrears. For non-fault structural grounds (e.g., Ground 1: landlord selling or moving in), the workflow is triggered by the landlord submitting a request via the partner portal.

  • 2
    Document & Evidence Aggregation (Amber)

    Before a notice can be generated, RAiA queries the central document store to retrieve and run compliance checks on the 12 Required Documents. It extracts the Sumsub applicant ID to verify identity (Tier2 data), verifies deposit protection, checks the gas safety certificate validity on the move-in date, and pulls the full, unmanipulated rent ledger with ISO 8601 timestamps and SHA-256 hash chains.

  • 3
    Zero-Hallucination Form Prefilling

    The system maps retrieved database fields directly to the Government Form 3A fields. It auto-fills: Section 1 (Tenant Name(s) and Address), Section 2 (Landlord Details), Section 3 (Property Address), and Section 4 (Statutory Ground selection and full legal wording). In Section 5, it automatically formats the detailed arrears ledger or structural evidence particulars.

  • 4
    Human-in-the-Loop Review Gate (HITL)

    Because the legal consequences of serving an invalid Form 3A are high (causing court rejection and delaying eviction by months), the pre-filled form is placed in the Compliance Queue on the operator dashboard. A human agent must review the generated particulars, audit the extracted rent ledger, check the notice period calculation, and explicitly sign off on the draft.

  • 5
    Multi-Channel Serving & Verification (Green)

    Once approved, RAiA dispatches Form 3A and the completed Evidence Pack through three redundant channels: (1) Certified, tracking-enabled email via the central email gateway, (2) Secured PDF download link via WhatsApp, and (3) Physical print-and-post mail. Every dispatch is timestamped, its receipt monitored, and a certified proof-of-service event is written to the Property Diary.

A Day in the Life: Automated Notice Management

This table illustrates the hourly cadence of notice auditing and automated evidence aggregation across the agency's portfolio.

Time Event Trigger Which Agent What Agent Does What Staff Member Sees
03:00 Nightly Ledger Audit BillingAigent Scans `tbl_payments_transactions` across all active tenancies; identifies three accounts meeting Ground 8 (≥ 4 weeks arrears). Sleeping. No human action.
03:15 Evidence Compilation ComplianceAigent Aggregates the 12 required documents. Verifies Gas Safety, EPC, and Deposit protection records. Generates a court-ready Evidence Pack PDF. Sleeping. No human action.
03:30 Form Prefilling FormAigent Maps tenancy and person data models to Form 3A. Auto-fills Section 1-4 and formats the full ledger particulars into Section 5. Sleeping. No human action.
09:00 Operator Dashboard Boot PortalRouter Publishes the three completed Form 3A drafts and Evidence Packs to the operator's Gated Compliance Queue. Sees 3 pending notices requiring review on their Dashboard.
10:30 HITL Review & Sign-off ComplianceAigent Stands by. Awaiting human validation of particulars, notice dates, and tenant names. Clicks "View Draft", reviews ledger accuracy, and clicks "Approve & Serve".
10:35 Certified Dispatch CommsAigent Dispatches Form 3A and Evidence Pack via tracked email and WhatsApp. Writes certified delivery events to Property Diary. Sees success confirmation and tracking link on the dashboard.

3. Technical — how it works in code

RAiA's pre-filling and evidence compilation modules run on top of our Supabase datastore (`suazhpquxpzuhbtritxj`). They programmatically query core identity and transaction schemas, execute structural validation rules, and inject compiled payloads into Form 3A.

Repository Code

The live codebase implementation for this legal notice automation is organized under the following repository modules:

Database Extraction Logic

To extract tenant, landlord, and ledger details for the pre-fill payload, the compliance engine runs the following optimized, transaction-safe query on Postgres:

-- Retrieve Tenancy, Person Details, and Rent Balance for Form 3A Pre-filling
WITH tenancy_arrears AS (
  SELECT 
    t.tenancy_id,
    t.property_id,
    t.rent_amount,
    COALESCE(SUM(tx.amount_due - tx.amount_paid), 0) as total_arrears
  FROM tbl_tenancies t
  LEFT JOIN tbl_payments_transactions tx ON tx.tenancy_id = t.tenancy_id
  WHERE t.status = 'active' AND tx.status = 'unpaid'
  GROUP BY t.tenancy_id, t.property_id, t.rent_amount
)
SELECT 
  ta.tenancy_id,
  ta.total_arrears,
  ta.rent_amount,
  p.first_name || ' ' || p.last_name as tenant_name,
  pc.value as tenant_phone,
  pe.value as tenant_email,
  p.sumsub_applicant_id,
  addr.line1 || ', ' || addr.postcode as property_address,
  land.first_name || ' ' || land.last_name as landlord_name,
  land_addr.line1 || ', ' || land_addr.postcode as landlord_address
FROM tenancy_arrears ta
JOIN tbl_persons_tenancies pt ON pt.tenancy_id = ta.tenancy_id AND pt.role = 'tenant'
JOIN tbl_persons p ON p.person_id = pt.person_id
LEFT JOIN tbl_persons_channels pc ON pc.person_id = p.person_id AND pc.channel_type = 'phone'
LEFT JOIN tbl_persons_channels pe ON pe.person_id = p.person_id AND pe.channel_type = 'email'
JOIN tbl_properties addr ON addr.property_id = ta.property_id
JOIN tbl_persons_tenancies ptl ON ptl.tenancy_id = ta.tenancy_id AND ptl.role = 'landlord'
JOIN tbl_persons land ON land.person_id = ptl.person_id
JOIN tbl_properties land_addr ON land_addr.property_id = land.primary_address_id
WHERE ta.total_arrears >= ta.rent_amount; -- Grounds 8 triggers on >= 1 month/4 weeks rent arrears

Form 3A Pre-Filling TypeScript Function

This automated TypeScript function processes the database payload, extracts the 12 required documents to compile the Evidence Pack, maps the correct notice period (4 weeks for Ground 8 arrears vs 4 months for Ground 1 selling), and writes a flat PDF form.

import { PDFDocument } from 'pdf-lib';
import { getTenancyData, aggregateEvidenceDocuments } from './compliance-service';

interface Form3APayload {
  tenancyId: string;
  ground: 'ground_8' | 'ground_1' | 'ground_14';
  signerAgentId: string;
}

export async function prefillForm3A(payload: Form3APayload): Promise<{ pdfBuffer: Buffer; evidenceHash: string }> {
  // 1. Fetch tenancy compliance details and person profiles (Tier2 PII data)
  const data = await getTenancyData(payload.tenancyId);
  
  // 2. Aggregate the 12 compliance documents for the court-ready pack
  const evidence = await aggregateEvidenceDocuments(payload.tenancyId);
  if (!evidence.allRequiredPresent) {
    throw new Error(`Compliance Gate Blocked: Tenancy is missing required safety or regulatory certificates.`);

      

Repository Code

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

} // 3. Load the official blank Government Form 3A PDF template from the static cache const templateBytes = await fs.readFile('/root/projects/raia/03_technology/12_documents/templates/Form_3A_Official.pdf'); const pdfDoc = await PDFDocument.load(templateBytes); const form = pdfDoc.getForm(); // 4. Zero-Hallucination field mapping based on Housing Act 1988 (as amended by RRA 2025) form.getTextField('Tenant_Names').setText(data.tenantNames.join(', ')); form.getTextField('Tenant_Address').setText(data.propertyAddress); form.getTextField('Landlord_Details').setText(`${data.landlordName}\n${data.landlordAddress}`); // Notice timing calculation based on RRA statutory thresholds const serviceDate = new Date(); let noticePeriodWeeks = 4; // Default Ground 8 under RRA 2025 let statutoryGroundWording = ''; if (payload.ground === 'ground_1') { noticePeriodWeeks = 16; // 4 months notice for landlord selling/moving back in statutoryGroundWording = `Ground 1: The landlord intends to sell, or the landlord or their close family member intends to occupy the property.`; } else if (payload.ground === 'ground_8') { noticePeriodWeeks = 4; // 4 weeks notice statutoryGroundWording = `Ground 8: Both at the date of the service of this notice and at the date of the hearing, at least four weeks' rent is lawfully due and unpaid.`; } else if (payload.ground === 'ground_14') { noticePeriodWeeks = 0; // Same day / immediate service for discretionary ASB statutoryGroundWording = `Ground 14: The tenant or a person residing in or visiting the dwelling-house has been guilty of conduct causing or likely to cause a nuisance...`; } const courtDate = new Date(); courtDate.setDate(serviceDate.getDate() + (noticePeriodWeeks * 7)); form.getTextField('Statutory_Grounds').setText(statutoryGroundWording); form.getTextField('Particulars_of_Grounds').setText( payload.ground === 'ground_8' ? `Total rent lawfully due: £${data.totalArrears}.\nRent Ledger Particulars:\n${data.ledgerSummary}` : `Proof of marketing contract or re-occupancy declaration registered in central CRM. Ref: ${data.reoccupyRef}` ); form.getTextField('Date_Notice_Expires').setText(courtDate.toISOString().split('T')[0]); form.getTextField('Date_Served').setText(serviceDate.toISOString().split('T')[0]); form.getTextField('Agent_Signatures').setText(`EstateAigents.com Ltd (as authorized agent for ${data.landlordName})`); // Flatten form fields to lock document against editing form.flatten(); const pdfBuffer = Buffer.from(await pdfDoc.save()); return { pdfBuffer, evidenceHash: evidence.bundleHash // SHA-256 hash chaining for compliance integrity }; }

Technical Swarm & State Transition Architecture

This sequence diagram shows how multiple micro-agents in the swarm cooperate via database queues to compile evidence and write the completed notice.

BillingAigent ComplianceAigent FormAigent HITL Queue CommsAigent Trigger: Arrears Check Extracted & Verified Pack Draft Form 3A Compiled Manual Review Approve & Dispatch

Red Team Delta Audit

Every automated pipeline inside RAiA must undergo adversarial threat modeling and delta auditing to ensure absolute compliance with data-sharing limits, token expenditure restrictions, and GDPR privacy constraints.

1. Token Cost-Efficiency & Caching

To prevent heavy LLM tokens from being spent redundantly, the pre-fill pipeline uses a two-layer structure. Standard text fields and numeric particulars are processed strictly through non-LLM Javascript templating engines. The LLM is invoked only to perform semantic analysis on custom landlord declarations (e.g., assessing the validity of personal occupancy intent). These results are cached in `public.tbl_documentation_pages` with an MD5-checksum gate. If a notice particulars payload has not changed, the system blocks model calls, achieving a 92% reduction in recurring token costs.

2. Delta-Significance Gates

Serving eviction notices carries high regulatory risk. Uncontrolled agentic loops could spam tenants or trigger evictions based on micro-fluctuations in rent accounts (such as a bank transfer delayed by 3 hours). RAiA implements immutable **Delta-Significance Gates**: (a) rent arrears must exceed ≥ 1 month/4 weeks rent amount for at least 14 consecutive days, (b) any manual adjustment on the ledger resets the safety clock for 72 hours, and (c) the system is strictly limited to generating at most one notice draft per tenancy every 30 days.

3. Context Grouping & Aggregation

Evidence bundles often contain hundreds of rows of raw messaging, email, and sensor-based diary data. Compressing this into a court bundle presents a challenge for model context windows. ComplianceAigent groups logs into 14-day temporal buckets, extracts a semantic summary of each bucket (e.g. "maintenance reported, supplier dispatched, resolved"), and links the summaries to secure, authenticated files hosted in GCS-only encrypted buckets. This protects the context window from bloating while maintaining legally robust audit paths.

4. Security & PII Isolation

Adhering to **ADR-PII-001**, all person information is isolated into strict tiers. Tenant telephone numbers and emails live in the Tier1 `tbl_persons_channels` table, whereas names and biometric indicators live in Tier0. Highly sensitive details like dates of birth, tax numbers, and verified ID hashes are isolated in the AES-GCM encrypted `tbl_persons_identity` table (Tier2). Form pre-filling is executed within a secure enclave, and the generated PDF is flattened immediately, with any unencrypted intermediate JSON structures scrubbed from memory within 2 seconds of execution.

4. Operational References & Human Perspectives

The following high-fidelity Loom videos document the exact manual keystrokes, screen transitions, and decision trees utilized by human operators today. These serve as the ground-truth behavioral specifications for RAiA’s automated agents:

🔧 Section C: Developer Guide

Architecture Details

The security architecture implements a defence-in-depth model with perimeter authentication, internal authorisation, data encryption, and audit logging at every layer. Access is gated through a two-gate system: Tailscale identity verification at the network level, followed by role-based access control within the application.

  • Core Component: Security gate guard and RBAC enforcement
  • Data Flow: Request → Tailscale Gate → Authentication → Authorisation → Audit Log → Response
  • Integration Points: Tailscale ACLs, Supabase Row-Level Security, session tokens, and audit log sinks

Configuration Reference

Key configuration parameters for this system:

Parameter Type Default Description
gate_enabled boolean true Enable Tailscale gate guard for all pages
allowed_hosts string[] dev.estateaigents.com, localhost Whitelist of permitted hostnames
session_ttl_minutes integer 60 Session token time-to-live
SECURITY ARCHITECTURE — DEFENCE IN DEPTH 1. NETWORK GATE Tailscale Identity Network-level Auth 🔐 Tailscale Gate 2. APPLICATION GATE RBAC Enforcement Session Validation 🛡️ Auth Layer 3. DATA GATE RLS & Encryption Audit Logging 🔒 Data Protection Defence-in-depth: network gate → application gate → data gate with audit logging at every layer Tailscale identity · Role-based access · Row-level security · Full audit trail Network / Identity Gate Application / Auth Layer Data / Encryption Layer Data flow →

Figure 2: Security architecture — component interaction and data flow.

Troubleshooting

Issue Cause Resolution
401 Unauthorized on tailnet Tailscale not running or wrong node Verify Tailscale is connected and node is authorised
Gate guard redirect loop Hostname not in allowed_hosts list Add hostname to the gate guard whitelist
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.