{"slug":"internal/architecture/INTEGRATEWISE_LAYERED_ARCHITECTURE","title":"🏗️ INTEGRATEWISE COMPLETE LAYERED ARCHITECTURE","section":"internal","sectionLabel":"Internal","status":"unclassified","type":"document","path":"internal/architecture/INTEGRATEWISE_LAYERED_ARCHITECTURE.mdx","bytes":52261,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n## Technical Specification with Agent Integration Points\n\n**Version:** 2.0  \n**Date:** January 7, 2026  \n**Platform:** IntegrateWise - AI Agents Platform for Effortless Work\n\n---\n\n## 📊 VISUAL ARCHITECTURE OVERVIEW\n\n```\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│                         INTEGRATEWISE PLATFORM                                   │\n│                    \"Normalize Once. Render Anywhere.\"                           │\n│                                                                                  │\n│   One Workspace. All Your Tools. AI-Powered.                                    │\n└─────────────────────────────────────────────────────────────────────────────────┘\n\n                              ┌─────────────┐\n                              │   USERS     │\n                              │ Individual  │\n                              │   Teams     │\n                              │ Enterprise  │\n                              └──────┬──────┘\n                                     │\n                                     ▼\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│  LAYER 7: PRESENTATION LAYER (Views/Lenses)                                     │\n│  ═══════════════════════════════════════════════════════════════════════════   │\n│                                                                                  │\n│   ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐          │\n│   │   Personal   │ │     Work     │ │   Business   │ │  Customer    │          │\n│   │     View     │ │     View     │ │     View     │ │   Success    │          │\n│   │              │ │              │ │              │ │    View      │          │\n│   │ • My Tasks   │ │ • Team Tasks │ │ • KPIs       │ │ • Health     │          │\n│   │ • My Ideas   │ │ • Projects   │ │ • Revenue    │ │ • ARR/MRR    │          │\n│   │ • My Brain   │ │ • Shared     │ │ • Analytics  │ │ • Churn Risk │          │\n│   │ • Calendar   │ │ • Documents  │ │ • Workflows  │ │ • Tech Health│          │\n│   └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘          │\n│                                                                                  │\n│   MODE: Full Integration (Read/Write) │ Render Only (Read-Only/Safe)           │\n└─────────────────────────────────────────────────────────────────────────────────┘\n                                     │\n                                     ▼\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│  LAYER 6: RENDER ENGINE (Universal Output)                                      │\n│  ═══════════════════════════════════════════════════════════════════════════   │\n│                                                                                  │\n│   ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐     │\n│   │  Docs   │ │  Decks  │ │ Emails  │ │  SOPs   │ │ Reports │ │  Plans  │     │\n│   │         │ │         │ │         │ │         │ │         │ │         │     │\n│   │ Google  │ │  PPTX   │ │  Gmail  │ │ Notion  │ │   PDF   │ │ Gantt   │     │\n│   │  Docs   │ │  Gamma  │ │ Outlook │ │  Coda   │ │  Excel  │ │ Linear  │     │\n│   │  Word   │ │  Canva  │ │ HubSpot │ │  Asana  │ │ Charts  │ │ Asana   │     │\n│   └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘     │\n│                                                                                  │\n│   \"Same data → Multiple formats → Any destination\"                              │\n└─────────────────────────────────────────────────────────────────────────────────┘\n                                     │\n                                     ▼\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│  LAYER 5: AI AGENT LAYER (Automation + Intelligence)                            │\n│  ═══════════════════════════════════════════════════════════════════════════   │\n│                                                                                  │\n│   ┌─────────────────────────────────────────────────────────────────────────┐  │\n│   │                    🎯 CSM ORCHESTRATOR (Meta-Agent)                      │  │\n│   │         ─────────────────────────────────────────────────               │  │\n│   │         • Aggregates data from ALL agents                               │  │\n│   │         • Makes intelligent recommendations                              │  │\n│   │         • Prioritizes daily work                                        │  │\n│   │         • 3x daily briefings (7AM, 12PM, 5PM)                           │  │\n│   │         • Revenue impact analysis                                        │  │\n│   │         • Workload management                                           │  │\n│   └─────────────────────────────────────────────────────────────────────────┘  │\n│                                     │                                           │\n│              ┌──────────────────────┴──────────────────────┐                   │\n│              ▼                                              ▼                   │\n│   ┌────────────────────────────┐        ┌────────────────────────────┐        │\n│   │   10 GENERAL AGENTS        │        │   6 CS-SPECIFIC AGENTS     │        │\n│   │   ════════════════════     │        │   ═════════════════════    │        │\n│   │                            │        │                            │        │\n│   │   1. Lead Qualification    │        │   1. Onboarding Agent      │        │\n│   │   2. Support Triage        │        │   2. Adoption Agent        │        │\n│   │   3. Email Classifier      │        │   3. Health Agent          │        │\n│   │   4. Social Monitor        │        │   4. Retention Agent       │        │\n│   │   5. Content Optimizer     │        │   5. Support Agent         │        │\n│   │   6. Customer Health       │        │   6. CSM Orchestrator      │        │\n│   │   7. Competitive Intel     │        │                            │        │\n│   │   8. Billing & Revenue     │        │                            │        │\n│   │   9. Content Strategy      │        │                            │        │\n│   │  10. DevOps Incident       │        │                            │        │\n│   └────────────────────────────┘        └────────────────────────────┘        │\n│                                                                                  │\n│   Deployment: n8n Cloud ($50/mo) + Cloudflare Workers                           │\n└─────────────────────────────────────────────────────────────────────────────────┘\n                                     │\n                                     ▼\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│  LAYER 4: BRAIN + BRAINSTORMING LAYER (Second Brain)                            │\n│  ═══════════════════════════════════════════════════════════════════════════   │\n│                                                                                  │\n│   ┌─────────────────────────────────────────────────────────────────────────┐  │\n│   │   🧠 AI Chat Stream Aggregation                                          │  │\n│   │   ─────────────────────────────────────────                             │  │\n│   │   ChatGPT │ Claude │ Gemini │ Grok │ Perplexity                         │  │\n│   │                                                                          │  │\n│   │   Secure webhooks stream AI conversations → Searchable memory           │  │\n│   └─────────────────────────────────────────────────────────────────────────┘  │\n│                                                                                  │\n│   ┌─────────────────────────────────────────────────────────────────────────┐  │\n│   │   🧠 BRAIN AGENT Capabilities                                            │  │\n│   │   ─────────────────────────────────────────                             │  │\n│   │   • Revisit and refine your thinking                                    │  │\n│   │   • Connect ideas across tools and time                                 │  │\n│   │   • Turn brainstorming → structured plans, tasks, documents             │  │\n│   │   • Ideas stop disappearing—start compounding                           │  │\n│   └─────────────────────────────────────────────────────────────────────────┘  │\n│                                                                                  │\n│   BYOM (Bring Your Own Model): Connect commercial or self-hosted models         │\n└─────────────────────────────────────────────────────────────────────────────────┘\n                                     │\n                                     ▼\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│  LAYER 3: AI LOADER LAYER (Data Ingestion + Transformation)                     │\n│  ═══════════════════════════════════════════════════════════════════════════   │\n│                                                                                  │\n│   \"One-click import that preserves context and logic\"                           │\n│                                                                                  │\n│   ┌─────────────────────────────┐   ┌─────────────────────────────┐            │\n│   │   PART A (5 Loaders) ✅     │   │   PART B (10 Loaders) 🔴    │            │\n│   │   ═════════════════════     │   │   ═════════════════════     │            │\n│   │                             │   │                             │            │\n│   │   ┌───────┐  ┌───────┐     │   │   ┌───────┐  ┌───────┐     │            │\n│   │   │ Slack │  │HubSpot│     │   │   │Salesf.│  │Zendesk│     │            │\n│   │   └───────┘  └───────┘     │   │   └───────┘  └───────┘     │            │\n│   │   ┌───────┐  ┌───────┐     │   │   ┌───────┐  ┌───────┐     │            │\n│   │   │Notion │  │ Gmail │     │   │   │Interc.│  │ Jira  │     │            │\n│   │   └───────┘  └───────┘     │   │   └───────┘  └───────┘     │            │\n│   │   ┌───────┐                │   │   ┌───────┐  ┌───────┐     │            │\n│   │   │Sheets │                │   │   │GitHub │  │ Asana │     │            │\n│   │   └───────┘                │   │   └───────┘  └───────┘     │            │\n│   │                             │   │   ┌───────┐  ┌───────┐     │            │\n│   │   Status: 100% Complete     │   │   │Stripe │  │Linear │     │            │\n│   │                             │   │   └───────┘  └───────┘     │            │\n│   │                             │   │   ┌───────┐  ┌───────┐     │            │\n│   │                             │   │   │Twilio │  │Segment│     │            │\n│   │                             │   │   └───────┘  └───────┘     │            │\n│   │                             │   │                             │            │\n│   │                             │   │   Status: 0% (Planned)      │            │\n│   └─────────────────────────────┘   └─────────────────────────────┘            │\n│                                                                                  │\n│   Each loader: Extract → Transform → Normalize to Spine contracts              │\n└─────────────────────────────────────────────────────────────────────────────────┘\n                                     │\n                                     ▼\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│  LAYER 2: HUB (Control + Routing Layer)                                         │\n│  ═══════════════════════════════════════════════════════════════════════════   │\n│                                                                                  │\n│   \"Secure routing + permissions + boundaries\"                                   │\n│                                                                                  │\n│   ┌─────────────────────────────────────────────────────────────────────────┐  │\n│   │                        21 FUNCTIONAL HUBS                                │  │\n│   │   ────────────────────────────────────────────────────────────────────  │  │\n│   │                                                                          │  │\n│   │   BUSINESS OPERATIONS                 CUSTOMER-FACING                   │  │\n│   │   ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐          │  │\n│   │   │  Sales  │ │Marketing│ │ Finance │ │   HR    │ │  Legal  │          │  │\n│   │   └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘          │  │\n│   │   ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐          │  │\n│   │   │   CS    │ │ Support │ │ Product │ │   Ops   │ │   Tech  │          │  │\n│   │   └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘          │  │\n│   │                                                                          │  │\n│   │   SPECIALIZED                         EXTERNAL                          │  │\n│   │   ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐          │  │\n│   │   │Complia. │ │Security │ │Analytics│ │Integr.  │ │Partners │          │  │\n│   │   └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘          │  │\n│   │   ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐          │  │\n│   │   │Training │ │Projects │ │ Events  │ │Comms    │ │ R&D     │          │  │\n│   │   └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘          │  │\n│   │   ┌─────────┐                                                           │  │\n│   │   │ Brain   │ (AI conversations hub)                                    │  │\n│   │   └─────────┘                                                           │  │\n│   └─────────────────────────────────────────────────────────────────────────┘  │\n│                                                                                  │\n│   Hub Functions: Access Control │ Data Routing │ Audit Logging │ Boundaries    │\n└─────────────────────────────────────────────────────────────────────────────────┘\n                                     │\n                                     ▼\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│  LAYER 1: SPINE (Structural + Normalization Layer) - ATLAS SPINE               │\n│  ═══════════════════════════════════════════════════════════════════════════   │\n│                                                                                  │\n│   \"Normalize and preserve meaning across systems\"                               │\n│                                                                                  │\n│   ┌─────────────────────────────────────────────────────────────────────────┐  │\n│   │                      10 ZOD-BASED DATA CONTRACTS                         │  │\n│   │   ────────────────────────────────────────────────────────────────────  │  │\n│   │                                                                          │  │\n│   │   CORE ENTITIES              OPERATIONAL              RELATIONSHIP       │  │\n│   │   ┌───────────┐              ┌───────────┐            ┌───────────┐     │  │\n│   │   │  Account  │              │   Task    │            │ Activity  │     │  │\n│   │   │  Contract │              │   Event   │            │   Log     │     │  │\n│   │   └───────────┘              │   Alert   │            └───────────┘     │  │\n│   │   ┌───────────┐              └───────────┘            ┌───────────┐     │  │\n│   │   │  Contact  │              ┌───────────┐            │Engagement │     │  │\n│   │   │  Contract │              │   Note    │            │  Score    │     │  │\n│   │   └───────────┘              │  Contract │            └───────────┘     │  │\n│   │   ┌───────────┐              └───────────┘            ┌───────────┐     │  │\n│   │   │   Deal    │              ┌───────────┐            │  Health   │     │  │\n│   │   │  Contract │              │   Metric  │            │   Score   │     │  │\n│   │   └───────────┘              │  Contract │            └───────────┘     │  │\n│   │                              └───────────┘                               │  │\n│   │                                                                          │  │\n│   │   Status: 85% Complete (10/12 contracts)                                │  │\n│   └─────────────────────────────────────────────────────────────────────────┘  │\n│                                                                                  │\n│   Database: Supabase PostgreSQL ($25/mo)                                        │\n│   Validation: Zod schemas for type safety                                       │\n└─────────────────────────────────────────────────────────────────────────────────┘\n                                     │\n                                     ▼\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│  LAYER 0: EXTERNAL TOOLS (Source Systems)                                       │\n│  ═══════════════════════════════════════════════════════════════════════════   │\n│                                                                                  │\n│   \"No migrations. No rebuilding. Plug in the tools you rely on—once.\"          │\n│                                                                                  │\n│   ┌─────────────────────────────────────────────────────────────────────────┐  │\n│   │   PRODUCTIVITY          CRM/SALES           COMMUNICATION               │  │\n│   │   ┌──────┐ ┌──────┐    ┌──────┐ ┌──────┐   ┌──────┐ ┌──────┐          │  │\n│   │   │Notion│ │ Coda │    │Salesf│ │HubSpt│   │ Slack│ │ Gmail│          │  │\n│   │   └──────┘ └──────┘    └──────┘ └──────┘   └──────┘ └──────┘          │  │\n│   │                                                                          │  │\n│   │   GOOGLE WORKSPACE      BILLING             DEV TOOLS                   │  │\n│   │   ┌──────┐ ┌──────┐    ┌──────┐ ┌──────┐   ┌──────┐ ┌──────┐          │  │\n│   │   │Sheets│ │ Docs │    │Stripe│ │Chargebee│ │GitHub│ │ Jira │          │  │\n│   │   └──────┘ └──────┘    └──────┘ └──────┘   └──────┘ └──────┘          │  │\n│   │                                                                          │  │\n│   │   SUPPORT               AI PLATFORMS                                     │  │\n│   │   ┌──────┐ ┌──────┐    ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐   │  │\n│   │   │Zendsk│ │Interc│    │ChatGP│ │Claude│ │Gemini│ │ Grok │ │Perplex│  │  │\n│   │   └──────┘ └──────┘    └──────┘ └──────┘ └──────┘ └──────┘ └──────┘   │  │\n│   └─────────────────────────────────────────────────────────────────────────┘  │\n└─────────────────────────────────────────────────────────────────────────────────┘\n```\n\n---\n\n## 🔄 DATA FLOW: END-TO-END\n\n```\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│                         COMPLETE DATA FLOW                                      │\n└─────────────────────────────────────────────────────────────────────────────────┘\n\n   EXTERNAL TOOLS                    INTEGRATEWISE PLATFORM                 OUTPUT\n   ══════════════                    ══════════════════════                 ══════\n\n   ┌──────────┐\n   │  Slack   │──┐\n   └──────────┘  │\n   ┌──────────┐  │    ┌────────────┐     ┌────────────┐     ┌────────────┐\n   │ HubSpot  │──┼───▶│ AI LOADER  │────▶│   SPINE    │────▶│    HUB     │\n   └──────────┘  │    │            │     │            │     │            │\n   ┌──────────┐  │    │ Extract    │     │ Normalize  │     │ Route      │\n   │  Notion  │──┤    │ Transform  │     │ Validate   │     │ Secure     │\n   └──────────┘  │    │ Enrich     │     │ Store      │     │ Permission │\n   ┌──────────┐  │    └────────────┘     └────────────┘     └────────────┘\n   │  Gmail   │──┤                              │                  │\n   └──────────┘  │                              │                  │\n   ┌──────────┐  │                              ▼                  ▼\n   │ Sheets   │──┘                       ┌────────────┐     ┌────────────┐\n   └──────────┘                          │   BRAIN    │     │  AGENTS    │\n                                         │            │     │            │\n   ┌──────────┐                          │ 2nd Brain  │◀───▶│ 10 General │\n   │ ChatGPT  │───────────────────────▶  │ Ideas      │     │ 6 CS       │\n   └──────────┘                          │ Memory     │     │ 1 CSM Orch │\n   ┌──────────┐                          └────────────┘     └────────────┘\n   │  Claude  │───────────────────────▶         │                  │\n   └──────────┘                                 │                  │\n                                                ▼                  ▼\n                                         ┌────────────────────────────┐\n                                         │      RENDER ENGINE         │\n                                         │                            │\n                                         │  ┌──────┐ ┌──────┐ ┌────┐ │\n                                         │  │ Docs │ │Decks │ │SOPs│ │\n                                         │  └──────┘ └──────┘ └────┘ │\n                                         └────────────────────────────┘\n                                                       │\n                                                       ▼\n                                         ┌────────────────────────────┐\n                                         │         VIEWS              │\n                                         │                            │\n                                         │  Personal│Work│Biz│CS      │\n                                         └────────────────────────────┘\n                                                       │\n                                                       ▼\n                                               ┌──────────────┐\n                                               │    USER      │\n                                               │  Dashboard   │\n                                               └──────────────┘\n```\n\n---\n\n## 🤖 DETAILED AGENT SPECIFICATIONS\n\n### LAYER 5A: 10 GENERAL AGENTS\n\n| #   | Agent Name             | Trigger            | Input Sources                    | Actions                                      | Output                              |\n| --- | ---------------------- | ------------------ | -------------------------------- | -------------------------------------------- | ----------------------------------- |\n| 1   | **Lead Qualification** | New lead in CRM    | HubSpot, Website forms, LinkedIn | Score lead, enrich data, assign to sales     | Qualified lead + score + assignment |\n| 2   | **Support Triage**     | New ticket         | Zendesk, Intercom, Email         | Classify priority, route to team, suggest KB | Prioritized ticket + routing        |\n| 3   | **Email Classifier**   | Incoming email     | Gmail, Outlook                   | Categorize, extract action items, route      | Classified email + tasks            |\n| 4   | **Social Monitor**     | Brand mention      | Twitter, LinkedIn, Reddit        | Sentiment analysis, alert if negative        | Sentiment report + alerts           |\n| 5   | **Content Optimizer**  | Content published  | Blog, Docs, Landing pages        | SEO analysis, readability score              | Optimization suggestions            |\n| 6   | **Customer Health**    | Daily/Real-time    | CRM, Usage data, Support         | Calculate health score                       | Health score + risk flag            |\n| 7   | **Competitive Intel**  | Competitor mention | News, Social, Reviews            | Track competitor moves                       | Intel report                        |\n| 8   | **Billing & Revenue**  | Payment event      | Stripe, Chargebee                | Track MRR, flag failed payments              | Revenue metrics + alerts            |\n| 9   | **Content Strategy**   | Weekly             | Analytics, Engagement            | Identify content gaps                        | Content calendar suggestions        |\n| 10  | **DevOps Incident**    | Error spike        | GitHub, Sentry, Logs             | Detect issues, notify team                   | Incident alert + RCA                |\n\n### LAYER 5B: 6 CS-SPECIFIC AGENTS\n\n| #   | Agent Name           | Trigger              | What It Does                                                 | Key Metrics                      |\n| --- | -------------------- | -------------------- | ------------------------------------------------------------ | -------------------------------- |\n| 1   | **Onboarding Agent** | New customer signup  | Track onboarding progress, send nudges, identify stuck users | Completion %, Time-to-value      |\n| 2   | **Adoption Agent**   | Daily usage scan     | Monitor feature adoption, identify upsell opportunities      | Feature usage %, Upsell signals  |\n| 3   | **Health Agent**     | Continuous           | Calculate health scores (GREEN/YELLOW/RED)                   | Health score, Trend              |\n| 4   | **Retention Agent**  | Risk signal detected | Predict churn, trigger save campaigns                        | Churn probability %, MRR at risk |\n| 5   | **Support Agent**    | Support ticket       | Analyze ticket sentiment, track resolution                   | NPS, Resolution time             |\n| 6   | **CSM Orchestrator** | 3x daily + alerts    | Aggregate all agent data, generate briefings                 | Daily workload, Revenue impact   |\n\n---\n\n### LAYER 5C: CSM ORCHESTRATOR (Meta-Agent) - DETAILED\n\n```\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│                          CSM ORCHESTRATOR                                        │\n│                    \"Your AI VP of Customer Success\"                             │\n└─────────────────────────────────────────────────────────────────────────────────┘\n\nTRIGGER SCHEDULE:\n├── 7:00 AM  → Daily Briefing (CRITICAL actions for today)\n├── 12:00 PM → Mid-day Update (Progress check)\n├── 5:00 PM  → End-of-day Summary (Work completed, tomorrow prep)\n├── Friday 5 PM → Weekly Review (Full metrics analysis)\n├── Last Friday → Monthly Business Review (ARR, churn, growth)\n└── REAL-TIME → Critical alerts (churn risk >90%, integration down)\n\nINPUTS (From 5 CS Agents):\n┌────────────────────────────────────────────────────────────────┐\n│  Agent 1 (Onboarding)  →  New customers, completion %, stuck  │\n│  Agent 2 (Adoption)    →  Feature usage, upsell ready         │\n│  Agent 3 (Health)      →  GREEN/YELLOW/RED breakdown          │\n│  Agent 4 (Retention)   →  Churn risk %, MRR at risk           │\n│  Agent 5 (Support)     →  Critical tickets, NPS               │\n└────────────────────────────────────────────────────────────────┘\n\nPROCESSING:\n┌────────────────────────────────────────────────────────────────┐\n│  1. Customer Health Dashboard (Unified)                        │\n│     - Total customers by health status                         │\n│     - Priority categorization (IMMEDIATE/THIS WEEK/NEXT WEEK)  │\n│                                                                │\n│  2. Revenue Impact Analysis                                    │\n│     - MRR at-risk (RED customers × MRR)                        │\n│     - MRR saved this month                                     │\n│     - MRR upsell opportunity                                   │\n│                                                                │\n│  3. Workload Analysis                                          │\n│     - Calls needed today                                       │\n│     - Emails to send                                           │\n│     - Estimated time                                           │\n│                                                                │\n│  4. Decision Engine                                            │\n│     - IF RED + high MRR → URGENT call recommendation           │\n│     - IF YELLOW + declining → Re-engagement email              │\n│     - IF GREEN + high usage → Upsell opportunity               │\n└────────────────────────────────────────────────────────────────┘\n\nOUTPUTS:\n┌────────────────────────────────────────────────────────────────┐\n│  📊 Daily Briefing (7 AM)                                      │\n│  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━                                │\n│  CRITICAL (Action Today):                                      │\n│  1. Acme Corp - CHURN RISK - $5K MRR                           │\n│     Action: Call 10 AM - Script: [pre-filled]                  │\n│                                                                │\n│  OPPORTUNITIES (This Week):                                    │\n│  - Growth Corp: Upsell to Enterprise ($3K potential)           │\n│                                                                │\n│  TODAY'S WORKLOAD:                                             │\n│  - Calls: 3 | Emails: 12 | Est. time: 4 hours                  │\n└────────────────────────────────────────────────────────────────┘\n\nALERT CHANNELS:\n├── WhatsApp  → Critical alerts (immediate)\n├── Telegram  → Daily briefings\n├── Slack     → Team notifications\n└── Email     → Weekly/monthly reports\n```\n\n---\n\n## 🔗 WHERE AGENTS APPLY IN EACH LAYER\n\n```\n┌────────────────────────────────────────────────────────────────────────────────┐\n│                    AGENT-TO-LAYER MAPPING                                      │\n└────────────────────────────────────────────────────────────────────────────────┘\n\nLAYER 7 (Views):\n└── Agents don't operate here\n    └── Views consume agent outputs for display\n\nLAYER 6 (Render):\n├── Content Optimizer Agent\n│   └── Analyzes rendered content, suggests improvements\n└── Content Strategy Agent\n    └── Recommends what content to render next\n\nLAYER 5 (Agents):\n└── ALL AGENTS LIVE HERE\n    ├── 10 General Agents (cross-functional)\n    ├── 6 CS Agents (customer success specific)\n    └── 1 CSM Orchestrator (meta-agent)\n\nLAYER 4 (Brain):\n├── Brain Agent\n│   └── Processes AI conversations, builds second brain\n└── All agents can READ from Brain\n    └── Context enrichment for decisions\n\nLAYER 3 (Loaders):\n├── Loaders feed data TO agents\n│   └── Agents don't operate in loaders\n└── Exception: Some agents trigger loader refreshes\n    └── e.g., Health Agent triggers HubSpot sync\n\nLAYER 2 (Hub):\n├── Agents respect Hub permissions\n│   └── Can only access data in authorized hubs\n└── Routing rules apply to agent outputs\n    └── e.g., CS Agent outputs → CS Hub only\n\nLAYER 1 (Spine):\n├── Agents READ normalized data\n│   └── All queries go through Spine contracts\n└── Agents WRITE processed results\n    └── Health scores, recommendations stored in Spine\n\nLAYER 0 (External):\n├── Agents can TRIGGER actions\n│   └── Send email via Gmail\n│   └── Update deal in HubSpot\n│   └── Create ticket in Zendesk\n└── Full Integration mode required\n    └── Render Only = agents are read-only\n```\n\n---\n\n## 📊 AGENT EXECUTION FLOW\n\n```\n┌─────────────────────────────────────────────────────────────────────────────────┐\n│                        AGENT EXECUTION SEQUENCE                                  │\n└─────────────────────────────────────────────────────────────────────────────────┘\n\nDAILY FLOW:\n\n6:00 AM  ─────────────────────────────────────────────────────────────────────────\n         │\n         ├── AI Loaders run (sync fresh data)\n         │   ├── Slack Loader → messages, channels\n         │   ├── HubSpot Loader → contacts, deals\n         │   ├── Gmail Loader → emails, threads\n         │   └── Sheets Loader → metrics, data\n         │\n6:30 AM  ├── Spine updated with normalized data\n         │\n         ├── Individual Agents run in parallel:\n         │   ├── Health Agent → calculate scores\n         │   ├── Adoption Agent → check feature usage\n         │   ├── Retention Agent → identify churn risks\n         │   └── Support Agent → analyze tickets\n         │\n6:45 AM  ├── Agent results stored in Spine\n         │\n7:00 AM  ├── CSM ORCHESTRATOR runs\n         │   ├── Aggregates all agent outputs\n         │   ├── Generates daily briefing\n         │   ├── Creates action recommendations\n         │   └── Sends to WhatsApp/Telegram\n         │\n         ▼\n         📱 YOU RECEIVE DAILY BRIEFING\n         │\n         │   📊 CUSTOMER SUCCESS BRIEFING\n         │   ━━━━━━━━━━━━━━━━━━━━━━━━━━\n         │   CRITICAL (Action Today):\n         │   1. Acme Corp - CHURN RISK - $5K MRR\n         │      Action: Call 10 AM\n         │\n         │   TODAY'S WORKLOAD:\n         │   - Calls: 3 | Emails: 12 | Time: 4h\n         │\n12:00 PM ├── Mid-day update runs\n         │   └── Progress check, new alerts\n         │\n5:00 PM  └── End-of-day summary\n             └── Work completed, tomorrow prep\n\nREAL-TIME ALERTS (Anytime):\n\n┌──────────────┐     ┌──────────────┐     ┌──────────────┐\n│ Trigger:     │────▶│ Agent:       │────▶│ Action:      │\n│ New RED      │     │ Retention    │     │ WhatsApp     │\n│ customer     │     │ Agent        │     │ alert sent   │\n└──────────────┘     └──────────────┘     └──────────────┘\n```\n\n---\n\n## 💰 INFRASTRUCTURE COSTS\n\n| Component    | Service             | Cost/Month     |\n| ------------ | ------------------- | -------------- |\n| Hosting      | Cloudflare Pages    | $5             |\n| Database     | Supabase PostgreSQL | $25            |\n| Automation   | n8n Cloud           | $50            |\n| Alerts       | Twilio WhatsApp     | $0.50          |\n| Data Storage | Airtable            | $20            |\n| **TOTAL**    |                     | **$100.50/mo** |\n\n---\n\n## 🎯 IMPLEMENTATION STATUS\n\n| Layer   | Component           | Status   | Progress          |\n| ------- | ------------------- | -------- | ----------------- |\n| Layer 7 | Views/Lenses        | ✅ Live  | 85%               |\n| Layer 6 | Render Engine       | 🟡 Basic | 60%               |\n| Layer 5 | Agents (General)    | 🔴       | 20% (2/10)        |\n| Layer 5 | Agents (CS)         | 🔴       | 20% (1/6)         |\n| Layer 5 | CSM Orchestrator    | 🟡       | 50% (design done) |\n| Layer 4 | Brain/Brainstorming | 🔴       | 10%               |\n| Layer 3 | AI Loaders Part A   | ✅       | 100% (5/5)        |\n| Layer 3 | AI Loaders Part B   | 🔴       | 0% (0/10)         |\n| Layer 2 | Hub (21 Hubs)       | ✅       | 90%               |\n| Layer 1 | Spine (ATLAS)       | ✅       | 85% (10/12)       |\n| Layer 0 | Tool Connections    | ✅       | 100%              |\n\n---\n\n## 🚀 NEXT STEPS TO COMPLETE\n\n### Immediate (Week 1):\n\n1. Deploy Agent 1 (Lead Qualification) in n8n\n2. Deploy Agent 3 (Health Agent) in n8n\n3. Set up WhatsApp alerts via Twilio\n4. Configure CSM Orchestrator daily briefings\n\n### Short-term (Weeks 2-4):\n\n1. Deploy remaining 8 general agents\n2. Deploy remaining 5 CS agents\n3. Complete AI Loader Part B (5 loaders)\n4. Build Brain Agent for AI chat aggregation\n\n### Medium-term (Months 2-3):\n\n1. Complete all 10 AI Loader Part B loaders\n2. Add BYOM (Bring Your Own Model) support\n3. Build enterprise admin console\n4. Add SSO/SAML for enterprise customers\n\n---\n\n**Document Version:** 2.0  \n**Last Updated:** January 7, 2026  \n**Author:** IntegrateWise Architecture Team\n"}