RAIA™ Specification

Hierarchical Loops & Polymorphic Comms

This spec documents the real-time visual loops showing background agent processes, pending human gates, and chronological action events in a centralized workspace.

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

This spec documents the real-time visual loops showing background agent processes, pending human gates, and chronological action events in a centralized workspace.

🧩 Section A: In Plain English

Hierarchical Loops & Polymorphic Comms

Imagine a team of specialized assistants, each with specific expertise, working together 24/7. They handle routine tasks automatically, only asking for human input when facing truly important decisions.

Sovereign Architecture Spec

Hierarchical Loops & Polymorphic Comms

Deconstructing RAIA™ (Real estate Artificial Intelligence Agent) OS into dedicated, nested state-machine loops at each tier of the Rental Pyramid, and abstracting all message deliveries into a single **Polymorphic Comms Engine** to achieve high-leverage agentic design.

1. The 3-Tier Operational Loops

The Rental Pyramid State Machines

Each layer of the pyramid runs its own dedicated background loop. An upper layer loop **cannot execute** until all invariants of the lower loops are fully satisfied and locked in.

T1: PEAK

Owner Onboarding Loop

Verifies land registry titles and completes KYC/AML checks for beneficial owners before any property registration occurs.

📌 Target: Landlord / SPV
📂 Required Docs: ID, MSA, Title Deed
⚙️ Action: Sumsub Verification Hook
T2: CORE

Physical Asset Readiness

Manages physical property readiness—securing keys, safety certificates (EPC, EICR, CP12), and municipal Selective/HMO licenses.

📌 Target: Asset / Contractor
📂 Required Docs: Keys, Safety Certs
⚙️ Action: Automated Surveyor Booking
T3: BASE

Tenancy Lifecycle Loop

Manages signed ASTs, deposit protections, condition inventories, rent guarantee insurance (RGI), and monthly rent ledger sync.

📌 Target: Tenant / Occupant
📂 Required Docs: AST, Deposit, Inventory
⚙️ Action: MyDeposits & automated bank reconciliation gateway Sync

2. The Polymorphic Comms Engine

Object-Oriented Agent Skills

Instead of duplicating messaging logic inside individual state machines, RAIA™ (Real estate Artificial Intelligence Agent) abstracts all communication into a single **Polymorphic Comms Engine** (or comms-delivery-engine skill). The loop simply passes the recipient and template; the comms engine dynamically resolves transport and tracking:

1. Target Person ID
person_id: "usr_9024c81"
Resolves to: Mi Song (Landlord)
2. Message Template
template: "epc_expiry_consent"
Params: {cost: "£79", date: "June 26"}

Repository Code

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

ex-col items-center justify-center">
Comms Engine Polymorphic Skill
Looks up preferred channels & active slots in tbl_persons_comms_stats.
💬
WhatsApp (Preferred)
Delivered via Twilio API
92% Reach
📧
Email (Secondary)
Delivered via SendGrid API
Fallback
📱
SMS / Text (Alert)
Delivered via Twilio SMS
Fallback

3. Unified Object-Oriented Code Specification

By modularizing our skills, we decouple business logic from transport details. Here is how our loops cleanly invoke the Polymorphic Comms skill in the code:

TypeScript Class / Design
class CommsDeliveryEngine {
  private async getPreferences(personId: string) {
    // Queries tbl_persons_comms_stats & tbl_persons_channels
    const { data } = await supabase
      .from('tbl_persons_comms_stats')
      .select('comm_preferred, whatsapp_number, email_address')
      .eq('person_id', personId)
      .single();
    return data;
  }

  public async deliverMessage(
    personId: string, 
    templateKey: string, 
    params: Record
  ) {
    const pref = await this.getPreferences(personId);
    const content = this.compileTemplate(templateKey, params);

    // Polymorphic routing based on preferred channels
    if (pref.comm_preferred === 'whatsapp') {
      return await this.sendWhatsApp(pref.whatsapp_number, content);
    } else if (pref.comm_preferred === 'email') {
      return await this.sendEmail(pref.email_address, content);
    } else {
      return await this.sendSMS(pref.whatsapp_number, content); // Fallback
    }
  }
}

// EXAMPLE LOOP INVOCATION: T2 Property Compliance Loop
class PropertyComplianceLoop {
  private comms = new CommsDeliveryEngine();

  public async handleExpiringEPC(assetId: string, landlordId: string) {
    await this.comms.deliverMessage(landlordId, 'epc_expiry_consent', {
      cost: "£79",
      date: "June 26"
    });
    // State machine updates to: PENDING_LANDLORD_CONSENT
  }
}
🔧 Section C: Developer Guide

Architecture Details

Multi-agent architecture with a hierarchical orchestration model. The orchestrator agent manages task decomposition, worker agent dispatch, and result aggregation. Each agent runs in an isolated context with its own toolset and memory, communicating via a shared message bus.

  • Core Component: Agent orchestration engine
  • Data Flow: User Request → Orchestrator → Task Decomposition → Worker Agents → Result Aggregation → Response
  • Integration Points: Hermes Agent framework, tool registry, memory stores, delegation bus

Configuration Reference

Key configuration parameters for this system:

Parameter Type Default Description
max_concurrent_agents integer 3 Maximum number of parallel worker agents
agent_timeout_seconds integer 300 Agent execution timeout
model_routing_policy string cost_optimized Model selection strategy (precision, cost_optimized, speed)
AGENT ARCHITECTURE — ORCHESTRATOR → WORKER → RESULT 1. ORCHESTRATOR Task Decomposition Worker Dispatch 🎯 Orchestrator 2. WORKER AGENTS Isolated Execution Tool & Memory Access 🤖 Workers 3. RESULT AGGREGATION Merge & Validate Response Formatting 📊 Aggregation Hierarchical agent architecture: orchestrator decomposes tasks, workers execute in isolation, results are aggregated and validated Isolated contexts · Tool access control · Memory injection · Result validation Orchestrator / Dispatch Workers / Execution Aggregation / Output Data flow →

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

Troubleshooting

Issue Cause Resolution
Agent timeout Complex task or downstream dependency failure Increase timeout or break task into smaller subtasks
Orchestrator loop detected Circular delegation or self-referencing task Enforce max_spawn_depth and cycle detection
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.