{"slug": "build-an-edge-backend-for-a-telnyx-ai-assistant", "title": "Build an Edge Backend for a Telnyx AI Assistant", "summary": "Telnyx released a Go-based Edge Compute function that serves as a backend for its AI Assistant, enabling dynamic context and tool invocation during phone calls. The example demonstrates a home-services lead screener that resolves company names and schedules estimates using a single public URL, eliminating the need for separate servers or Docker setups. The pattern can be applied to various use cases like order tracking and appointment booking.", "body_md": "Voice AI demos get interesting when the assistant needs real backend context.\n\nIt is one thing to have an assistant answer a call. It is another thing to have that assistant greet the caller with dynamic context, collect information, call a backend tool, and read a confirmation back during the same phone call.\n\nThis Go example shows how to use one Telnyx Edge Compute function as the backend for a Telnyx AI Assistant.\n\nCode: [https://github.com/team-telnyx/telnyx-code-examples/tree/main/edge-ai-assistant-backend-go](https://github.com/team-telnyx/telnyx-code-examples/tree/main/edge-ai-assistant-backend-go)\n\nFull guide: [https://developers.telnyx.com/docs/edge-compute/guides/ai-assistant-backend](https://developers.telnyx.com/docs/edge-compute/guides/ai-assistant-backend)\n\nThe app is a Go Edge Compute function with one public URL.\n\nThat one URL handles two AI Assistant callbacks:\n\nIn the demo, the assistant is a home-services lead screener. It can resolve a company name for the greeting, then call a `schedule_estimate`\n\nwebhook tool after collecting enough information from the caller.\n\nUsually, the moment an AI assistant needs application context, you need to build a webhook server.\n\nThat means hosting, deployment, secrets, request verification, and a public URL.\n\nWith Edge Compute, that backend can live close to the Telnyx communications layer. You deploy a function, store secrets, and point the assistant callbacks to the function URL.\n\nNo separate server. No Docker setup. No Kubernetes just to answer a webhook.\n\nThe handler does three useful things:\n\nDynamic variables must be returned under a `dynamic_variables`\n\nkey:\n\n```\n{\n  \"dynamic_variables\": {\n    \"company_name\": \"Pinecrest Home Services\",\n    \"timeframe\": \"two business days\"\n  }\n}\n```\n\nThe webhook tool returns data the assistant can use in the live conversation:\n\n```\n{\n  \"scheduled_date\": \"2025-04-10\",\n  \"scheduled_time\": \"10:00\",\n  \"confirmation_number\": \"CONF-1715234567\",\n  \"estimate_id\": \"EST-1715234567\"\n}\n```\n\nScaffold a Go function:\n\n```\ntelnyx-edge new-func -l go -n edge-ai-assistant-backend\ncd edge-ai-assistant-backend\n```\n\nFetch your Telnyx public key and store it as an Edge secret:\n\n```\nPUBLIC_KEY=$(curl -s -H \"Authorization: Bearer $TELNYX_API_KEY\" \\\n  https://api.telnyx.com/v2/public_key | jq -r '.data.public')\n\ntelnyx-edge secrets add TELNYX_PUBLIC_KEY \"$PUBLIC_KEY\"\n```\n\nDeploy:\n\n```\ntelnyx-edge ship\ntelnyx-edge list\n```\n\nThen configure your AI Assistant so both the dynamic variables webhook URL and the `schedule_estimate`\n\nwebhook tool URL point to the same Edge Compute invoke URL.\n\nThe full setup is in the guide: [https://developers.telnyx.com/docs/edge-compute/guides/ai-assistant-backend](https://developers.telnyx.com/docs/edge-compute/guides/ai-assistant-backend)\n\nThis example uses a scheduling flow, but the backend pattern applies to:\n\nThe core idea is simple: keep the assistant conversational, and put the callback logic at the edge.\n\nEdge Compute quickstart: [https://developers.telnyx.com/docs/edge-compute/quickstart](https://developers.telnyx.com/docs/edge-compute/quickstart)\n\nAI Assistant dynamic variables: [https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)\n\nWebhook signing: [https://developers.telnyx.com/development/api-fundamentals/webhooks/receiving-webhooks#webhook-signing](https://developers.telnyx.com/development/api-fundamentals/webhooks/receiving-webhooks#webhook-signing)\n\nTelnyx AI skills and toolkits: [https://github.com/team-telnyx/ai](https://github.com/team-telnyx/ai)", "url": "https://wpnews.pro/news/build-an-edge-backend-for-a-telnyx-ai-assistant", "canonical_source": "https://dev.to/sonam_50a41a4ced7e6b4f3fa/build-an-edge-backend-for-a-telnyx-ai-assistant-4ooi", "published_at": "2026-07-16 05:46:30+00:00", "updated_at": "2026-07-16 06:06:51.701134+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-infrastructure"], "entities": ["Telnyx", "Edge Compute", "Go", "Pinecrest Home Services"], "alternates": {"html": "https://wpnews.pro/news/build-an-edge-backend-for-a-telnyx-ai-assistant", "markdown": "https://wpnews.pro/news/build-an-edge-backend-for-a-telnyx-ai-assistant.md", "text": "https://wpnews.pro/news/build-an-edge-backend-for-a-telnyx-ai-assistant.txt", "jsonld": "https://wpnews.pro/news/build-an-edge-backend-for-a-telnyx-ai-assistant.jsonld"}}