{"slug":"architecture/TWIN_AGENT_DEPLOYMENT_PLAN","title":"Twin Agent Deployment Plan — CF Worker First","section":"architecture","sectionLabel":"Architecture","status":"superseded","type":"document","path":"architecture/TWIN_AGENT_DEPLOYMENT_PLAN.mdx","bytes":21045,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n> ⚠️ **PARTIALLY SUPERSEDED (v3.7, DECISION 22).** The Twin runs entirely in Cloudflare\n> (`services/iw-agent-runtime`) with a native in-app UI — there is no OpenWebUI in the product.\n> The OWUI / `vps-operations-stack/openwebui` steps below are legacy and apply only to the\n> internal ops-plane (Customer Zero), never the product. Canonical: AGENTS.md DECISION 22.\n\n**Date:** 2026-06-09\n**Status:** Superseded (CF-native Twin shipped — see iw-agent-runtime)\n**Goal:** Deploy Twin Orchestrator (Agent Creation) → Wire OWUI to Twin Runtime\n\n---\n\n## Overview\n\n```\nPhase 1: AGENT CREATION (CF Worker)\n    Deploy twin-orchestrator.dev.integratewise.ai\n    ↓\nPhase 2: AGENT RUNTIME (OWUI Integration)\n    Wire OWUI to Twin Runtime endpoint\n    ↓\nPhase 3: CUSTOMER ZERO LOADING\n    Load entities, signals, proposals, memory\n```\n\n---\n\n## Phase 1: AGENT CREATION (Deploy CF Worker)\n\n### Step 1.1: Deploy Intelligence Worker (Dependency)\n\nThe Twin Orchestrator depends on the Intelligence worker for AI reasoning.\n\n```bash\ncd /Users/nirmal/Github/integratewise-live/services/intelligence\n\n# Unset API token (use OAuth session)\nunset CLOUDFLARE_API_TOKEN\n\n# Deploy to dev\nwrangler deploy --env dev\n```\n\n**Expected Output:**\n\n```\n✨ Successfully deployed intelligence (dev)\n🌍 https://intelligence.dev.integratewise.ai\n```\n\n**Verify:**\n\n```bash\ncurl https://intelligence.dev.integratewise.ai/health\n```\n\n**Expected Response:**\n\n```json\n{\n  \"status\": \"ok\",\n  \"service\": \"intelligence\",\n  \"components\": [\"think\", \"act\", \"govern\", \"agents\", \"ai-router\"],\n  \"ai\": {\n    \"workers_ai\": \"available\",\n    \"openrouter\": \"configured\"\n  }\n}\n```\n\n---\n\n### Step 1.2: Deploy Twin Orchestrator (The Agent)\n\n```bash\ncd /Users/nirmal/Github/integratewise-live/services/twin-orchestrator\n\n# Unset API token (use OAuth session)\nunset CLOUDFLARE_API_TOKEN\n\n# Deploy to dev\nwrangler deploy --env dev\n```\n\n**Expected Output:**\n\n```\n✨ Successfully deployed twin-orchestrator (dev)\n🌍 https://twin.dev.integratewise.ai\n📅 Cron trigger: */5 * * * * (every 5 minutes)\n```\n\n**Verify:**\n\n```bash\ncurl https://twin.dev.integratewise.ai/health\n```\n\n**Expected Response:**\n\n```json\n{\n  \"status\": \"ok\",\n  \"service\": \"twin-orchestrator\",\n  \"role\": \"cognitive-orchestrator\",\n  \"capabilities\": [\"observe\", \"reason\", \"propose\", \"coordinate\", \"learn\"],\n  \"infrastructure\": {\n    \"mcp_connector\": \"bound\",\n    \"intelligence\": \"bound\",\n    \"pipeline\": \"bound\",\n    \"knowledge\": \"bound\",\n    \"continuity\": \"bound\"\n  }\n}\n```\n\n---\n\n### Step 1.3: Test Twin Observe Loop (Manual Trigger)\n\n```bash\ncurl -X POST https://twin.dev.integratewise.ai/v1/twin/observe \\\n  -H \"x-tenant-id: iw-customer-zero\" \\\n  -H \"Content-Type: application/json\"\n```\n\n**Expected Response Structure:**\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"context\": {\n      \"memory\": { \"recent\": [], \"pending_reviews\": [] },\n      \"signals\": { \"unprocessed\": [], \"high_priority\": [] },\n      \"proposals\": { \"pending_approval\": [], \"recently_approved\": [], \"recently_rejected\": [] },\n      \"operations\": { \"queue_health\": {}, \"worker_status\": {}, \"error_rate\": 0 },\n      \"time\": { \"current\": \"2026-06-09T...\", \"last_observe\": \"never\", \"staleness_items\": [] }\n    },\n    \"reasoning\": {\n      \"timestamp\": \"2026-06-09T...\",\n      \"context_summary\": \"...\",\n      \"observations\": [...],\n      \"concerns\": [...],\n      \"opportunities\": [...],\n      \"suggested_actions\": [...]\n    },\n    \"proposals\": []\n  }\n}\n```\n\n---\n\n### Step 1.4: Monitor Cron Execution\n\n```bash\n# Tail Twin logs (watch for 5-minute cron triggers)\nwrangler tail twin-orchestrator --env dev\n```\n\n**Expected Log Output (every 5 minutes):**\n\n```\n[Twin Orchestrator] Scheduled trigger: */5 * * * *\n[Twin] Context built: { memory_items: 0, signals: 0, proposals: 0 }\n[Twin] Reasoning complete: { observations: 2, concerns: 0, suggested_actions: 0 }\n[Twin] Observe loop complete\n```\n\n---\n\n## Phase 2: AGENT RUNTIME (Wire OWUI to Twin)\n\n### Architecture Change\n\n**Before:**\n\n```\nOWUI → LiteLLM → OpenRouter/Ollama → Response\n```\n\n**After:**\n\n```\nOWUI → Twin Runtime API → Intelligence → OpenRouter Agents → Response\n```\n\n---\n\n### Step 2.1: Add Twin Runtime Endpoint to Twin Orchestrator\n\nThe Twin Orchestrator needs an OpenAI-compatible `/v1/chat/completions` endpoint so OWUI can talk to it.\n\n**File:** `/Users/nirmal/Github/integratewise-live/services/twin-orchestrator/src/index.ts`\n\n**Add this endpoint:**\n\n```typescript\n// ============================================================================\n// OpenAI-Compatible Chat Endpoint (for OWUI)\n// ============================================================================\n\napp.post(\"/v1/chat/completions\", async (c) => {\n  const tenantId = c.req.header(\"x-tenant-id\") || \"iw-customer-zero\";\n  const body = await c.req.json();\n\n  try {\n    const { messages, model, stream = false, ...options } = body;\n\n    // Build Twin context (what the Twin knows right now)\n    const context = await buildTwinContext(c.env, tenantId);\n\n    // Inject Twin context into system message\n    const systemMessage = {\n      role: \"system\",\n      content: `You are the Twin cognitive orchestrator for IntegrateWise.\n\nCurrent Twin Context:\n- Memory: ${context.memory.recent.length} recent items\n- Signals: ${context.signals.unprocessed.length} unprocessed (${context.signals.high_priority.length} high priority)\n- Proposals: ${context.proposals.pending_approval.length} pending approval\n- Last observe: ${context.time.last_observe}\n\nYou can:\n1. Answer questions about system state\n2. Propose actions (requires approval)\n3. Query memory, signals, proposals via tools\n4. Coordinate execution (via governance)\n\nYou cannot:\n- Execute actions directly (always propose → approve → execute)\n- Write to memory directly (via Triage Bot only)\n- Write to Spine directly (via Pipeline only)`,\n    };\n\n    // Combine system message + user messages\n    const augmentedMessages = [systemMessage, ...messages];\n\n    // Forward to Intelligence worker (which uses OpenRouter Agents)\n    const response = await c.env.INTELLIGENCE.fetch(\n      new Request(\"http://internal/v1/ai/agent\", {\n        method: \"POST\",\n        headers: {\n          \"Content-Type\": \"application/json\",\n          \"x-tenant-id\": tenantId,\n        },\n        body: JSON.stringify({\n          model: model || \"openrouter/auto\",\n          messages: augmentedMessages,\n          stream,\n          ...options,\n        }),\n      })\n    );\n\n    // Return OpenAI-compatible response\n    if (stream) {\n      return new Response(response.body, {\n        headers: {\n          \"Content-Type\": \"text/event-stream\",\n          \"Cache-Control\": \"no-cache\",\n          Connection: \"keep-alive\",\n        },\n      });\n    } else {\n      const data = await response.json();\n      return c.json({\n        id: `chatcmpl-${Date.now()}`,\n        object: \"chat.completion\",\n        created: Math.floor(Date.now() / 1000),\n        model: model || \"twin-orchestrator\",\n        choices: [\n          {\n            index: 0,\n            message: {\n              role: \"assistant\",\n              content: data.content || data.data?.content || \"\",\n            },\n            finish_reason: \"stop\",\n          },\n        ],\n        usage: data.usage || { prompt_tokens: 0, completion_tokens: 0, total_tokens: 0 },\n      });\n    }\n  } catch (err: any) {\n    console.error(\"[Twin Chat] Error:\", err);\n    return c.json({ error: { message: err.message, type: \"twin_error\" } }, { status: 500 });\n  }\n});\n\n// Also add models endpoint for OWUI compatibility\napp.get(\"/v1/models\", (c) => {\n  return c.json({\n    object: \"list\",\n    data: [\n      {\n        id: \"twin-orchestrator\",\n        object: \"model\",\n        created: 1717900800,\n        owned_by: \"integratewise\",\n        permission: [],\n        root: \"twin-orchestrator\",\n        parent: null,\n      },\n    ],\n  });\n});\n```\n\n---\n\n### Step 2.2: Redeploy Twin Orchestrator with Chat Endpoint\n\n```bash\ncd /Users/nirmal/Github/integratewise-live/services/twin-orchestrator\n\nunset CLOUDFLARE_API_TOKEN\nwrangler deploy --env dev\n```\n\n**Test the Chat Endpoint:**\n\n```bash\ncurl -X POST https://twin.dev.integratewise.ai/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-tenant-id: iw-customer-zero\" \\\n  -d '{\n    \"model\": \"twin-orchestrator\",\n    \"messages\": [\n      {\"role\": \"user\", \"content\": \"What is the current system state?\"}\n    ]\n  }'\n```\n\n**Expected Response:**\n\n```json\n{\n  \"id\": \"chatcmpl-1234567890\",\n  \"object\": \"chat.completion\",\n  \"created\": 1717900800,\n  \"model\": \"twin-orchestrator\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": \"Based on my observation:\\n- Memory: 0 recent items\\n- Signals: 0 unprocessed\\n- Proposals: 0 pending approval\\n\\nThe system is currently idle. No actions are needed at this time.\"\n      },\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": { \"prompt_tokens\": 150, \"completion_tokens\": 50, \"total_tokens\": 200 }\n}\n```\n\n---\n\n### Step 2.3: Update OWUI to Use Twin Runtime\n\n**VPS SSH:**\n\n```bash\nssh root@187.127.166.105\ncd /root/vps-operations-stack/openwebui\n```\n\n**Edit `.env`:**\n\n```bash\nnano .env\n```\n\n**Add:**\n\n```env\n# Twin Runtime API (Cloudflare Worker)\nTWIN_RUNTIME_URL=https://twin.dev.integratewise.ai\n```\n\n**Edit `docker-compose.yml`:**\n\n```bash\nnano docker-compose.yml\n```\n\n**Update `open-webui` service environment:**\n\n```yaml\nservices:\n  open-webui:\n    # ... existing config ...\n    environment:\n      # ... existing vars ...\n\n      # CHANGE THIS: Point to Twin Runtime instead of LiteLLM\n      OPENAI_API_BASE_URL: https://twin.dev.integratewise.ai\n\n      # Keep LiteLLM key for auth (or use a Twin-specific key)\n      OPENAI_API_KEY: ${LITELLM_MASTER_KEY}\n\n      # ... rest of config ...\n```\n\n**Restart OWUI:**\n\n```bash\ndocker-compose down\ndocker-compose up -d\n```\n\n---\n\n### Step 2.4: Test OWUI → Twin Runtime\n\n1. Open https://twin.operations.integratewise.ai\n2. Start a new chat\n3. Select model: \"twin-orchestrator\" (should appear in model list)\n4. Send message: \"What is the current system state?\"\n5. Verify: Response includes Twin context (memory, signals, proposals)\n\n**Expected Response:**\n\n```\nBased on my observation:\n- Memory: 0 recent items\n- Signals: 0 unprocessed\n- Proposals: 0 pending approval\n\nThe system is currently idle. No actions are needed at this time.\n```\n\n---\n\n## Phase 3: CUSTOMER ZERO LOADING\n\nNow that Twin Runtime is deployed and OWUI is wired, load Customer Zero data.\n\n### Step 3.1: Create Load Script\n\n**File:** `/Users/nirmal/Github/integratewise-ops/vps-operations-stack/scripts/load-customer-zero-cf.mjs`\n\n```javascript\n#!/usr/bin/env node\n/**\n * Load Customer Zero data into Cloudflare Workers\n * - Entities → Pipeline → Spine\n * - Signals → Intelligence\n * - Proposals → Governance (via MCP)\n * - Memory → Triage Bot → Conversational Memory\n */\n\nconst TENANT_ID = \"iw-customer-zero\";\nconst PIPELINE_URL = \"https://pipeline.dev.integratewise.ai\";\nconst MCP_URL = \"https://mcp.dev.integratewise.ai\";\nconst GATEWAY_URL = \"https://gateway.dev.integratewise.ai\";\n\n// Customer Zero Entities\nconst entities = [\n  {\n    type: \"Person\",\n    name: \"Nirmal Patel\",\n    email: \"nirmal@integratewise.ai\",\n    role: \"Founder\",\n    traits: [\"decision_maker\", \"technical_user\"],\n  },\n  {\n    type: \"Account\",\n    name: \"IntegrateWise\",\n    domain: \"integratewise.ai\",\n    industry: \"SaaS\",\n    employees: 1,\n    traits: [\"b2b\", \"technical\"],\n  },\n  {\n    type: \"Deal\",\n    name: \"Customer Zero Onboarding\",\n    value: 0,\n    stage: \"active\",\n    close_date: \"2026-06-30\",\n    traits: [\"self_serve\", \"internal\"],\n  },\n];\n\n// Customer Zero Signals\nconst signals = [\n  {\n    entity_id: \"deal-customer-zero\",\n    signal_type: \"milestone_approaching\",\n    severity: \"medium\",\n    description: \"Customer Zero onboarding deadline: 2026-06-30 (21 days)\",\n    suggested_action: \"Review onboarding progress and adjust timeline if needed\",\n  },\n];\n\n// Customer Zero Proposals\nconst proposals = [\n  {\n    type: \"review_system_state\",\n    title: \"Daily System Health Review\",\n    description: \"Twin should review system health daily and surface any concerns\",\n    impact: \"medium\",\n    risk: \"low\",\n    urgency: \"medium\",\n    confidence: 0.9,\n  },\n];\n\n// Customer Zero Memory Episodes\nconst memoryEpisodes = [\n  {\n    type: \"episode\",\n    title: \"Twin Architecture Finalized — 2026-06-09\",\n    content:\n      \"Canonical architecture established: One Twin, One Spine, One Memory, One Governance, One Bridge. Twin Runtime deployed as CF Worker.\",\n    scope: \"org\",\n    tags: [\"architecture\", \"twin\", \"milestone\"],\n  },\n  {\n    type: \"decision\",\n    title: \"CF Worker First (Not VPS)\",\n    content:\n      \"Decision: Deploy Twin Runtime as Cloudflare Worker first, not VPS. Reasoning: Better integration with existing CF infrastructure, edge performance, easier scaling.\",\n    alternatives_considered: [\"VPS deployment\", \"Hybrid approach\"],\n    scope: \"org\",\n    tags: [\"architecture\", \"twin\", \"decision\"],\n  },\n];\n\nasync function loadCustomerZero() {\n  console.log(\"🚀 Loading Customer Zero data...\\n\");\n\n  // 1. Load Entities\n  console.log(\"1️⃣  Loading entities...\");\n  for (const entity of entities) {\n    try {\n      const response = await fetch(`${PIPELINE_URL}/v1/intake`, {\n        method: \"POST\",\n        headers: {\n          \"Content-Type\": \"application/json\",\n          \"x-tenant-id\": TENANT_ID,\n        },\n        body: JSON.stringify({\n          source: \"customer-zero-load\",\n          data: entity,\n        }),\n      });\n      const result = await response.json();\n      console.log(`   ✅ ${entity.type}: ${entity.name} → ${result.spine_id || result.entity_id}`);\n    } catch (err) {\n      console.error(`   ❌ ${entity.type}: ${entity.name} → ${err.message}`);\n    }\n  }\n\n  // 2. Load Signals\n  console.log(\"\\n2️⃣  Loading signals...\");\n  for (const signal of signals) {\n    try {\n      const response = await fetch(`${GATEWAY_URL}/api/v1/signals`, {\n        method: \"POST\",\n        headers: {\n          \"Content-Type\": \"application/json\",\n          \"x-tenant-id\": TENANT_ID,\n        },\n        body: JSON.stringify(signal),\n      });\n      const result = await response.json();\n      console.log(`   ✅ Signal: ${signal.signal_type}`);\n    } catch (err) {\n      console.error(`   ❌ Signal: ${signal.signal_type} → ${err.message}`);\n    }\n  }\n\n  // 3. Load Proposals\n  console.log(\"\\n3️⃣  Loading proposals...\");\n  for (const proposal of proposals) {\n    try {\n      const response = await fetch(`${MCP_URL}/tools/proposal.create`, {\n        method: \"POST\",\n        headers: {\n          \"Content-Type\": \"application/json\",\n          \"x-tenant-id\": TENANT_ID,\n        },\n        body: JSON.stringify(proposal),\n      });\n      const result = await response.json();\n      console.log(`   ✅ Proposal: ${proposal.title}`);\n    } catch (err) {\n      console.error(`   ❌ Proposal: ${proposal.title} → ${err.message}`);\n    }\n  }\n\n  // 4. Load Memory Episodes\n  console.log(\"\\n4️⃣  Loading memory episodes...\");\n  for (const episode of memoryEpisodes) {\n    try {\n      const response = await fetch(`${MCP_URL}/tools/memory.write_conversational`, {\n        method: \"POST\",\n        headers: {\n          \"Content-Type\": \"application/json\",\n          \"x-tenant-id\": TENANT_ID,\n        },\n        body: JSON.stringify({\n          session_id: \"customer-zero-onboarding\",\n          user_id: \"nirmal\",\n          role: \"system\",\n          content: JSON.stringify(episode),\n        }),\n      });\n      const result = await response.json();\n      console.log(`   ✅ Memory: ${episode.title}`);\n    } catch (err) {\n      console.error(`   ❌ Memory: ${episode.title} → ${err.message}`);\n    }\n  }\n\n  console.log(\"\\n✅ Customer Zero data loaded!\\n\");\n  console.log(\"🔍 Verify:\");\n  console.log(\n    \"   curl https://twin.dev.integratewise.ai/v1/twin/observe -H 'x-tenant-id: iw-customer-zero' -X POST\"\n  );\n}\n\nloadCustomerZero();\n```\n\n---\n\n### Step 3.2: Run Load Script\n\n```bash\ncd /Users/nirmal/Github/integratewise-ops/vps-operations-stack/scripts\n\nchmod +x load-customer-zero-cf.mjs\nnode load-customer-zero-cf.mjs\n```\n\n**Expected Output:**\n\n```\n🚀 Loading Customer Zero data...\n\n1️⃣  Loading entities...\n   ✅ Person: Nirmal Patel → person-123\n   ✅ Account: IntegrateWise → account-456\n   ✅ Deal: Customer Zero Onboarding → deal-789\n\n2️⃣  Loading signals...\n   ✅ Signal: milestone_approaching\n\n3️⃣  Loading proposals...\n   ✅ Proposal: Daily System Health Review\n\n4️⃣  Loading memory episodes...\n   ✅ Memory: Twin Architecture Finalized — 2026-06-09\n   ✅ Memory: CF Worker First (Not VPS)\n\n✅ Customer Zero data loaded!\n\n🔍 Verify:\n   curl https://twin.dev.integratewise.ai/v1/twin/observe -H 'x-tenant-id: iw-customer-zero' -X POST\n```\n\n---\n\n### Step 3.3: Verify Twin Sees Customer Zero Data\n\n```bash\ncurl -X POST https://twin.dev.integratewise.ai/v1/twin/observe \\\n  -H \"x-tenant-id: iw-customer-zero\" \\\n  -H \"Content-Type: application/json\" | jq\n```\n\n**Expected Response:**\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"context\": {\n      \"memory\": {\n        \"recent\": [\n          {\"title\": \"Twin Architecture Finalized — 2026-06-09\", ...},\n          {\"title\": \"CF Worker First (Not VPS)\", ...}\n        ]\n      },\n      \"signals\": {\n        \"unprocessed\": [\n          {\"signal_type\": \"milestone_approaching\", ...}\n        ],\n        \"high_priority\": []\n      },\n      \"proposals\": {\n        \"pending_approval\": [\n          {\"title\": \"Daily System Health Review\", ...}\n        ]\n      },\n      \"spine\": {\n        \"entity_count\": 3,\n        \"recent_changes\": [...]\n      }\n    },\n    \"reasoning\": {\n      \"observations\": [\n        \"Customer Zero onboarding is active\",\n        \"1 signal requires attention (milestone approaching)\",\n        \"1 proposal pending approval\"\n      ],\n      \"concerns\": [\"Milestone approaching: Customer Zero onboarding deadline in 21 days\"],\n      \"suggested_actions\": [\n        {\n          \"type\": \"review_milestone\",\n          \"reasoning\": \"Customer Zero onboarding deadline approaching\",\n          \"impact\": \"medium\",\n          \"urgency\": \"medium\"\n        }\n      ]\n    }\n  }\n}\n```\n\n---\n\n### Step 3.4: Test OWUI with Customer Zero Context\n\n1. Open https://twin.operations.integratewise.ai\n2. Start new chat with Twin\n3. Ask: \"What needs my attention today?\"\n4. Verify Twin response includes:\n   - Customer Zero onboarding milestone\n   - Pending proposal for daily health review\n   - System state summary\n\n**Expected Response:**\n\n```\nHere's what needs your attention:\n\n🔴 Milestone Approaching\nCustomer Zero onboarding deadline is in 21 days (2026-06-30). Review progress to ensure we're on track.\n\n📋 Pending Proposal\n\"Daily System Health Review\" is awaiting approval. This would enable me to proactively monitor system health and surface concerns.\n\n📊 System State\n- 3 entities in Spine (1 person, 1 account, 1 deal)\n- 1 unprocessed signal\n- 1 pending proposal\n- 2 memory items\n\nWould you like me to propose any actions?\n```\n\n---\n\n## Success Criteria\n\n### ✅ Phase 1 Complete When:\n\n- [ ] Intelligence worker deployed (`intelligence.dev.integratewise.ai`)\n- [ ] Twin Orchestrator deployed (`twin.dev.integratewise.ai`)\n- [ ] Health checks return 200 OK\n- [ ] Cron triggers fire every 5 minutes\n- [ ] Manual `/v1/twin/observe` works\n\n### ✅ Phase 2 Complete When:\n\n- [ ] Twin Runtime has `/v1/chat/completions` endpoint\n- [ ] OWUI `OPENAI_API_BASE_URL` points to Twin Runtime\n- [ ] OWUI chat shows \"twin-orchestrator\" model\n- [ ] Chat responses include Twin context\n\n### ✅ Phase 3 Complete When:\n\n- [ ] Customer Zero entities loaded (3 entities in Spine)\n- [ ] Customer Zero signals loaded (1 signal)\n- [ ] Customer Zero proposals loaded (1 proposal)\n- [ ] Customer Zero memory loaded (2 episodes)\n- [ ] Twin observe returns populated context\n- [ ] OWUI chat includes Customer Zero data in responses\n\n---\n\n## Next Steps After This\n\n1. **Wire OWUI Skills** — Add MCP tool server for Twin to use tools\n2. **Deploy Browser Agent** — Enable Twin to execute via browser automation\n3. **Implement Triage Bot** — Memory governance worker\n4. **Enable Governance Queue** — HITL approval in OWUI or L2\n5. **Morning Brief Workflow** — Daily summary via voice/email\n\n---\n\n## Deployment Commands Summary\n\n```bash\n# Phase 1: Deploy CF Workers\ncd /Users/nirmal/Github/integratewise-live/services/intelligence\nunset CLOUDFLARE_API_TOKEN\nwrangler deploy --env dev\n\ncd ../twin-orchestrator\nunset CLOUDFLARE_API_TOKEN\nwrangler deploy --env dev\n\n# Phase 2: Update OWUI\nssh root@187.127.166.105\ncd /root/vps-operations-stack/openwebui\n# Edit docker-compose.yml → OPENAI_API_BASE_URL=https://twin.dev.integratewise.ai\ndocker-compose down && docker-compose up -d\n\n# Phase 3: Load Customer Zero\ncd /Users/nirmal/Github/integratewise-ops/vps-operations-stack/scripts\nnode load-customer-zero-cf.mjs\n```\n\n---\n\n**Ready to execute!** 🚀\n\nThe Twin Runtime (Agent) is already built, just needs deployment + wiring.\n"}