Runtime wiring

Integrations

Accurate demo wiring for Tradie Front Office AI. Live cards are working in the deployed prototype; anything not end-to-end yet is marked Coming Soon.

Demo surface
Live channels
Voice, SMS, email, web

Twilio, Cloudflare Email, and Hono API routes feed the unified inbox.

System of record
Cloudflare D1

Demo events, service windows, rate cards, jobs, inquiries, agent config, and memory chunks live in D1.

Agent runtime
Workers AI + Memory

Kimi K2.6 uses Agent Memory for policy answers and deterministic tools for pricing and availability.

Live Now

These integrations are wired into the current demo flow.

Cloudflare Core

Live

Pages/Hono runtime with D1, KV, and Workers AI bindings configured in wrangler.jsonc.

Bindings: DB, KV, AI. Prod D1: tradie-front-office-db
Cloudflare PagesD1 databaseWorkers KV bindingHono API routes

Workers AI / Kimi K2.6

Live

Primary agent reasoning loop. The model receives relevant Agent Memory context, then calls server-side tools for availability, pricing, job, payment stubs, and escalation.

Model: @cf/moonshotai/kimi-k2.6. Direct Workers AI binding.
Agent tool loopMemory contextcheck_availabilityquote_price

Agent Memory

Live

Staff can upload PDFs or paste policies, convert them to Markdown, store D1 chunks, and retrieve relevant snippets across web, email, SMS, and voice.

Routes: /agent-memory and /api/agent-memory/*. Storage: agent_memory_documents + agent_memory_chunks.
PDF to MarkdownD1 chunk retrievalEnable/disable docsStaff-visible sources

Cloudflare Email Service

Live

Inbound business email is parsed by the email worker, stored in D1, sent through the agent, and replied to by email.

From: jobs@tradie-front-office-ai.pages.dev. EMAIL binding plus REST sender path.
Inbound email workerOutbound repliesThread memoryInbox event log

Twilio Voice + SMS

Live

The purchased demo number handles inbound SMS and voice webhooks, verifies Twilio signatures, and records the full conversation in the dashboard.

Live number: +1 (807) 805-3625. Vanity: (807) 805-DOCK.
Inbound SMS webhookVoice webhookSignature checksDashboard inbox trace

ElevenLabs

Live

Voice generation is wired for the agent config preview and Twilio audio playback when the reply is suitable for generated speech.

Routes: /api/tts/voices, /api/tts/generate, /api/tts/speak.
Voice previewsGenerated speechTwilio audio playbackConfigurable voice ID

Google OAuth

Live

Dashboard authentication uses Google OAuth and signed JWT cookies when the production secrets are present.

Secrets: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, SESSION_SECRET.
Google sign-inJWT session cookieProtected dashboard routesDemo fallback in dev

Fallbacks Live

Secondary paths that are working, but not the primary demo route.

Resend Fallback

Live

Outbound email fallback for agent replies when Cloudflare Email is unavailable or deliberately bypassed.

Live fallback: RESEND_API_KEY + jobs@piosol.resend.app. Cloudflare Email remains primary.
Fallback senderDomain emailAgent repliesDelivery backup

Coming Soon

The codebase has stubs or planned surfaces, but these are not production-grade integrations yet.

ServiceM8

Coming Soon

Future business-management sync for confirmed jobs, customer profiles, and service window inventory.

Today: book_job writes to D1; the external ServiceM8 API call is mocked.
Job write-backService window inventory syncCustomer profile importRate card sync

Stripe Checkout

Coming Soon

Future payment-link generation for deposits, callout fees, and job balance collection.

Today: take_payment is a demo stub; no Checkout session or payment link is created.
Checkout sessionsPayment linksRefund workflowPayment webhooks

DocuSign + R2 Contracts

Coming Soon

Future signed service window agreements with generated PDFs, object storage, and e-signature delivery.

Today: draft_contract returns a work-order placeholder; no R2 bucket or e-signature API is bound.
Contract PDFsR2 storageE-sign linksEnvelope webhooks

Slack Escalations

Coming Soon

Future staff alerts when the agent needs a human handoff or a high-value job needs approval.

Today: escalate_to_human returns a stub notification payload; no Slack webhook is configured.
Escalation alertsJob notificationsDaily digestUrgent handoff

Cloudflare AI Gateway

Coming Soon

Future observability and controls for AI calls once the gateway is actually bound and used.

Today: Workers AI is called directly; AI Gateway is not bound in wrangler.jsonc.
AI request logsRate controlsCaching policyProvider routing

Runtime Surface

A quick truth table for the deployed Cloudflare and vendor surface. This replaces the old fake masked-secret list.

Cloudflare bindings
DB, KV, and AI on Pages; EMAIL on the email worker.
Live
Agent Memory
D1-backed policy documents and Workers AI Markdown Conversion are live.
Live
Primary email
Cloudflare Email Service from jobs@tradie-front-office-ai.pages.dev.
Live
Email fallback
Resend is live as a secondary outbound path from jobs@piosol.resend.app.
Live
Telephony
/api/sms and /api/voice/twilio receive the Twilio number webhooks.
Live
Text to speech
ElevenLabs routes are live when ELEVENLABS_API_KEY is present.
Live
Not bound yet
R2, Queues, Vectorize, Durable Objects, and AI Gateway.
Coming Soon
External business systems
ServiceM8, Stripe, DocuSign, and Slack.
Coming Soon