IsomeraDocs

API Version v1

api.isomera.ai/v1

System Architecture

Technical deep dive into the Isomera platform architecture, data flows, and integration patterns for enterprise healthcare solutions.

Platform Overview

Isomera is a comprehensive healthcare benefits platform that combines AI-powered voice conversations, benefits verification, and payer policy intelligence to automate insurance workflows.


┌─────────────────────────────────────────────────────────────────────────────────┐
│                              ISOMERA PLATFORM                                   │
├─────────────────────────────────────────────────────────────────────────────────┤
│                                                                                 │
│   ┌─────────────┐     ┌─────────────┐     ┌─────────────┐     ┌─────────────┐  │
│   │   Patient   │     │  Insurance  │     │   Pharma    │     │   Partner   │  │
│   │   Calls     │     │  Outbound   │     │   Widget    │     │    Apps     │  │
│   └──────┬──────┘     └──────┬──────┘     └──────┬──────┘     └──────┬──────┘  │
│          │                   │                   │                   │         │
│          └───────────────────┼───────────────────┼───────────────────┘         │
│                              │                   │                             │
│                              ▼                   ▼                             │
│                    ┌─────────────────────────────────────┐                     │
│                    │           API GATEWAY               │                     │
│                    │     (Authentication / CORS)         │                     │
│                    └────────────────┬────────────────────┘                     │
│                                     │                                          │
│   ┌─────────────────────────────────┼─────────────────────────────────┐        │
│   │                                 │                                 │        │
│   ▼                                 ▼                                 ▼        │
│ ┌───────────────┐    ┌──────────────────────┐    ┌───────────────────────┐    │
│ │   Voice AI    │    │   Benefits Chat      │    │   Patient Management  │    │
│ │   Service     │    │   (RAG Engine)       │    │   Service             │    │
│ │               │    │                      │    │                       │    │
│ │ • Call Mgmt   │    │ • Query Processing   │    │ • CRUD Operations     │    │
│ │ • Transcripts │    │ • Multi-Payer Search │    │ • Medications         │    │
│ │ • Function    │    │ • Citation Gen       │    │ • Verification        │    │
│ │   Calls       │    │                      │    │                       │    │
│ └───────┬───────┘    └──────────┬───────────┘    └───────────┬───────────┘    │
│         │                       │                            │                │
│         └───────────────────────┼────────────────────────────┘                │
│                                 │                                             │
│                                 ▼                                             │
│                    ┌────────────────────────────────┐                         │
│                    │        DATA LAYER              │                         │
│                    │                                │                         │
│                    │  ┌──────────┐  ┌───────────┐  │                         │
│                    │  │ Postgres │  │  Vector   │  │                         │
│                    │  │          │  │    DB     │  │                         │
│                    │  └──────────┘  └───────────┘  │                         │
│                    │                                │                         │
│                    └────────────────────────────────┘                         │
│                                                                               │
└───────────────────────────────────────────────────────────────────────────────┘
        

Voice Conversation Flow

The voice system handles both inbound patient calls and outbound insurance calls with real-time transcription and function calling capabilities.


PATIENT CALL FLOW
─────────────────

   Patient                 Voice AI              Backend Services
      │                       │                         │
      │ 1. Call initiated     │                         │
      │──────────────────────►│                         │
      │                       │ 2. Create VoiceCall     │
      │                       │────────────────────────►│
      │                       │                         │
      │ 3. Speak (identity)   │                         │
      │──────────────────────►│                         │
      │                       │ 4. patient_lookup()     │
      │                       │────────────────────────►│
      │                       │      patient_id         │
      │                       │◄────────────────────────│
      │  "Verified, John"     │                         │
      │◄──────────────────────│                         │
      │                       │                         │
      │ 5. "Check my med"     │                         │
      │──────────────────────►│                         │
      │                       │ 6. verify_benefits()    │
      │                       │────────────────────────►│
      │                       │   (API + RAG lookup)    │
      │                       │◄────────────────────────│
      │                       │                         │
      │                       │ 7. check_pa_requirements│
      │                       │────────────────────────►│
      │                       │   (Vector search)       │
      │                       │◄────────────────────────│
      │  "Coverage details..."│                         │
      │◄──────────────────────│                         │
      │                       │                         │
      │ 8. Call ends          │                         │
      │──────────────────────►│                         │
      │                       │ 9. Post-call analysis   │
      │                       │────────────────────────►│
      │                       │                         │
      │                       │ 10. Webhooks            │
      │                       │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ►│
        

Function Calls During Voice

The voice AI agent can invoke backend functions to look up data and take actions during the conversation. Each function call is logged for analytics.

FunctionLatency TargetData Sources
patient_lookup<200msPostgreSQL
verify_benefits<3sBenefits API + RAG
check_pa_requirements<500msVector search
flag_adverse_event<200msPostgreSQL

RAG Architecture

The Benefits Chat uses Retrieval-Augmented Generation to provide accurate answers grounded in payer policy documents.


RAG PIPELINE
────────────

┌────────────────────────────────────────────────────────────────────────────┐
│                         DOCUMENT INGESTION                                 │
├────────────────────────────────────────────────────────────────────────────┤
│                                                                            │
│   ┌────────────┐    ┌────────────┐    ┌────────────┐    ┌────────────┐    │
│   │   Payer    │    │   Payer    │    │   Video    │    │    API     │    │
│   │    PDFs    │    │   Pages    │    │ Transcripts│    │  Feeds     │    │
│   └─────┬──────┘    └─────┬──────┘    └─────┬──────┘    └─────┬──────┘    │
│         │                 │                 │                 │           │
│         └─────────────────┴─────────────────┴─────────────────┘           │
│                                   │                                        │
│                                   ▼                                        │
│                    ┌──────────────────────────────┐                        │
│                    │     Document Processor       │                        │
│                    │   • Text extraction          │                        │
│                    │   • Chunking (1000 tokens)   │                        │
│                    │   • Metadata extraction      │                        │
│                    └──────────────┬───────────────┘                        │
│                                   │                                        │
│                                   ▼                                        │
│                    ┌──────────────────────────────┐                        │
│                    │     Embedding Model          │                        │
│                    │   (text-embedding-3-small)   │                        │
│                    └──────────────┬───────────────┘                        │
│                                   │                                        │
│                                   ▼                                        │
│                    ┌──────────────────────────────┐                        │
│                    │   PostgreSQL + Vector DB     │                        │
│                    │   • ingestion_chunks         │                        │
│                    │   • payer_documents          │                        │
│                    └──────────────────────────────┘                        │
│                                                                            │
└────────────────────────────────────────────────────────────────────────────┘


┌────────────────────────────────────────────────────────────────────────────┐
│                           QUERY PIPELINE                                   │
├────────────────────────────────────────────────────────────────────────────┤
│                                                                            │
│   User Query: "What are the PA requirements for [medication] with Aetna?"  │
│                                   │                                        │
│                                   ▼                                        │
│                    ┌──────────────────────────────┐                        │
│                    │      Query Embedding         │                        │
│                    │   (same embedding model)     │                        │
│                    └──────────────┬───────────────┘                        │
│                                   │                                        │
│                                   ▼                                        │
│                    ┌──────────────────────────────┐                        │
│                    │      Hybrid Search           │                        │
│                    │   • Vector similarity        │                        │
│                    │   • Keyword matching         │                        │
│                    │   • Payer filtering          │                        │
│                    └──────────────┬───────────────┘                        │
│                                   │                                        │
│                                   ▼                                        │
│                    ┌──────────────────────────────┐                        │
│                    │      Context Assembly        │                        │
│                    │   Top 5 relevant chunks      │                        │
│                    │   + document metadata        │                        │
│                    └──────────────┬───────────────┘                        │
│                                   │                                        │
│                                   ▼                                        │
│                    ┌──────────────────────────────┐                        │
│                    │      LLM Generation          │                        │
│                    │   • System prompt + context  │                        │
│                    │   • Citation generation      │                        │
│                    │   • Accuracy guardrails      │                        │
│                    └──────────────┬───────────────┘                        │
│                                   │                                        │
│                                   ▼                                        │
│                         Response with Sources                              │
│                                                                            │
└────────────────────────────────────────────────────────────────────────────┘
        

Data Model

Core entities and their relationships in the platform.


┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│     Patient     │     │    VoiceCall    │     │  AdverseEvent   │
├─────────────────┤     ├─────────────────┤     ├─────────────────┤
│ id              │◄────│ patient_id      │────►│ patient_id      │
│ first_name      │     │ call_id         │     │ voice_call_id   │
│ last_name       │     │ status          │     │ case_number     │
│ dob             │     │ duration        │     │ severity        │
│ member_id       │     │ call_type       │     │ description     │
│ payer_id        │     │ call_outcome    │     │ medication_name │
│ coverage_snapshot│    │ satisfaction    │     │ symptoms[]      │
└─────────────────┘     │ topics[]        │     └─────────────────┘
        │               │ medications[]   │
        │               │ analysis        │
        │               └─────────────────┘
        │                       │
        │                       │
        ▼                       ▼
┌─────────────────┐     ┌─────────────────┐
│ PatientMedication│    │  CallUtterance  │
├─────────────────┤     ├─────────────────┤
│ medication_name │     │ voice_call_id   │
│ ndc_code        │     │ speaker         │
│ pa_required     │     │ text            │
│ pa_status       │     │ timestamp       │
│ step_therapy    │     └─────────────────┘
└─────────────────┘


┌─────────────────┐     ┌─────────────────┐
│  PayerDocument  │     │ IngestionChunk  │
├─────────────────┤     ├─────────────────┤
│ payer_slug      │────►│ document_id     │
│ title           │     │ text            │
│ document_type   │     │ embedding       │
│ source_url      │     │ chunk_index     │
│ effective_date  │     │ metadata        │
└─────────────────┘     └─────────────────┘
        

Integration Patterns

Pattern 1: Sync RAG Query

Query payer documents for PA requirements, coverage rules, etc. Returns immediately (~1-2s).

# Sync: Query payer knowledge base (RAG)
response = requests.post(
    f"{BASE_URL}/chat/query",
    headers=headers,
    json={
        "question": "What are the PA requirements for oncology drugs?",
        "payer_slug": "aetna"
    }
).json()

print(response["answer"])   # "Aetna requires PA for all oncology..."
print(response["sources"])  # List of source documents

Pattern 2: Async Benefits Verification

Initiate benefits verification (may involve voice calls). Returns job ID immediately, results delivered via webhook when complete (seconds for EDI, 3-8 min for voice).

# Async: Start benefits verification
job = requests.post(
    f"{BASE_URL}/patients/{patient_id}/verify-benefits",
    headers=headers,
    json={"medication": "Rixomab", "methods": ["edi", "voice"]}
).json()

print(job["job_id"])       # "ver_abc123"
print(job["status"])       # "pending"
print(job["estimated_completion"])  # "2024-12-18T10:45:00Z"

# Results arrive via webhook: benefits.verified

Pattern 3: Webhook Handler

Handle async results and real-time notifications.

# Example: Webhook handler for call events
from fastapi import FastAPI, Request
import hmac
import hashlib

app = FastAPI()

@app.post("/webhooks/isomera")
async def handle_isomera_webhook(request: Request):
    # Verify signature
    payload = await request.body()
    signature = request.headers.get("X-Isomera-Signature")

    expected = hmac.new(
        WEBHOOK_SECRET.encode(),
        payload,
        hashlib.sha256
    ).hexdigest()

    if not hmac.compare_digest(f"sha256={expected}", signature):
        raise HTTPException(401, "Invalid signature")

    event = await request.json()

    if event["event"] == "call.completed":
        # Update CRM with call outcome
        update_crm_record(
            patient_id=event["data"]["patient_id"],
            call_outcome=event["data"]["call_outcome"],
            follow_ups=event["data"]["analysis"]["follow_up_actions"]
        )

    elif event["event"] == "adverse_event.flagged":
        # Alert medical team
        if event["data"]["requires_immediate_action"]:
            send_urgent_alert(event["data"])

    return {"status": "received"}

Pattern 3: Embedded Widget

For pharmaceutical websites that want to add a chatbot.

<!-- Add to your website -->
<script
  src="https://widget.isomera.ai/embed.js"
  data-client="your-client-slug"
  data-api-key="wk_your_api_key"
  data-position="bottom-right"
></script>

Security Architecture


┌────────────────────────────────────────────────────────────────────────────┐
│                         SECURITY LAYERS                                    │
├────────────────────────────────────────────────────────────────────────────┤
│                                                                            │
│   ┌──────────────────────────────────────────────────────────────────┐    │
│   │                        TRANSPORT                                 │    │
│   │   • TLS 1.3 encryption                                          │    │
│   │   • Certificate pinning (mobile)                                │    │
│   └──────────────────────────────────────────────────────────────────┘    │
│                                                                            │
│   ┌──────────────────────────────────────────────────────────────────┐    │
│   │                       AUTHENTICATION                             │    │
│   │   • JWT Bearer tokens (user sessions)                           │    │
│   │   • API Keys (widget/service accounts)                          │    │
│   │   • CORS origin validation                                      │    │
│   └──────────────────────────────────────────────────────────────────┘    │
│                                                                            │
│   ┌──────────────────────────────────────────────────────────────────┐    │
│   │                       AUTHORIZATION                              │    │
│   │   • Role-based access control (RBAC)                            │    │
│   │   • Resource-level permissions                                  │    │
│   │   • Multi-tenant data isolation                                 │    │
│   └──────────────────────────────────────────────────────────────────┘    │
│                                                                            │
│   ┌──────────────────────────────────────────────────────────────────┐    │
│   │                        DATA SECURITY                             │    │
│   │   • PHI encryption at rest (AES-256)                            │    │
│   │   • Database-level row security                                 │    │
│   │   • Audit logging for compliance                                │    │
│   └──────────────────────────────────────────────────────────────────┘    │
│                                                                            │
└────────────────────────────────────────────────────────────────────────────┘
        

Scalability Considerations

ComponentScaling StrategyCurrent Limits
API ServersHorizontal (stateless)100 req/s per instance
PostgreSQLVertical + Read replicas10M patients
Vector SearchVector DB + indexing100M embeddings
Voice CallsProvider capacity1000 concurrent
WebhooksQueue-based delivery10K events/min

Deployment Architecture


┌────────────────────────────────────────────────────────────────────────────┐
│                         PRODUCTION DEPLOYMENT                              │
├────────────────────────────────────────────────────────────────────────────┤
│                                                                            │
│                          ┌────────────────┐                                │
│                          │   Cloudflare   │                                │
│                          │   (CDN/WAF)    │                                │
│                          └───────┬────────┘                                │
│                                  │                                         │
│                                  ▼                                         │
│   ┌────────────────────────────────────────────────────────────────────┐  │
│   │                     APPLICATION TIER                               │  │
│   │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐                 │  │
│   │  │   Backend   │  │   Frontend  │  │    Docs     │                 │  │
│   │  │ (FastAPI)   │  │  (Next.js)  │  │  (Next.js)  │                 │  │
│   │  │             │  │             │  │             │                 │  │
│   │  │ Auto-scale  │  │ Auto-scale  │  │ Static      │                 │  │
│   │  └──────┬──────┘  └─────────────┘  └─────────────┘                 │  │
│   │         │                                                          │  │
│   │         ▼                                                          │  │
│   │  ┌──────────────┐                                                  │  │
│   │  │  PostgreSQL  │                                                  │  │
│   │  │  + Vector DB │                                                  │  │
│   │  │              │                                                  │  │
│   │  │ Auto-backup  │                                                  │  │
│   │  └──────────────┘                                                  │  │
│   └────────────────────────────────────────────────────────────────────┘  │
│                                                                            │
└────────────────────────────────────────────────────────────────────────────┘
        

Future Architecture

The platform is designed to support future enhancements:

  • Multi-region deployment: Geographic redundancy for lower latency
  • Telephony provider abstraction: Support for multiple voice providers
  • Real-time streaming: WebSocket connections for live updates
  • ML pipeline: Continuous improvement of call analysis models
  • FHIR integration: Healthcare interoperability standards