RAIA™ Specification

Service Design System — Organisation-Level Service Menu, Fee Negotiation & Automated Agreement Dispatch

Organisation-Level Service Menu, Fee Negotiation & Automated Agreement Dispatch — Two Paperclip agents, jurisdiction-aware (UK RRA vs Thailand PDPA), HelloSign e-signature integration.

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

Organisation-Level Service Menu, Fee Negotiation & Automated Agreement Dispatch — Two Paperclip agents, jurisdiction-aware (UK RRA vs Thailand PDPA), HelloSign e-signature integration.

🧩 Section A: In Plain English

Service Design System

Think of this system as an organisation-level service menu — what you sell as an agency, and at what standard price. Every agency defines their own catalogue of services with standard fees, negotiates per-landlord discounts (with documented reasons), and automatically dispatches a legally compliant service agreement via HelloSign e-signature.

SERVICE DESIGN PIPELINE — CATALOGUE → NEGOTIATION → AGREEMENT → COMPLIANCE 1. SERVICE CATALOGUE 📋 Define Services Org defines what they sell Standard fees per jurisdiction Fee types: % rent, fixed, etc. 🏢 Organisation Settings 2. FEE NEGOTIATION 💬 Per-Landlord Deals Landlord selects services Discount negotiation HITL gate if >20% discount 🤝 ServiceOnboardingAgent 3. AGREEMENT SIGNING ✍️ HelloSign Dispatch Auto-generate agreement Send for e-signature Monitor signing status 📄 Signed PDF → GCS 4. COMPLIANCE 🛡️ AML/KYC Checks Jurisdiction-aware Sumsub / Kamma / CH HITL gate on failure 🔒 ComplianceOnboardingAgent Two Paperclip agents run in parallel: ServiceOnboardingAgent (1→2→3) and ComplianceOnboardingAgent (4) — signing gated on both passing. UK RRA fee transparency rules for GB · Thailand PDPA for TH · Jurisdiction-agnostic schema design Catalogue / Compliance Negotiation Agreement Pipeline flow → Agent-managed

Figure 1: Service Design Pipeline — from catalogue definition through fee negotiation, agreement signing, and compliance checks.

Service Design System

Organisation-Level Service Menu, Fee Negotiation, and Automated Agreement Dispatch — Two Paperclip agents (ServiceOnboardingAgent + ComplianceOnboardingAgent), jurisdiction-aware, HelloSign e-signature integration.

Service Catalogue Fee Negotiation HelloSign Paperclip Agents

Section A What Is the Service Design System?

💡 In Plain English

Think of this system as a restaurant menu for your agency — you define what services you offer (tenant finder, property management, rent collection) and at what standard price. When a landlord signs up, the system presents the menu, lets them pick services, negotiates fees if needed, and automatically generates a legally compliant service agreement via HelloSign e-signature. Two Paperclip agents handle the entire workflow: one walks the landlord through service selection, another runs AML/KYC checks in parallel. The whole thing is jurisdiction-aware — UK Renters Rights Act (RRA) rules for GB, PDPA for Thailand.

The Service Design System replaces the old one-off line-item approach with a repeatable, audit-trailed, legally compliant onboarding process that works for any jurisdiction, any agency, any landlord. No more manual PDFs, no more guessing what the standard fee is, no more compliance gaps.

Key Capabilities

📋 Catalogue Management
  • Define services per jurisdiction (GB, TH)
  • Standard fees with multiple types (% rent, fixed monthly, % of sale)
  • RRA-compliant fee transparency notes
  • Active/inactive, effective dates, sort order
🤝 Fee Negotiation
  • Per-landlord discount with documented reason
  • HITL gate if discount >20% of standard
  • Draft email preview before sending
  • Full audit trail of all negotiations
✍️ Automated Agreement Dispatch
  • HelloSign e-signature integration
  • Jurisdiction-specific templates
  • Signed PDF stored in GCS
  • Webhook callback monitoring
🛡️ Compliance-First
  • Parallel AML/KYC checks
  • Jurisdiction-aware rules engine
  • HITL gate on compliance failure
  • Two-agent orchestration pattern

Section B Installation & Setup

Prerequisites

⚠️
Database Schema Required

This system requires running migrations V300–V306. Do not skip phases — the schema must exist before any agent or UI can operate.

Before setting up the Service Design System, ensure you have:

  • Access to the RAIA (Real estate Artificial Intelligence Agent) database (db_raia)
  • Supabase project with RLS enabled
  • HelloSign API key (configured in tbl_organisations_attributes)
  • Node.js v22+ for Paperclip agent runtime
  • Sumsub / Kamma / Companies House API keys for compliance checks

Setup Steps

  1. 1
    Run Database Migrations

    Execute V300 (schema creation) then V301 (seed data) in order:

    bash migrate.sh V300__service_design_schema.sql
    bash migrate.sh V301__seed_service_catalog.sql
  2. 2
    Configure HelloSign Templates

    Create HelloSign templates in the web app (GB + TH) and register them:

    INSERT INTO tbl_hello_sign_templates
      (organisation_id, jurisdiction, template_name,
       hello_sign_template_id, service_type, field_mapping)
    VALUES
      ('[org_id]', 'GB', 'GB Service Agreement',
       '[hellosign_template_id]', 'property_management',
       '{"landlord_name": "signer1", "fee_percentage": "text1"}');
  3. 3
    Configure API Keys

    Add HelloSign keys to tbl_organisations_attributes:

    UPDATE tbl_organisations_attributes
    SET hello_sign_api_key = '[your_key]',
        hello_sign_client_id = '[your_client_id]'
    WHERE organisation_id = '[org_id]';
  4. 4
    Define Service Catalogue

    Add your services to the catalogue table. Each service needs a name, description, standard fee, and jurisdiction:

    INSERT INTO tbl_service_catalog
      (organisation_id, jurisdiction, service_name,
       service_description, service_type, standard_fee_type,
       standard_fee_value, standard_fee_currency, standard_fee_label)
    VALUES
      ('[org_id]', 'GB', 'Tenant Finder',
       'Find and vet tenants for your property',
       'tenant_finder', 'percent_of_rent',
       8.4, 'GBP', '8.4% of monthly rent');
  5. 5
    Deploy Paperclip Agents

    Deploy the ServiceOnboardingAgent and ComplianceOnboardingAgent. Both are triggered by the same event (new landlord + asset) and run in parallel. The agreement signing is gated on both passing.

    # Deploy ServiceOnboardingAgent
    paperclip deploy agents/service-onboarding-agent.yaml
    
    # Deploy ComplianceOnboardingAgent
    paperclip deploy agents/compliance-onboarding-agent.yaml
  6. 6
    Configure HelloSign Webhook

    Set up the HelloSign webhook endpoint to receive signature events:

    # Register webhook in HelloSign dashboard
    # Callback URL: https://[your-domain]/api/webhooks/hellosign
    
    # Verify the webhook endpoint is reachable
    curl -X POST https://[your-domain]/api/webhooks/hellosign \
      -H "Content-Type: application/json" \
      -d '{"test": true}'
  7. 7
    Enable Service Design UI

    Add the Service Design tab to your Organisation Settings page. The tab appears alongside General, Branding, Billing, Compliance, and Team.

Verification

Verify the system is working correctly:

# Check service catalogue is accessible
SELECT * FROM tbl_service_catalog WHERE organisation_id = '[org_id]';

# Test HelloSign template fetching
curl -s "https://api.hellosign.com/v3/template/list" \
  -u "[api_key]:"

# Verify agents are listening
paperclip status agents/service-onboarding-agent
✅ Quick Start for New Organisations

Use the "Quick Start" button in the Service Design tab to populate default services based on jurisdiction. Sovereign Node's 6 services for GB and Beyond360's 2 services for TH are available as seed templates. The default set can be edited later.

Operation

Once set up, the system runs automatically:

  • ServiceOnboardingAgent — triggered when a new landlord + asset is created. Walks the landlord through service selection, negotiates fees, dispatches the HelloSign agreement.
  • ComplianceOnboardingAgent — triggered in parallel. Runs AML/KYC checks per jurisdiction. Blocks signing if compliance fails.
  • HelloSign Webhook — on signature completion, downloads the signed PDF to GCS, creates tbl_documents row, updates tbl_service_agreements, and activates services.
  • Negotiation Expiry — negotiations auto-expire after 30 days if the agreement is never signed. A cron/agent check handles this.

🔒 Developer-Only Section — Architecture, Data Model & Troubleshooting

Repository Code

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

Section C Architecture & Data Model

SERVICE DESIGN SYSTEM — ENTITY RELATIONSHIP & AGENT ARCHITECTURE DATABASE LAYER — 4 New Tables tbl_service_catalog Org service definitions per jurisdiction tbl_service_negotiations Per-landlord fee negotiation records tbl_hello_sign_templates Template registry per org + jurisdiction tbl_compliance_checks AML/KYC check results + risk levels ALTER: tbl_service_agreements +4 cols AGENT LAYER — 2 Paperclip Agents 🤖 ServiceOnboardingAgent 1. Discovery → 2. Selection 3. Fee Agreement → 4. HITL Gate 5. Hellosign Dispatch → 6. Monitor 7. Post-Signing → 8. Notify 🛡️ ComplianceOnboardingAgent 1. Jurisdiction Detection 2. Check Execution (Sumsub/Kamma/CH) 3. HITL Gate → 4. Gate Signal Orchestrator spawns both agents in parallel INTEGRATION LAYER — External APIs ✍️ HelloSign API Template-based signature requests Webhook: signature_request_signed 🛂 Sumsub / Kamma / CH AML + sanctions + licence checks ☁️ Google Cloud Storage Signed PDFs stored in GCS bucket 📧 Email Dispatch Welcome messages + notifications Three-layer architecture: Database → Agents → External APIs. Agents read/write DB, call external APIs, and emit gate signals. RLS policies on every new table · All external API calls logged · HITL gates at both negotiation and compliance boundaries Database tables Paperclip agents External APIs Data flow → HITL gate boundary

Figure 2: Three-Layer Architecture — Database tables, Paperclip agents, and external API integrations with HITL gates at critical boundaries.

Entity Relationships

Four new tables, one ALTER on an existing table. The core relationship chain is:

tbl_organisations
  │
  ├─── tbl_service_catalog (org defines their services)
  │      │
  │      ├─── tbl_service_negotiations (per-landlord fee negotiation)
  │      │      │
  │      │      └─── tbl_service_agreements (resulting contract + signed PDF)
  │      │             │
  │      │             ├─── tbl_service_agreement_assets (assets covered)
  │      │             │
  │      │             └─── tbl_documents (signed PDF via HelloSign)
  │      │
  │      └─── tbl_hello_sign_templates (per-org template registry)
  │
  ├─── tbl_charges_pricing (org-level operational fee catalog)
  │
  ├─── tbl_compliance_checks (ComplianceOnboardingAgent results)
  │
  └─── tbl_organisations_attributes (hello_sign keys, rra flags)
      

DDL Reference

-- tbl_service_catalog
CREATE TABLE tbl_service_catalog (
    catalog_id          UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    organisation_id     UUID NOT NULL REFERENCES tbl_organisations(organisation_id),
    jurisdiction        CHAR(2) NOT NULL CHECK (jurisdiction IN ('GB', 'TH')),
    service_name        TEXT NOT NULL,
    service_description TEXT,
    service_type        TEXT NOT NULL,
    service_bundle      TEXT,
    is_bundle           BOOLEAN NOT NULL DEFAULT false,
    standard_fee_type   TEXT NOT NULL CHECK (standard_fee_type IN ('percent_of_rent','fixed_monthly','fixed_per_let','percent_of_sale','custom')),
    standard_fee_value  NUMERIC(12,2) NOT NULL,
    standard_fee_currency CHAR(3) NOT NULL DEFAULT 'GBP',
    standard_fee_label  TEXT,
    additional_fee_ids  UUID[] DEFAULT '{}',
    fee_transparency_notes TEXT,
    rra_exempt          BOOLEAN NOT NULL DEFAULT false,
    is_active           BOOLEAN NOT NULL DEFAULT true,
    effective_from      DATE,
    effective_until     DATE,
    sort_order          INTEGER NOT NULL DEFAULT 0,
    created_at          TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at          TIMESTAMPTZ NOT NULL DEFAULT now()
);

-- tbl_service_negotiations
CREATE TABLE tbl_service_negotiations (
    negotiation_id      UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    organisation_id     UUID NOT NULL REFERENCES tbl_organisations(organisation_id),
    catalog_id          UUID NOT NULL REFERENCES tbl_service_catalog(catalog_id),
    person_id           UUID NOT NULL REFERENCES tbl_persons(person_id),
    agreed_fee_type     TEXT NOT NULL,
    agreed_fee_value    NUMERIC(12,2) NOT NULL,
    agreed_fee_currency CHAR(3) NOT NULL DEFAULT 'GBP',
    agreed_fee_label    TEXT,
    status              TEXT NOT NULL DEFAULT 'pending' CHECK (status IN ('pending','accepted','declined','expired','superseded')),
    discount_reason     TEXT,
    discount_note       TEXT,
    negotiated_by       UUID REFERENCES tbl_profiles(profile_id),
    negotiated_at       TIMESTAMPTZ,
    agreement_id        UUID REFERENCES tbl_service_agreements(agreement_id),
    expires_at          TIMESTAMPTZ,
    created_at          TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at          TIMESTAMPTZ NOT NULL DEFAULT now()
);

-- tbl_hello_sign_templates
CREATE TABLE tbl_hello_sign_templates (
    template_id         UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    organisation_id     UUID NOT NULL REFERENCES tbl_organisations(organisation_id),
    jurisdiction        CHAR(2) NOT NULL,
    template_name       TEXT NOT NULL,
    hello_sign_template_id TEXT NOT NULL,
    service_type        TEXT,
    is_active           BOOLEAN NOT NULL DEFAULT true,
    version             INTEGER NOT NULL DEFAULT 1,
    signature_roles     TEXT[] NOT NULL DEFAULT '{landlord,agent}',
    field_mapping       JSONB NOT NULL DEFAULT '{}',
    created_at          TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at          TIMESTAMPTZ NOT NULL DEFAULT now()
);

-- tbl_compliance_checks
CREATE TABLE tbl_compliance_checks (
    check_id            UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    organisation_id     UUID NOT NULL REFERENCES tbl_organisations(organisation_id),
    person_id           UUID NOT NULL REFERENCES tbl_persons(person_id),
    jurisdiction        CHAR(2) NOT NULL,
    check_type          TEXT NOT NULL,
    check_status        TEXT NOT NULL DEFAULT 'pending' CHECK (check_status IN ('pending','in_progress','passed','failed','referred')),
    check_provider      TEXT,
    provider_ref        TEXT,
    provider_result     JSONB,
    risk_level          TEXT CHECK (risk_level IN ('low','medium','high','critical')),
    risk_factors        TEXT[],
    reviewed_by         UUID REFERENCES tbl_profiles(profile_id),
    reviewed_at         TIMESTAMPTZ,
    review_notes        TEXT,
    created_at          TIMESTAMPTZ NOT NULL DEFAULT now(),
    completed_at        TIMESTAMPTZ
);
      

Jurisdiction Rules

Rule UK (GB) — RRA Thailand (TH) — PDPA
Fee Transparency Mandatory. fee_transparency_notes must be non-empty for all non-exempt fees. Recommended but not mandatory.
Agreed vs Standard Fee Agreed ≤ Standard. System enforces that agreed_fee_value cannot exceed standard_fee_value. No cap. Commercial agency rules apply.
Discount Reason Required when agreed_fee_value < standard_fee_value. Optional. No legal requirement for discount documentation.
Currency GBP (default). % of rent or fixed monthly. THB (default). Thai Baht as primary display currency.
Compliance Checks Sumsub AML + Kamma licence check + Companies House (for corporate landlords). ID document verification + PEP screening + basic AML.

Red Team Findings

🔴
Critical: Fee Double-Counting via additional_fee_ids

tbl_service_catalog.additional_fee_ids references tbl_charges_pricing via a UUID array. When a landlord selects multiple services, the same gas safety fee could appear as an "additional fee" on multiple service rows, leading to double-counting. Mitigation: Treat additional_fee_ids as a suggestion — the UI should show a warning when overlapping additional fees are selected.

⚠️
High: Negotiation vs Agreement Lifecycle

Negotiation status 'accepted' while agreement is 'pre_signature' (never signed). Auto-expire after 30 days if unsigned.

⚠️
High: HelloSign Single Point of Failure

Entire signing flow depends on HelloSign API availability. Add fallback_method column ('hellosign' | 'manual_upload' | 'document_generation').

ℹ
Medium: Agent Concurrency

ServiceOnboardingAgent and ComplianceOnboardingAgent run in parallel. The "Send via HelloSign" button must be disabled until compliance check passes.

ℹ
Medium: Cold-Start for New Orgs

New organisations have an empty catalogue. Provide a "Quick Start" button with default services per jurisdiction.

Troubleshooting

Issue Likely Cause Resolution
HelloSign template not found Template ID not registered in tbl_hello_sign_templates Verify the template exists in HelloSign dashboard and the ID matches
"Send via HelloSign" button disabled Compliance check not passed Check tbl_compliance_checks for the person_id — look for check_status = 'passed'
Negotiation stuck at 'pending' HITL gate triggered (discount >20%) Staff must review and approve the negotiation in the HITL queue
Signed PDF not appearing in GCS HelloSign webhook not configured or failed Verify webhook endpoint is reachable and HelloSign API key is valid
RLS policy violation New tables lack RLS policies Add RLS policies following the existing pattern: organisation_id = (SELECT organisation_id FROM tbl_profiles WHERE id = auth.uid())

© 2026 EstateAigents.com Ltd. Company No. 07801820. All Rights Reserved.

Service Design System · ← Back to RAIA (Real estate Artificial Intelligence Agent) Documentation