Skip to content
dawalnut
Menu

AI Telephony Platform

infrastructureactive
awsaicdktypescriptreact

Overview

A platform for deploying AI voice agents that answer phone calls, hold multi-turn conversations, use tools, and report outcomes. Built as three workspace packages in the dawalnut monorepo.

Architecture

  • Amazon Connect handles telephony (PSTN, SIP, queuing, Polly TTS)
  • Amazon Bedrock powers the AI conversation (Claude Sonnet with tool use)
  • EventBridge drives async side effects (analytics, webhooks)
  • DynamoDB stores everything in a single-table design with one GSI
  • API Gateway + Cognito expose a secured REST API
  • CloudFront + Lambda SSR serve the management dashboard

Infrastructure (4 CDK Stacks)

  • CertificateStack — subdomain zone, NS delegation, ACM wildcard cert (us-east-1)
  • AiStack — DynamoDB, API Gateway, 4 Lambdas, EventBridge, Cognito
  • ConnectStack — Connect instance, Lex bot, contact flow, queue
  • DashboardStack — CloudFront + Lambda SSR via the shared SsrSite construct

Lambda Handlers

  • AI Conversation — multi-turn conversation with Bedrock, tool use loop, event publishing
  • API — CRUD for agents, phone numbers, settings, call history, analytics, outbound calls
  • Analytics — EventBridge consumer for disconnect, outcome, and Contact Lens events
  • Webhook Delivery — HMAC/Bearer/API-key authenticated webhook dispatch with DLQ

Dashboard Features

  • Agent management with voice preview and tool configuration
  • Call history with transcript viewer and recording playback
  • Phone number claiming, releasing, and reassignment
  • Analytics charts (outcomes, sentiment, calls by day, agent usage)
  • Webhook and API key management
  • OAuth2 PKCE authentication via Cognito

Key Patterns

  • Shared domain package — Zod schemas, DynamoDB key builders, and constants used by all three workspaces
  • Single-table DynamoDB — composite keys with TENANT#, CALL#, PHONE# prefixes and one GSI for time-ordered queries
  • Event-driven architecture — EventBridge decouples the call path from analytics and webhooks
  • Fail-fast configuration — Zod validates CDK context at synth time and Lambda env vars at cold start
  • Shared Lambda utilities — DynamoDB client, env loader, Bedrock config builders, event publisher

Related Posts