# Build an Edge Backend for a Telnyx AI Assistant

> Source: <https://dev.to/sonam_50a41a4ced7e6b4f3fa/build-an-edge-backend-for-a-telnyx-ai-assistant-4ooi>
> Published: 2026-07-16 05:46:30+00:00

Voice AI demos get interesting when the assistant needs real backend context.

It 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.

This Go example shows how to use one Telnyx Edge Compute function as the backend for a Telnyx AI Assistant.

Code: [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)

Full guide: [https://developers.telnyx.com/docs/edge-compute/guides/ai-assistant-backend](https://developers.telnyx.com/docs/edge-compute/guides/ai-assistant-backend)

The app is a Go Edge Compute function with one public URL.

That one URL handles two AI Assistant callbacks:

In the demo, the assistant is a home-services lead screener. It can resolve a company name for the greeting, then call a `schedule_estimate`

webhook tool after collecting enough information from the caller.

Usually, the moment an AI assistant needs application context, you need to build a webhook server.

That means hosting, deployment, secrets, request verification, and a public URL.

With 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.

No separate server. No Docker setup. No Kubernetes just to answer a webhook.

The handler does three useful things:

Dynamic variables must be returned under a `dynamic_variables`

key:

```
{
  "dynamic_variables": {
    "company_name": "Pinecrest Home Services",
    "timeframe": "two business days"
  }
}
```

The webhook tool returns data the assistant can use in the live conversation:

```
{
  "scheduled_date": "2025-04-10",
  "scheduled_time": "10:00",
  "confirmation_number": "CONF-1715234567",
  "estimate_id": "EST-1715234567"
}
```

Scaffold a Go function:

```
telnyx-edge new-func -l go -n edge-ai-assistant-backend
cd edge-ai-assistant-backend
```

Fetch your Telnyx public key and store it as an Edge secret:

```
PUBLIC_KEY=$(curl -s -H "Authorization: Bearer $TELNYX_API_KEY" \
  https://api.telnyx.com/v2/public_key | jq -r '.data.public')

telnyx-edge secrets add TELNYX_PUBLIC_KEY "$PUBLIC_KEY"
```

Deploy:

```
telnyx-edge ship
telnyx-edge list
```

Then configure your AI Assistant so both the dynamic variables webhook URL and the `schedule_estimate`

webhook tool URL point to the same Edge Compute invoke URL.

The 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)

This example uses a scheduling flow, but the backend pattern applies to:

The core idea is simple: keep the assistant conversational, and put the callback logic at the edge.

Edge Compute quickstart: [https://developers.telnyx.com/docs/edge-compute/quickstart](https://developers.telnyx.com/docs/edge-compute/quickstart)

AI Assistant dynamic variables: [https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)

Webhook 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)

Telnyx AI skills and toolkits: [https://github.com/team-telnyx/ai](https://github.com/team-telnyx/ai)
