Getting Started with CuboidPilot & Cai AI Agent
A step-by-step master reference for deploying Cai—your autonomous, semantically grounded AI customer service agent across Web Chat, WhatsApp Cloud API, custom knowledge bases, and live human counselor handoffs.
Interactive Setup Wizard
Follow our self-guided 6-step onboarding wizard to get live in under 10 minutes
5-Minute Quickstart
CuboidPilot provides a modern alternative to traditional, static chatbots. Instead of rigid decision trees that frustrate visitors, CuboidPilot employs Cai—an autonomous, semantically grounded AI Agent that acts as your 24/7 first-line support specialist and top inbound SDR.
Architecture & Security
CuboidPilot runs on an enterprise-grade multi-tenant architecture designed for low-latency customer interactions and strict data segregation:
| Component | Technology / Engine | Security & SLA |
|---|---|---|
| AI Runtime (Cai) | Semantic Vector Embeddings + RAG | < 0.8s Mean Latency • Sandbox Isolated |
| Website Widget | Lightweight Vanilla JS (< 12KB gzip) | Async Execution • Zero CWV Impact |
| WhatsApp Engine | Meta WhatsApp Cloud API v19.0 | End-to-End Encryption • HMAC Signatures |
| Closing Radar | Real-time Intent Scoring Pipeline | Instant WebSocket Push Alerts |
Step 1: Setting Up Your Business Profile
The onboarding begins at onboarding/business.html. Here you configure your organization's legal name, primary website URL, industry sector, and time zone.
Appears in Cai's initial greeting, official chat headers, and automated consultation invitations.
Domain whitelisted for CORS requests and secure widget script communication.
Selects pre-tuned semantic prompts (SaaS, Higher Ed, Clinics, Real Estate, E-Commerce, etc.).
Calibrates human counselor business hours vs. 24/7 autonomous AI coverage.
Step 2: Defining Strategic Goals & Workflow
At onboarding/goals.html, you establish the primary mission for CuboidPilot. Your choice dictates how aggressively Cai engages visitors and when it initiates lead capture forms:
Support & Deflection
Prioritizes answering repetitive Tier-1 questions strictly from docs. Intervenes with human counselors only when visitors explicitly ask for human assistance.
Inbound Sales & SDR
Discovers prospect team size, budget, timeline, and booking intent during natural conversation before automatically qualifying and routing to sales.
WhatsApp Continuity
Converts desktop drop-offs into persistent WhatsApp threads, allowing counselors to follow up without spamming emails or losing past chat context.
Hybrid Autonomous Desk
Combines 24/7 instant FAQ resolution with intelligent commercial opportunity detection, Closing Radar alerts, and seamless human counselor takeover.
Step 3: Cai Knowledge & Document Grounding
Located at onboarding/ai.html, this is the cognitive core of your AI Agent. Cai's answers are 100% grounded in the verified data sources you supply here.
PDF & Manuals
Upload product catalogues, technical manuals, SLA policies, and terms of service. Parsed and chunked in seconds.
URL & Sitemaps
Provide your website or help center URL (e.g., https://acme.com/help) to crawl and index public pages automatically.
Curated Q&A Pairs
Explicit question-and-answer pairs for sensitive policies (refunds, enterprise discounts, SLA commitments) requiring word-for-word precision.
Configure Cai's confidence boundary in settings:
Cai only answers if the inquiry is directly cited in the uploaded documents. Recommended for healthcare, compliance, and legal services.
Synthesizes contextual answers across multiple related paragraphs. Recommended for B2B SaaS, sales discovery, and general marketing.
Step 4: Website Widget Integration
Onboarding screen onboarding/website.html generates your unique embed snippet. Copy and paste this single script snippet into your website before the closing </body> tag:
<!-- CuboidPilot Cai AI Agent Widget -->
<script
src="https://cai.cuboidsoft.in/widget.js?v=7.1"
data-company="cp_live_cuboidsoft"
data-color="#111111"
data-position="right"
async>
</script>
Paste into Theme Settings → Custom Code → Footer or via the free WPCode plugin.
Go to Online Store → Themes → Edit Code → theme.liquid and paste immediately before </body>.
Go to Project Settings → Custom Code → Footer Code, paste the snippet, and publish your site.
Step 5: WhatsApp Cloud API & Mobile Continuity
At onboarding/whatsapp.html, you connect your official WhatsApp Business Account. This powers 1-Tap WhatsApp Continuity.
Retrieved from Meta for Developers → WhatsApp → API Setup. Identifies your specific outbound phone number.
Your official business profile container inside Meta Business Manager.
Bearer token generated under Business Settings → System Users with whatsapp_business_messaging permissions.
Notification & Triage Rules
CuboidPilot protects your counselors from notification fatigue with configurable alerts:
Alerts counselors only when budget and use case requirements are confirmed.
Instantly alerts on-duty counselors when a visitor asks to speak with a human.
Sends a warm follow-up prompt if a visitor lingers on pricing without checking out.
Step 6: Simulator Verification & Going Live
The final onboarding step at onboarding/ready.html runs an automated system health check before opening your live desk:
Managing Knowledge Documents & Ongoing Grounding
As your business evolves, keep Cai up to date through app/knowledge.html:
Upload new PDF policies or add promotional pricing sheets. Indexing and vectorization complete in under 30 seconds.
Click Re-crawl URLs to fetch fresh documentation from your blog, changelog, or help documentation root.
Audits customer inquiries where Cai's confidence was below threshold, allowing you to add Q&A pairs with 1 click.
Real-Time Live Chat Takeover
Inside app/conversations.html, counselors monitor active visitor sessions across Web and WhatsApp in real time:
While Cai responds, incoming and outgoing messages stream with subtle green AI badges.
Pressing Take Over immediately pauses AI for that thread and notifies the customer that a counselor has joined.
When typing as a counselor, Cai generates recommended reply drafts grounded in your verified knowledge base.
Closing Radar & Commercial Intent Scoring
The app/closing-radar.html module automatically categorizes active visitors into 3 commercial intent tiers:
General browsing, basic FAQ queries. Cai answers autonomously with zero human intervention required.
Comparing plans, inquiring about integrations, or visited pricing page > 2 times in the session.
Explicit team size provided, enterprise SLA requested, or calendar demo booking initiated.
Client JavaScript SDK Reference
The CuboidPilot widget exposes a lightweight global JavaScript API on window.Cai for programmatically triggering chats, passing user attributes, or binding to custom buttons on your site:
// 1. Open the Cai chat widget window
window.Cai && window.Cai.open();
// 2. Close the Cai chat widget window
window.Cai && window.Cai.close();
// 3. Pass authenticated user context from your app session
window.Cai && window.Cai.identify({
userId: "user_98124",
name: "Arjun Mehta",
email: "arjun@example.com",
plan: "Enterprise",
company: "Nexora Systems"
});
// 4. Trigger a contextual prompt or question automatically
window.Cai && window.Cai.prompt("Tell me about the Enterprise SLA options");
Channels & Integrations — Setup Manual
CuboidPilot features a centralized Multi-Channel Hub at app/channels.html. Connect your official WhatsApp, Instagram DMs, Google Calendar, Email (SMTP), Google Sheets, and CRMs. Whether you are a business owner or non-technical manager, each channel is live in under 5 minutes.
1. WhatsApp Business (Official Meta Cloud API)
2-Way Autonomous AI Chat, Inbound Lead Capture & Outbound Broadcasts- A free Meta Developer account at developers.facebook.com
- A clean phone number (not currently registered on personal WhatsApp app)
- Access to your CuboidPilot Channels hub (
app/channels.html)
- Phone Number ID (e.g.,
108294829104812) - WhatsApp Business Account ID (WABA ID) (e.g.,
102938192830192) - Temporary / Permanent Access Token (starts with
EAA...)
https://cai.cuboidsoft.in/api/webhooks/whatsapp.php
cuboid_whatsapp_verify
messages and message_template_status_update.app/channels.html, click on the WhatsApp card → Paste your Phone Number ID, WABA ID, and Token → Click Save & Connect. Your AI Assistant is now live on WhatsApp!
2. Instagram Direct Messages (Meta Graph API)
Auto-Reply to Story Replies, Reels Comments & Inbound DMs with Lead SyncYour Instagram account must be a Professional / Business / Creator account (Free in Instagram mobile app under Settings > Account Type). It must be linked to an official Facebook Page.
https://cai.cuboidsoft.in/api/instagram_webhook.php
cuboid_ig_verify
messages and messaging_postbacks.app/channels.html, click Instagram → Enter your Instagram Username, Connected Facebook Page ID, and Access Token → Click Save & Activate.
3. Google Calendar & Google Meet
2-Way Conflict Checking & Automated Video Demo Meeting Scheduling
Open Google Cloud Console → create a new project (e.g. Cai Calendar Integration) or select an existing one → navigate to APIs & Services > Library → search for Google Calendar API → click Enable.
In the sidebar, go to APIs & Services > OAuth consent screen:
- Select User Type: External → click Create.
- App Name:
Cai AI Assistant(or your company brand). - User support & Developer email: Enter your business Google account email.
- Scopes: Click Add or Remove Scopes → select
.../auth/calendar.events(Manage events). - Test Users: Add your Google email address → Save and Continue.
Go to APIs & Services > Credentials → click + Create Credentials > OAuth client ID → select Application type: Web application.
https://cai.cuboidsoft.in
https://cai.cuboidsoft.in/google_callback.php
https://developers.google.com/oauthplayground
To let Cai schedule consultations and generate Meet links autonomously 24/7:
- Open Google OAuth 2.0 Playground .
- Click the Gear icon ⚙️ in the top right.
- Check "Use your own OAuth credentials" and paste your Client ID & Client Secret.
- In Step 1 on the left, select Google Calendar API v3 > .../auth/calendar.events → click Authorize APIs.
- In Step 2, click Exchange authorization code for tokens → copy the generated Refresh token (format:
1//04...).
Open app/channels.html → click Google Calendar & Meet > Configure:
primary (or your Google Workspace email)4. Calendly (Instant Link Booking)
Show Calendly Booking Cards & Meeting Pickers Inside the AI Widgethttps://calendly.com/your-company/consultation).
app/channels.html → Click Calendly → Paste your link → Toggle Enable → Click Save Changes.
Whenever a website visitor says "Can I book a demo?" or "Schedule a meeting", the AI displays a native 1-click booking card with your Calendly calendar right inside the chat window.
5. Company Email Account (SMTP • Gmail / Zoho / Outlook)
Team Invites, Instant Lead Email Alerts & AI Auto-Dispatching Platform Guides- Team Member Invitations: Invite coworkers to join your CRM workspace with a 1-click link.
- Instant Lead Email Alerts: Get an email notification immediately whenever someone leaves a phone number or inquiry.
- AI Visitor Document Dispatch: When a visitor asks for brochures or services, AI takes their email and dispatches it straight to their inbox.
- Go to your Google Account (myaccount.google.com/security) → Turn ON 2-Step Verification.
- Search for "App Passwords" (or visit myaccount.google.com/apppasswords).
- Enter app name
CuboidPilotand click Create → Copy the 16-character password shown.
app/channels.html → Click Company Email → Fill the fields:
smtp.gmail.com (or mail.yourdomain.com)
587 (TLS) • 465 (SSL)
your-email@gmail.com
[16-char App Password]
6. Google Sheets (Real-Time Auto-Append)
Append Every Inbound Lead & Contact Details into a Live Spreadsheet RowCuboidPilot Inbound Leads 2026).
function doPost(e) {
try {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var payload = JSON.parse(e.postData.contents);
var data = payload.data || payload;
// Optional: target specific tab if provided
var sName = payload.sheet_name || (data && data.sheet_name);
if (sName) {
var targetTab = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sName);
if (targetTab) sheet = targetTab;
}
if (sheet.getLastRow() === 0) {
sheet.appendRow(["Timestamp", "Lead Name", "Phone", "Email", "Intent / Service", "Estimated Value", "AI Summary", "Channel"]);
sheet.getRange(1, 1, 1, 8).setFontWeight("bold").setBackground("#e6f4ea");
}
sheet.appendRow([
new Date().toLocaleString("en-IN", { timeZone: "Asia/Kolkata" }),
data.name || data.customer_name || "Prospect",
data.phone || "",
data.email || "",
data.interested_service || data.intent || "General Inquiry",
data.budget || data.opportunity_value || "",
data.summary || data.ai_summary || "",
payload.source || "Website Widget"
]);
return ContentService.createTextOutput(JSON.stringify({ status: "success", row: sheet.getLastRow() }))
.setMimeType(ContentService.MimeType.JSON);
} catch (err) {
return ContentService.createTextOutput(JSON.stringify({ status: "error", message: err.toString() }))
.setMimeType(ContentService.MimeType.JSON);
}
}
app/channels.html, click Google Sheets → Paste your Web app URL → Click Connect & Test. Every new lead will appear in your Google Sheet within 2 seconds!
7. TeleCRM (Direct Pipeline Sync)
Auto-push Captured Leads with Caller Notes, Intent Tags & Auto-Call Queueapp/channels.html, click TeleCRM → Paste your API Key → Click Save & Activate.
When a website or WhatsApp prospect provides their contact number, they are instantly created as a New Lead in your TeleCRM mobile app, ready for your calling team to dial with 1 tap.
8. Zoho CRM • 9. HubSpot • 10. Salesforce
Active 2-Way SyncEnterprise CRM Lead Dossier, Automated Contact Enrichment & Opportunity Pipeline Orchestration
Zoho CRM Integration
Server-Based AppDirect v2.1 REST API • Global multi-region data centers (.in, .com, .eu, .com.au)
Register Server App
Go to Zoho Developer Console , click Add Client, and choose Server-based Applications.
CuboidPilot Caicai.cuboidsoft.inAuthorized Callback
Paste the CuboidPilot OAuth redirect endpoint into Zoho's Authorized Redirect URIs field:
https://cai.cuboidsoft.in/zoho_callback.php
Bind Credentials
Copy Client ID, Client Secret & Refresh Token from Zoho, open Cai Channels, select your region, and save.
What Cai Automatically Syncs with Zoho CRM
Extracts name, phone, verified email, and company with zero manual data entry.
Writes AI commercial score (Tier 1 High, Tier 2 Warm, Tier 3 Info) into custom CRM field.
Full WhatsApp & website conversation logs appended directly to the Zoho Contact timeline.
Instantly spawns a Deal in Zoho Sales Pipeline when prospect confirms budget or schedule.
11. Custom Webhooks, Zapier & Make (Integromat)
Connect to 5,000+ Apps via HTTP POST JSON Streamingapp/channels.html, click Custom Webhook → Paste your URL → Click Save & Send Test Ping.
X-Cuboid-Signature: sha256=[HMAC-HEX]Universal Outbound Webhooks & Events Specification
Configure custom HTTP POST webhooks in app/channels.html to stream real-time events to your proprietary backend, AWS Lambda, Zapier, or Make. Every webhook request includes an X-Cuboid-Signature header generated via HMAC-SHA256 for cryptographic authentication.
https://api.yourdomain.com/cai/webhookapplication/jsonCuboidPilot-Webhook-Agent/2.4lead.qualifiedsha256=d5b4a9f381... (Hex Digest)1768924000Verifying Webhook Signatures (Node.js & PHP)
const crypto = require('crypto');
function verifySignature(req, signingSecret) {
const signature = req.headers['x-cuboid-signature'];
const expected = 'sha256=' + crypto
.createHmac('sha256', signingSecret)
.update(req.rawBody)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature || ''),
Buffer.from(expected)
);
}
$secret = 'whsec_your_signing_secret';
$rawPayload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_CUBOID_SIGNATURE'] ?? '';
$expected = 'sha256=' . hash_hmac('sha256', $rawPayload, $secret);
if (!hash_equals($expected, $signature)) {
http_response_code(401);
die('Signature verification failed');
}
Sample Event Payload (lead.qualified)
{
"event": "lead.qualified",
"id": "evt_983147891234",
"created_at": "2026-10-04T05:30:00Z",
"company_id": 1,
"data": {
"lead_id": 482,
"name": "Priya Sharma",
"phone": "+919876543210",
"email": "priya@zenithcorp.in",
"intent_score": "Tier 1 (High Commercial Intent)",
"intent_confidence": 0.94,
"summary": "Inquired regarding Enterprise Plan deployment, requested demo for 25 seats.",
"channel": "widget",
"conversation_id": "conv_89127"
}
}