{"slug":"business/TWO_LAYER_VISUAL_DIAGRAMS","title":"Two-Layer Connection Model: Visual Diagrams","section":"business","sectionLabel":"Business","status":"unclassified","type":"document","path":"business/TWO_LAYER_VISUAL_DIAGRAMS.mdx","bytes":17836,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n\n> **Tier C — Historical.** This document is a point-in-time snapshot preserved for reference. For current architecture, see [CANONICAL_PLATFORM_ARCHITECTURE.md](../architecture/CANONICAL_PLATFORM_ARCHITECTURE.md).\n\n## Diagram 1: The Complete Two-Layer Architecture\n\n```\n╔════════════════════════════════════════════════════════════════════╗\n║                  LAYER 1: IDENTITY (AI Clients)                   ║\n╠════════════════════════════════════════════════════════════════════╣\n║                                                                    ║\n║  ┌─────────────┐  ┌──────────┐  ┌──────────┐  ┌────────┐ ┌────┐  ║\n║  │   Claude    │  │ ChatGPT  │  │Perplexity│  │ Replit │ │Love│  ║\n║  │  Desktop    │  │          │  │          │  │        │ │able│  ║\n║  └──────┬──────┘  └────┬─────┘  └────┬─────┘  └───┬────┘ └──┬─┘  ║\n║         │              │             │            │        │     ║\n║  JWT Token         JWT Token    JWT Token    JWT Token  JWT Token║\n║  (tenant_id)       (tenant_id)  (tenant_id) (tenant_id)(tenant_id)\n║         │              │             │            │        │     ║\n║         └──────────────┼─────────────┼────────────┼────────┘     ║\n║                        │             │            │               ║\n║                        └─────────────┴────────────┘               ║\n║                                  │                                 ║\n║                 ┌────────────────▼────────────────┐               ║\n║                 │  CONTINUITY_BRIDGE (OAuth)      │               ║\n║                 │ /auth/authorize endpoint        │               ║\n║                 │ • JWT generation                │               ║\n║                 │ • User + Tenant scoping         │               ║\n║                 │ • Token validation              │               ║\n║                 └────────────────┬────────────────┘               ║\n║                                  │                                 ║\n╠══════════════════════════════════════════════════════════════════════╣\n║                                  │                                   ║\n║                 ┌────────────────▼────────────────┐                ║\n║                 │  GATEWAY (JWT Validation)       │                ║\n║                 │ • Validate token signature      │                ║\n║                 │ • Extract tenant_id + user_id   │                ║\n║                 │ • Automatic tenant scoping      │                ║\n║                 │ • Feature gate                  │                ║\n║                 └────────────────┬────────────────┘                ║\n║                                  │                                 ║\n╠══════════════════════════════════════════════════════════════════════╣\n║          LAYER 2: CONNECTIVITY (Customer Systems)                  ║\n╠══════════════════════════════════════════════════════════════════════╣\n║                                  │                                 ║\n║                        ┌─────────▼─────────┐                      ║\n║                        │   SPINE (D1)      │                      ║\n║                        │ Tenant-scoped     │                      ║\n║                        │ Normalized data   │                      ║\n║                        └────────┬──────────┘                      ║\n║                                 │                                 ║\n║              ┌──────────────────┼──────────────────┐              ║\n║              ▼                  ▼                  ▼              ║\n║        ┌─────────────┐   ┌─────────────┐   ┌────────────┐        ║\n║        │  HubSpot    │   │ Salesforce  │   │   Stripe   │        ║\n║        │ (OAuth token)   │ (OAuth token)   │(OAuth token)        ║\n║        └─────────────┘   └─────────────┘   └────────────┘        ║\n║              ▼                  ▼                  ▼              ║\n║         Contacts          Opportunities        Payments          ║\n║         Companies          Accounts            Subscriptions     ║\n║         Deals              Contacts            Customers         ║\n║              │                  │                  │              ║\n║              └──────────────────┼──────────────────┘              ║\n║                                 │                                 ║\n║              [+ 7 more systems] Zendesk, Slack, GitHub, etc.      ║\n║                                                                    ║\n║  Result: ChatGPT queries Spine.                                   ║\n║           Spine fetches from ALL connected systems.               ║\n║           ChatGPT sees merged, normalized data.                  ║\n║                                                                    ║\n╚════════════════════════════════════════════════════════════════════╝\n```\n\n---\n\n## Diagram 2: Single AI Client Query Flow\n\n```\n┌─ Claude User: \"What's our revenue this month?\"\n│\n├─ Claude MPC Call:\n│  GET /api/v1/spine/metrics/revenue_this_month\n│  Headers: Authorization: Bearer {JWT_token}\n│\n├─ Gateway validates JWT:\n│  ✓ Signature valid\n│  ✓ tenant_id = \"acme-corp-123\"\n│  ✓ user_id = \"alice@company.com\"\n│\n├─ Spine query:\n│  SELECT * FROM metrics\n│  WHERE tenant_id = \"acme-corp-123\"\n│  AND metric = \"revenue_this_month\"\n│\n├─ Hydration: Need data from:\n│  • Stripe (subscriptions → revenue)\n│  • NetSuite (invoices → revenue)\n│  • Zuora (subscriptions → revenue)\n│\n├─ Fetches from all 3 (in parallel):\n│  • Stripe: SELECT SUM(amount) FROM subscriptions WHERE created_at >= 2024-06-01\n│  • NetSuite: SELECT SUM(total) FROM invoices WHERE date >= 2024-06-01\n│  • Zuora: SELECT SUM(mrr) FROM subscriptions WHERE status=\"active\"\n│\n├─ Returns to Claude:\n│  {\n│    \"revenue_this_month\": 500000,\n│    \"breakdown\": {\n│      \"stripe\": 250000,\n│      \"netsuite\": 150000,\n│      \"zuora\": 100000\n│    },\n│    \"currency\": \"USD\",\n│    \"updated_at\": \"2024-06-27T10:15:00Z\"\n│  }\n│\n└─ Claude displays: \"Your revenue this month is $500k\"\n```\n\n---\n\n## Diagram 3: Multi-Client Cascade (The Power)\n\n```\n┌────────────────────────────────────────────────────────────────┐\n│            Company: Acme Corp (tenant_id=123)                  │\n├────────────────────────────────────────────────────────────────┤\n│                                                                │\n│  LAYER 1: 5 AI Clients Connected                             │\n│  ┌─────────────────────────────────────────────────────────┐ │\n│  │ • Claude (JWT: tenant=123, user=alice@acme.com)         │ │\n│  │ • ChatGPT (JWT: tenant=123, user=alice@acme.com)        │ │\n│  │ • Perplexity (JWT: tenant=123, user=alice@acme.com)     │ │\n│  │ • Replit (JWT: tenant=123, user=alice@acme.com)         │ │\n│  │ • Lovable (JWT: tenant=123, user=alice@acme.com)        │ │\n│  └─────────────────────────────────────────────────────────┘ │\n│           All authenticate same Identity (Acme Corp)          │\n│                          │                                     │\n│  LAYER 2: 10 Systems Connected                               │\n│  ┌─────────────────────────────────────────────────────────┐ │\n│  │ • HubSpot (token=abc123)      • Zendesk (token=mno456)  │ │\n│  │ • Salesforce (token=def456)   • Slack (token=pqr789)    │ │\n│  │ • Stripe (token=ghi789)       • GitHub (token=stu012)   │ │\n│  │ • NetSuite (token=jkl012)     • Jira (token=vwx345)     │ │\n│  │ • Google Workspace (token=...)• Microsoft 365 (token=...)│ │\n│  └─────────────────────────────────────────────────────────┘ │\n│                          │                                     │\n│                  ┌───────▼────────┐                           │\n│                  │  SPINE (D1)    │                           │\n│                  │  Tenant=123    │                           │\n│                  └────────────────┘                           │\n│                          │                                     │\n│  RESULT: 5 × 10 = 50 combinations, but 1 Spine              │\n│                                                                │\n│  • Claude queries Opportunities → Salesforce + HubSpot       │\n│  • ChatGPT queries Revenue → Stripe + NetSuite               │\n│  • Perplexity queries Health → Zendesk + Slack + GitHub     │\n│  • Replit queries Tasks → Jira + GitHub                     │\n│  • Lovable queries People → Google Workspace + Microsoft 365 │\n│                                                                │\n│  All 5 AI clients see the SAME Spine.                        │\n│  All 5 AI clients can query ALL 10 systems.                  │\n│                                                                │\n└────────────────────────────────────────────────────────────────┘\n```\n\n---\n\n## Diagram 4: Connection Timeline (User Journey)\n\n```\nDay 0: Before Connection\n├─ Company: No IntegrateWise\n├─ AI Client: Claude exists but can't access company data\n└─ Systems: HubSpot, Salesforce, Stripe (standalone)\n\nDay 1: Marketplace Discovery\n├─ User opens Claude Desktop\n├─ Searches for \"IntegrateWise\"\n├─ Clicks \"Connect IntegrateWise\"\n└─ (5 minutes) Enters email + org name → OAuth complete\n\nDay 1: Identity Layer Active\n├─ IntegrateWise knows: alice@company.com + Acme Corp\n├─ Claude has JWT token\n├─ Claude can make MPC calls\n└─ But... no systems connected yet\n\nDay 2: Admin Connects Systems\n├─ Admin goes to IntegrateWise dashboard\n├─ Clicks \"Connect HubSpot\" → OAuth complete (2 min)\n├─ Clicks \"Connect Salesforce\" → OAuth complete (2 min)\n├─ Clicks \"Connect Stripe\" → OAuth complete (2 min)\n└─ (50 minutes total) 10 systems connected\n\nDay 2: Connectivity Layer Active\n├─ IntegrateWise has credentials for 10 systems\n├─ Spine is now hydrated with data from all 10\n├─ Claude can query merged data\n└─ ChatGPT (connected same day) also sees all 10\n\nResult: Exponential Access\n├─ 1 Claude (before): 0 integrations\n├─ 1 Claude + 10 systems: 10 integrations\n├─ 5 AI clients + 10 systems: Still 10 systems (shared)\n└─ 5 AI clients + 28 systems: Still 28 systems (shared)\n```\n\n---\n\n## Diagram 5: Data Access Flow (With Failure Isolation)\n\n```\nClaude: \"Show me accounts at risk\"\n     │\n     ├─ Query Spine: accounts_with_risk_score > 7\n     │\n     ├─ Spine tries to hydrate from:\n     │  ├─ Zendesk (support tickets: high volume = risk)\n     │  ├─ Stripe (churn rate: high = risk)\n     │  ├─ Salesforce (NRR: declining = risk)\n     │  └─ Slack (channel activity: low = risk)\n     │\n     ├─ What if Salesforce is down?\n     │  ├─ Fetch from: Zendesk ✓, Stripe ✓, Slack ✓\n     │  ├─ Skip: Salesforce ✗ (try again later)\n     │  ├─ Return partial score (based on 3/4 signals)\n     │  └─ Flag: \"Salesforce data unavailable\"\n     │\n     ├─ Claude receives:\n     │  ├─ 8 accounts (Zendesk + Stripe + Slack data)\n     │  ├─ Risk scores (partial)\n     │  ├─ Warning: \"Salesforce data unavailable\"\n     │  └─ (Retry Salesforce in background)\n     │\n     └─ Claude displays:\n        \"8 accounts at risk (Salesforce data pending)\"\n```\n\n---\n\n## Diagram 6: Feature Visibility (Binary State)\n\n```\nUser Journey:\n\nBefore OAuth:\n├─ Marketplace app shows \"Connect IntegrateWise\" button\n├─ No MPC tools available\n└─ No features visible\n\nAfter OAuth (Identity Layer):\n├─ JWT token stored\n├─ MPC tools available\n├─ But no systems connected yet\n├─ Feature surface shows:\n│  ├─ \"Connect HubSpot\" link\n│  ├─ \"Connect Salesforce\" link\n│  ├─ \"Connect Stripe\" link\n│  └─ \"Add more systems\" button\n└─ (Admin can start connecting systems)\n\nAfter Systems Connected (Connectivity Layer):\n├─ Spine is hydrated\n├─ MPC tools can return data\n├─ Feature surface shows:\n│  ├─ ✓ Accounts (from Salesforce + HubSpot)\n│  ├─ ✓ Opportunities (from Salesforce + HubSpot)\n│  ├─ ✓ Revenue (from Stripe)\n│  ├─ ✓ Health metrics (from Zendesk + Slack)\n│  ├─ ✓ Risk scoring (from all 10 systems)\n│  ├─ Agent Lee (orchestrator)\n│  └─ Memory (shared context)\n└─ (Full feature surface visible)\n```\n\n---\n\n## Diagram 7: Admin Connectivity Dashboard\n\n```\n┌─ IntegrateWise Dashboard\n├─ Organization: Acme Corp (tenant_id=123)\n├─ Users Connected:\n│  ├─ alice@company.com (Claude, ChatGPT, Perplexity)\n│  ├─ bob@company.com (Claude)\n│  └─ carol@company.com (ChatGPT)\n│\n├─ Connected Systems (10):\n│  ├─ ✓ HubSpot (connected 2024-06-20, 142 accounts, 8 properties)\n│  ├─ ✓ Salesforce (connected 2024-06-20, 500 opportunities, 15 fields)\n│  ├─ ✓ Stripe (connected 2024-06-20, $2.5M MRR, 50 subscriptions)\n│  ├─ ✓ NetSuite (connected 2024-06-21, 100 invoices/month)\n│  ├─ ✓ Zendesk (connected 2024-06-21, 500 tickets/month)\n│  ├─ ✓ Slack (connected 2024-06-22, 50 channels)\n│  ├─ ✓ GitHub (connected 2024-06-22, 5 repositories)\n│  ├─ ✓ Jira (connected 2024-06-23, 200 issues)\n│  ├─ ✓ Google Workspace (connected 2024-06-23)\n│  └─ ✓ Microsoft 365 (connected 2024-06-24)\n│\n├─ System Status:\n│  ├─ HubSpot: Last sync 2m ago, 0 errors\n│  ├─ Salesforce: Last sync 5m ago, 0 errors\n│  ├─ Stripe: Last sync 30s ago, 0 errors\n│  ├─ [...]\n│  └─ All systems healthy\n│\n├─ Actions:\n│  ├─ [+ Add System]\n│  ├─ [Edit Permissions]\n│  ├─ [View Activity Log]\n│  └─ [Manage Users]\n│\n└─ Result: Admin sees all systems connected, all data flowing\n```\n\n---\n\n## Summary of Visuals\n\n1. **Layer 1**: AI clients authenticate with IntegrateWise\n2. **Layer 2**: IntegrateWise authenticates with customer systems\n3. **Cascade**: Multiple AI clients, multiple systems, one Spine\n4. **Failure**: Partial data if one system is down (not error)\n5. **Features**: Binary (not connected / fully connected)\n6. **Dashboard**: Admin sees all connections at a glance\n\nKey Insight: **Multiplicative, not additive**\n- 1 AI client × 10 systems = 10 sources\n- 5 AI clients × 10 systems = **still 10 sources** (shared Spine)\n- Adding 1 more AI client = no additional system integrations needed\n"}