> For the complete documentation index, see [llms.txt](https://docs.voipnumber.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.voipnumber.net/how-to/ai-agent-with-groq-llm.md).

# AI Agent with Groq LLM

## Overview

There is nothing less complex than setting up an [AI Agent](/components/ai-agent.md) on [app.voipnumber.net](https://app.voipnumber.net)

And there's no better platform for AI Agents than [VoIP Number](https://docs.voipnumber.net/) because [VoIP Number](https://docs.voipnumber.net/) is genuine SIP and media stack, native for AI and voice integrations (that means that your media is processed on [VoIP Number](https://docs.voipnumber.net/) instead of 3rd party provider)

Let's go 🚀

{% embed url="<https://youtu.be/87HpEY80TZY>" %}
No fuss no hassle AI Agent setup on voipnumber.net
{% endembed %}

## Setup

We need to create [AI Agent](/components/ai-agent.md) and combine this with [Call Flow](/components/call-flow.md) and [Trunk](/components/trunk.md) to enable calling from SIP. For public telephony calling we also need a [Number](/components/number.md)

### AI Agent

1. First, we create an [AI Agent](/components/ai-agent.md)

Go to agents tab at the [app.voipnumber.net/aiagents](https://app.voipnumber.net/aiagents) and click `ADD` . This opens up new agent's config. Let's name our agent and configure 3 sections:

* `SPEECH TO TEXT`
* `AI INFERENCE`
* `TEXT TO SPEECH`

Each of them is responsible for a single step of the pipeline that your agent executes continuously on caller's input speech

2. Configure `SPEECH TO TEXT`&#x20;

Select `engine` and input speech `language` (caller's language)

<figure><img src="/files/N3eyKtP4KQsXchPb2oY1" alt=""><figcaption></figcaption></figure>

3. Configure `AI INFERENCE`&#x20;

Select your preferred `engine` (e.g. [Groq](https://groq.com/) for fast AI inference), LLM's `language` (language of your `Instructions` prompt and LLM model) and LLM `model`.

If you want agent to get *proactive* and start speaking immediately, enable `Greeting` under `Behaviour` settings and type what should be spoken

And the best part. `Instructions` is where you give your agent personality and orders to execute. This is a place for you to shine. Usually, more detail you tell to your agent, the better it works, more closely matches with your expectations

Experiment and iterate. **You'll make it perfect** &#x20;

<figure><img src="/files/kamoB8vKY9l2bWEkY6jP" alt=""><figcaption></figcaption></figure>

4. Configure `TEXT TO SPEECH`

Here you define how your agent sounds. Select output speech `engine`, `language` and `voice`

<figure><img src="/files/tMpxZtGU5Z0aGolnSYaJ" alt=""><figcaption></figcaption></figure>

Click `SAVE` and AI Agent is ready ✅&#x20;

### Call Flow

Now we need a [Call Flow](/components/call-flow.md) to serve this agent on a call

5. Go to [Call Flow Builder](/features/call-flow-builder.md) on your [app.voipnumber.net/callflowbuilder](https://app.voipnumber.net/callflowbuilder) or to Call Flows page at [app.voipnumber.net/callflows](https://app.voipnumber.net/callflows) and select `+Add` (or `+New`). Name your Call Flow and open in Call Flow Builder (it will open automatically if you created new from Call Flow Builder tab)
6. Place `Incoming Call`, `End`, `AI Agent` and `Echo` actions on the call flow pane. Click  `AI Agent` action and select your agent. Click `Echo` action and enable attenuation by 100 dB to silence out input speech

<figure><img src="/files/63N1Tm0WWdm1pLk5klO7" alt=""><figcaption></figcaption></figure>

💡 If you want input speech to be played back to yourself together with agent's voice, leave `Attenuate` switch disabled (or select appropriate amount of attenuation)

7. Connect actions together. Click `Validate` and `Save`&#x20;

Your [Call Flow](/components/call-flow.md) with new agent is now ready and it may run on a call coming to [Connection](/components/connection.md) or/and to [Trunk](/components/trunk.md) ✅&#x20;

### Trunk

Let's call it via [Trunk](/components/trunk.md)&#x20;

8. Go to trunks tab at [app.voipnumber.net/trunks](https://app.voipnumber.net/trunks) and click `ADD`
9. Name your trunk
10. On `TRUNK IN` settings enable `SIP` and type in a subdomain (this defines SIP address for your trunk)

<figure><img src="/files/thywVGOrag7texvbZ35a" alt=""><figcaption><p>Here we have selected <em>adam</em> as a subdomain</p></figcaption></figure>

💡 Enable `PSTN` to dial agent from public telephony

<figure><img src="/files/e2x60bR7kDNfGtqJwwEy" alt=""><figcaption></figcaption></figure>

11. At the `PROCESSING` step select a [Call Flow](/components/call-flow.md) with your agent

<figure><img src="/files/zzu5KVmBPIQyRmxXTLbO" alt=""><figcaption></figcaption></figure>

11. Click `SAVE`&#x20;

✅ You now have created [AI Agent](/components/ai-agent.md) that can be dialled from SIP and from public telephony

### Dial from SIP

dial any extension on your trunk, e.g. `blah@YOUR_TRUNK_NAME.voipnumber.net` (replace *YOUR\_TRUNK\_NAME* with subdomain name of your trunk)

### Dial from public telephony

Dial a number you've selected for PSTN calling on your [Trunk](/components/trunk.md)&#x20;

<figure><img src="/files/gspi9sHt1Wt0gNqiXnpj" alt="" width="188"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.voipnumber.net/how-to/ai-agent-with-groq-llm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
