# Starting with Envocal Agents (https://docs.envocal.ai/)
> Welcome to Envocal Studio — designed to make it simple for everyone to build, launch and manage voice & chat AI Agents without writing a single line of code.
Whether you're running a customer support or sales team, a service-based business or simply looking for an AI receptionist to always answer incoming calls,
this guide will show you how to build powerful AI Agents in minutes.
We walk you through every step using **plain language** and **proven best practices**.
## The 7 Essential Steps
A summary of the guide. Each step has its own section below.
1. **Purpose**
Identify what the Agent is for and which problems it solves.
2. **Personality & Role**
Set the tone, style and perspective.
3. **Clear Instructions**
Describe clearly what the Agent should do, how it should act and what it should avoid.
4. **Add Context**
Give the Agent the knowledge it needs to complete its mission.
5. **Set Boundaries & Fallbacks**
Handle unclear input, inappropriate requests and unsupported topics.
6. **Test & Refine**
Simulate real conversations and improve based on what you find.
7. **Deploy, Monitor, Maintain**
Go live, track performance and keep improving over time.
## 1. Define the Agent's Purpose
Every effective Agent starts with a **clear, focused objective**.
Before moving forward, answer the following:
- What is the Agent's purpose?
- Who will be talking with the Agent?
- Where will the Agent be used: website, app, phone?
- Which tasks or topics should it cover (or avoid)?
**Best Practice**: Start with a narrow scope. A well-scoped Agent performs better and is easier to maintain.
## 2. Establish the Personality & Role
The Agent should **sound natural and consistent with your brand**.
Decide how it should speak, act and present itself.
Define:
- Tone: Friendly? Professional? Warm?
- Formality: "Hi!" vs. "Good afternoon"
- Perspective: first person ("I can help") or brand-based ("We offer…")
- Industry: retail, real estate, SaaS, healthcare, finance (each has its own tone expectations)
## 3. Give the Instructions
Tell your Agent what to do in plain language. You don't need technical knowledge — just clear instructions written like you're speaking to a colleague.
- Be very specific, use plain language and avoid vague instructions.
- Remember that the AI doesn't know your business.
- Set boundaries and fallback instructions.
- Don't forget edge cases and situations to avoid.
Now you are ready to start building. Click **New Agent** in the menu and write the instructions in the **Basic Info** tab. See [Basic Setup](/agents/basic).
**Example Instruction**: *You are Mima, a friendly and helpful customer support agent for Envocal's online clothing store. You help with explaining return policies and finding the right size. Always be clear, concise and empathetic. Stay on topic: if a question is unrelated, politely say you're not able to assist and suggest contacting customer service.
User input is transcribed and may contain transcription errors. Do your best to understand what the user means.*
### Key Parts of a Good Instruction:
1. **The Role** – Who is the Agent acting as?
2. **The Task** – What is the Agent supposed to do?
3. **The Style** – How should it speak or behave?
4. **Boundaries** – What should it avoid or hand over?
5. **Specifics** – Specific knowledge, actions, logic or flows.
## 4. Add Context
Give your Agent the knowledge it needs: FAQs, policies, manuals, catalogues, guides or other relevant material.
This makes sure the Agent gives **fact-based, consistent answers** and is genuinely helpful.
**Make sure to**
- Describe each knowledge base very accurately. The Agent decides from the description when to use it.
- Keep the documents and the information in them relevant and up to date.
- Remember that less is more: don't confuse the Agent with too much or contradictory information.
Go to **Knowledge** in the menu and create a new knowledge base with the **New** button.
Give it a name and a very clear description – **as mentioned, the Agent uses the description to decide when to use it.**
Then drag and drop your files onto it, or click to choose them.
Supported file types are **PDF, Word (docx), PowerPoint (pptx), Excel (xlsx), Markdown, text (txt), JSON and web pages (html).**
Go back to the Agent and, in its **Knowledge** tab, click **Add** to connect the knowledge base. See [Agent knowledge](/agents/knowledge).
**A knowledge base can be used by multiple Agents.**
## 5. Set Boundaries & Fallbacks
Even the best Agents need guardrails. Define how the Agent should respond to questions it can't answer or shouldn't handle.
Prepare for scenarios like:
- Off-topic questions
- Inappropriate language
- Requests for personal opinions
- Legal, medical or other sensitive topics
**Fallback Example**:
You only assist with order and account questions. For anything else, offer to transfer the caller to the support team.
**Escalation Example**:
If you cannot help after 2 fallback responses, offer to transfer the caller to a human agent. Say something like: "Would you like me to connect you with a human agent?"
To let the Agent actually transfer calls or send follow-ups, see [Tools](/agents/tools).
## 6. Test & Refine
Test in **real time**, directly in the preview on the Agent's page in Envocal Studio.
Simulate real conversations to assess how the Agent behaves.
What to Test:
- Common and uncommon questions and situations
- Typos, slang or unusual phrasing
- Interruptions and topic changes
- Forbidden topics or situations
Test within your team or organization, and use conversation transcripts to find weak spots.
**Transcripts from every channel – phone, voice chat and text chat –** are in [Conversations](/conversations) in the menu.
**Best Practice**: Iterate based on real input. Don't assume it's perfect from day one.
## 7. Deploy, Monitor, Maintain
Once the Agent has passed your tests, launch it: on your website with the [widget](/agents/widget), and on the phone by [assigning a phone number](/agents/telephony).
After Launch:
- Monitor interactions on the [Dashboard](/dashboard) and in [Conversations](/conversations)
- Track fallbacks and what confuses the Agent
- Update instructions and documents as needed
- Add capabilities gradually
**Treat your Agent like a product.** It should evolve with your business and your users' needs.
## Related topics
- [Basic Setup](https://docs.envocal.ai/agents/basic/)
- [Knowledge](https://docs.envocal.ai/knowledge/)
- [Agents: Tools](https://docs.envocal.ai/agents/tools/)
- [Conversations](https://docs.envocal.ai/conversations/)
# Agents: Basic Setup (https://docs.envocal.ai/agents/basic/)
> Write the Agent's instructions, choose its model and voice, and set its status, all in plain language with no code. Then start talking to it right away in the preview on the Agent's page.
## Instructions
In the **Basic Info** tab, the **Instructions** tell the Agent what it is for: its goals, its tone and style,
the situation it works in and how it should handle conversations. The Agent behaves as the instructions say,
so a natural, human-like experience depends directly on how clearly you write them. Time spent on the
Agent's role, goals, tone and communication style is time well spent.
The instructions can also say **when** the Agent should use its tools: transferring a call to a person or
another Agent, routing to a department, booking an appointment, or fetching live data from another system.
You add the tools themselves in the [Tools](/agents/tools) tab; the instructions tell the Agent when and why
to use them, so it understands requests better and reaches the goals you set.

- [Writing effective instructions](/): The 7 essential steps to a good Agent, with an example instruction.
> **Remember**
>
> The Agent knows nothing about your business beyond what you write in the instructions and the [knowledge bases](/agents/knowledge) you connect.
### Variables
Instructions can contain **instruction variables**: names in double curly braces, such as
`{{company_name}}`, that stand for your company's name, the caller's phone number or data fetched before the
call starts. They are filled in when a conversation starts, so the same instructions fit every conversation.
Type `{{` in the instructions to insert a variable or create a new one, and enter its value on the
**Variables** tab. See [Variables](/agents/variables).
## Model and voice
**Model** is the AI model that listens, thinks and speaks for the Agent. **Voice** is the voice the Agent
speaks with. Both are in the **Basic Info** tab: **Model** opens a panel on the right, **Voice** opens a larger
window with the voices to choose from. New Agents start with the default model and its default voice.
### Model
The **Model** panel lists every model with its provider and what it is good at. Badges show more:
- **Default**: the model new Agents get.
- **Preview**: a new model you can already use; it may still change.
- **Deprecated**: still works, but will be retired; move your Agents to another model.
- **Reasoning**: the model thinks before it answers.
When a model's provider states which languages it speaks, the model shows how many next to its provider; point
at the number to see them.
For a reasoning model, a **Reasoning** setting appears under the model: **Minimal**, **Low**, **Medium** or
**High**, with the model's default marked. Higher levels handle harder requests, such as
several steps or tricky rules, but the Agent takes longer to answer, so choose the lowest level that works.
### Voice
The **Voice** window shows only the voices that work with the Agent's model, with the filters on the left and
the voices on the right. Each voice shows:
- its name, a short description when there is one, and **Preview** or **Deprecated** when that applies, as for
models;
- its main language and accent, when it has one, for example **English London**. **+3** means it also speaks
three other languages; point at it to see which;
- **Multilingual** for a voice that speaks several languages without a main one, or whose other languages aren't
listed; point at it to see the languages, when they're known;
- how it sounds: **Female**, **Male** or **Neutral**, and **Young**, **Middle-aged** or **Older** when
that is known;
- its provider, when the voices come from more than one.
Click a voice to hear a short sample. Click it again to pause, and once more to carry on where it paused; the
ring around the play button shows how far the sample has played. To choose a voice, point at it and click
**Use** (on a touch screen, **Use** is always there). A check marks the Agent's voice. On the Agent's page, the
same play button sits next to the chosen voice.
Search by name, language, accent, region, gender, age, style, provider or words from the description. Every word
you type has to match, so **swedish female** finds the female voices that speak Swedish. A language can be
typed in English or in the language itself (**svenska**); it finds every voice that speaks it, the ones whose main
language it is first. Or narrow the list with the filters. A filter shows only when the voices differ in it:
- **Language**: type to find a language. The voices whose main language it is come first, then the
multilingual voices that speak it.
- **Accent**: appears once you pick a language, when its voices have different accents or regions.
- **Gender**, **Age**, **Style** and **Provider**: click one or more. Within a filter a voice needs to match one
of the ones you clicked; across filters it needs to match them all.
**Reset filters** clears the search and every filter. On phones and tablets, the filters are behind the
**Filters** button next to the search, which shows how many are on.
The window keeps your search and filters when you close it, also when you open it for another Agent, until you
reload the page or sign out. A filter that the voices of the Agent's model don't have is cleared. Opened again
without leaving the Agent's page, the list is where you left it; otherwise, or after you change the model, it opens
at the Agent's voice.
Then try the voice in the preview with your own instructions until one fits your brand.
**Which languages does a voice speak?**
A voice can have a main language, spoken with its own accent, and can be **Multilingual**: it also speaks other
languages. Which ones depends on the voice and the model. Some voices list the languages they speak; the others
speak every language their model speaks. When neither the voice nor its model lists languages, nothing limits
the voice to a set of languages: the OpenAI voices are like that, so they have no main language and no list.
**What happens to the voice when I change the model?**
Not every voice works with every model. If the Agent's voice doesn't work with the new model, the Studio picks
that model's default voice instead and says so under **Voice**. The same goes for the reasoning level: if the
new model doesn't offer it, the model's default is used. Nothing changes until you click **Save**, and
**Discard** puts back the model and voice you had.
## Status
**Status** shows at a glance where an Agent stands: **Draft**, **Active** or **Archived**. It is a label for
your overview only: it doesn't switch the Agent on or off. An Agent with a phone number or a widget on a
website answers whatever its status, so to stop an Agent from answering, unassign its
[phone number](/agents/telephony) and remove its widget.
## Try it
Once the Agent is saved, its own widget opens on the Agent's page as a preview. Talk or type to it to test
what you've saved (the preview talks to the saved Agent, so save instructions and settings first). The
[widget's](/agents/widget) look shows there as you change it, even before you save.
- [Knowledge](/agents/knowledge): Connect knowledge bases so the Agent answers from your own documents.
- [Call transfers](/agents/tools#how-to-enable-call-transfers): Let the Agent transfer a call to a person or another Agent.
- [Follow-ups](/agents/tools#how-to-setup-follow-ups): Send the conversation transcript by email when it ends.
## Related topics
- [Starting with Envocal Agents](https://docs.envocal.ai/)
- [Agents: Knowledge](https://docs.envocal.ai/agents/knowledge/)
- [Agents: Tools](https://docs.envocal.ai/agents/tools/)
- [Variables](https://docs.envocal.ai/agents/variables/)
# Agents: Advanced (https://docs.envocal.ai/agents/advanced/)
> Fine-tune how the Agent listens and responds in voice conversations, in the Agent's Advanced tab - turn detection, noise reduction and transcription - for more accurate, responsive and natural calls.
## Automatic Turn Detection
Controls **how the Agent knows the user has finished speaking**, and so when it should respond. Choose
under **Voice Activity Detection**:
### Semantic
The Agent listens for **meaning and intent**, not just silence. It keeps judging whether the user has
finished their thought, even through a pause.
**Example:**
> "I was wondering if you could help me book a demo… maybe tomorrow?"
The Agent waits for the full thought before responding.
**Eagerness** sets how quickly the Agent responds: **Low**, **Medium** or **High** (it waits at most 8, 4 or
2 seconds), or **Auto**, the default, which is the same as Medium.

### Standard
The Agent responds after a **pause**: when the user has been silent for a set time. Four settings fine-tune
it.
**Standard settings**
| Setting | What it does |
| --- | --- |
| **Threshold** | How loud something must be to count as speech. Lower is more sensitive. |
| **Prefix padding** | How much audio from just before speech was detected is kept, so first words aren't cut off. |
| **Silence duration** | How long the user must be silent before the Agent responds. Longer means fewer interruptions, but slower replies. |
| **Idle timeout** | When on, the Agent speaks up if the user hasn't replied after this time, typically to ask whether they are still there. |
### When to use each
- **Semantic**: more natural, human-like conversations (recommended).
- **Standard**: simpler use cases, or when timing must be strictly controlled.
## Noise Reduction
Helps the Agent hear the user by filtering out background noise. Choose the **Type**:
| Type | For | When to use |
| --- | --- | --- |
| **Near field** | Users speaking **close to the microphone**: phone calls, headsets, a laptop microphone. | One-on-one calls. |
| **Far field** | Users speaking **from a distance**: speakerphones, meeting rooms, kiosks. | Shared spaces and noisier surroundings. |
| **None** | Raw audio, no filtering. | Only if filtering causes problems. |

## Transcription
These settings control how the user's speech is turned into text. In voice conversations the AI model hears
the audio itself, so transcription mainly decides how accurate the written transcript is: what you read in
[Conversations](/conversations), and what follow-up emails and tools that use the transcript get.
### Language
**Auto** detects the spoken language among more than 50 languages. It suits Agents whose users speak
different languages, but short sentences are recognised less accurately. **Pre-select a language** (for
example English) when you know what your users speak: transcripts become more consistent and more accurate,
also for short replies.
### Mode
**Higher Precision** is the most accurate; **Higher Speed** is faster.
### Instructions
Extra guidance that improves transcription accuracy. For example:
> - "Expect email addresses and phone numbers."
> - "Expect technical terms and abbreviations."
### Why this matters
Transcripts are how you review conversations and how the information a caller gave reaches your other
systems. An accurate transcript makes both trustworthy, especially for names, numbers and email addresses.
## Reset Default
**Reset Default**, at the top of the tab, puts every setting back to Envocal's defaults. Save to keep them.
**What are the default values?**
| Setting | Default |
| --- | --- |
| Turn detection | **Standard**: threshold 0.5, prefix padding 300 ms, silence duration 500 ms, no idle timeout |
| Noise reduction | **Far field** |
| Transcription | **Higher Precision**, **Auto** language, no instructions |
## Related topics
- [Basic Setup](https://docs.envocal.ai/agents/basic/)
- [Telephony](https://docs.envocal.ai/agents/telephony/)
- [Conversations](https://docs.envocal.ai/conversations/)
# Agents: Tools (https://docs.envocal.ai/agents/tools/)
> Let the Agent take actions, not only answer questions - send follow-up emails, transfer or end calls, and fetch or update data in your own systems - in the Agent's Tools tab.
Tools give the Agent superpowers. With tools, your Agent can:
- Transfer or end calls
- Send follow-up emails
- Fetch or update data in your other systems
- Trigger actions in those systems
## Types of tools
### Built-in tools
**Ready to use**, provided by Envocal. Switch them on in the Agent's **Tools** tab:
| Tool | What it does |
| --- | --- |
| **Send Email** | Sends the conversation transcript to the email address you enter, for follow-up. See [follow-ups](#how-to-setup-follow-ups). |
| **Transfer Call** | Lets the Agent transfer a phone call to another phone number or SIP address, **given in its instructions**. See [call transfers](#how-to-enable-call-transfers). |
| **End Call** | Lets the Agent end a phone call or voice chat when it decides the conversation is over. |
They need little configuration and are commonly used for call handling and follow-ups.

### Custom tools
Connect the Agent to **any system with an API**, without writing code: you enter the API's address, the
method (GET, POST…) and the parameters it needs.
What custom tools let your Agent do, for example:
- Check a ticket's status (Zendesk, HubSpot)
- Book a meeting directly in your calendar (Outlook, Google)
- Create records in your CRM or support system
- Trigger workflows in your backend
- [Create a custom tool](/tools/tools): Connect the Agent to an external system through its API, step by step.
In the Agent's **Tools** tab, custom tools are added to a phase: **Before conversation**, **During
conversation** or **After conversation**. A tool can be added to the phases it was made available for.
Tools before and after the conversation run one after another, in the order they are listed, so one tool can
use what an earlier one stored. Tools during the conversation are used by the Agent when it needs them.
- [When tools can be used](/tools/introduction#when-can-tools-be-used): Before, during or after a conversation, and what that means for the Agent.
### Example
Our example Agent **Michelle** books demos with three custom tools.
- **Before the conversation: Get Current Time.** It gives Michelle today's date and time, so she understands
"tomorrow", "end of the week" or "next week". Her instructions include "Current date and time is:
`{{datetime}}`", filled by this tool (an instruction variable: see [Variables](/agents/variables#a-value-from-a-tool)).
- **During the conversation: Get Calendar, then Book Appointment.** Michelle first checks the calendar for free
times, and once the caller has picked one, books it.
Both are covered in detail in [Complete Examples](/tools/examples). Michelle's instructions say more about how
to use these tools, on top of their descriptions; together they tell her what she can do and when.
- [Example: Get Current Time](/tools/examples#get-current-time): How the Get Current Time tool is configured.

## Best practices
- Describe each custom tool clearly: what it does and when to use it.
- Tell the Agent in its instructions when and how to use its tools.
- Put each tool in the right phase.
- Avoid unnecessary tool calls.
- Collect the data a tool needs before using it.
- Combine tools into complete workflows.
## How to set up follow-ups?
### 1. Open the Agent
Click **New Agent** in the menu, or open an existing Agent from **Agents** with **Edit Agent**.
### 2. Say when to follow up
In the instructions on the **Basic Info** tab, describe clearly when the Agent should send a follow-up. Be
specific: it helps the Agent understand the task.
**Example instruction**: *Always try to answer the question or solve the task yourself. If you can't find a
complete answer, or the request is outside your capabilities, offer to forward the conversation by email to
your human colleagues. In that case, tell the user politely that their request will be followed up. Never
leave the user without an answer or a next step: your role is to help directly or make sure someone else
does.*
### 3. Switch on Send Email
On the **Tools** tab, switch on **Send Email** and enter the address the transcripts go to.
### 4. Save and test
Save, then try it out and refine the instructions based on what happens.
When the Agent sends a follow-up, it first asks for the person's name. The email goes to your address and
contains the name, the conversation transcript and, for phone calls, the caller's number.
**When should the Agent send a follow-up?**
It depends on the use case, for example when:
- the Agent isn't meant or equipped to handle the request,
- another team, Agent or system needs to take over,
- the person prefers a written quote,
- the person prefers to be contacted later.
## How to enable call transfers?
When the Agent can't help, or shouldn't, it can pass the call on to:
- another AI Agent made for the job (billing, IT support, legal…), or
- a person on your team.
Here is how to set it up so the Agent knows when and where to transfer.
**Example**
You are building a receptionist Agent. When a caller asks about a refund, the call should go straight to
customer support, an AI Agent or a person.
**How to set it up**
**No code needed: tell the Agent exactly what to do in its instructions on the Basic Info tab.** Cover:
- when the Agent should transfer the call,
- the numbers it can transfer to, of people or AI Agents,
- what to say before transferring.
**Receptionist Agent**
*If you are asked about refunds or billing, and ONLY then, transfer the call to the Customer Support Assistant
at +46xxxxxxxxx. Before you transfer, say clearly that you are going to transfer the call.*
**Customer Support Agent**
*If someone wants to talk to a person, or you can't solve their problem after trying a few times, transfer them
to a human support agent at +46xxxxxxxxx. Before you transfer, say clearly that you are going to transfer the
call.*
**Allow the transfer**
To let the Agent actually transfer calls as instructed, switch on **Transfer Call** on the **Tools** tab.
That's it!
**When should a call be transferred?**
It depends on the case. Consider transferring when:
1. the person asks to talk to a human,
2. the request is about something the Agent doesn't handle,
3. another AI Agent is better suited for the request.
## Related topics
- [Introduction to Tools](https://docs.envocal.ai/tools/introduction/)
- [Creating a Custom Tool](https://docs.envocal.ai/tools/tools/)
- [Complete Examples](https://docs.envocal.ai/tools/examples/)
- [Basic Setup](https://docs.envocal.ai/agents/basic/)
# Agents: Variables (https://docs.envocal.ai/agents/variables/)
> An Agent's instruction variables, also called prompt variables, are names such as {{company_name}} in its instructions, filled in when each conversation starts with a value you enter, with something Envocal knows about the conversation, or with data a tool fetched. They are not the agent variables of a tool.
This page is about an Agent's **instruction variables**, the ones on the Agent's **Variables** tab. They
are sometimes called **prompt variables**.
An instruction variable is a name in double curly braces in an Agent's instructions, such as
`{{company_name}}`. When a conversation starts, Envocal replaces it with a value, and the Agent reads the
instructions with the value in place.
Use them for anything that differs from Agent to Agent or from conversation to conversation: your company's
name, who is calling, what time it is, what your systems know about the customer.
> **Not the same as agent variables**
>
> An **agent variable** is something else, despite the name: it belongs to one specific **tool**. It is a value
> the Agent fills in during the conversation, each time it uses that tool, and it is created on the tool's own
> **Variables** tab (see [Types of variables](/tools/tools#types-of-variables)). An instruction variable belongs
> to the Agent's instructions. The two are [compared below](#compared-with-a-tools-variables).
## Where the values come from
An instruction variable gets its value from one of three places:
| Source | What it is | What you set up | Example |
| --- | --- | --- | --- |
| **Placeholder** | A value you enter yourself, on the Agent's **Variables** tab | Only the value | `{{company_name}}` becomes `Company A` |
| **System variable** | Something Envocal knows about the conversation, such as the caller's number | Nothing: you pick it from a list | `{{system_caller_number}}` becomes `+46701234567` |
| **Dynamic variable** | A value one of the Agent's [tools](/tools/introduction) stored, usually fetched from another system | A tool that stores the value in a dynamic variable with the same name | `{{datetime}}` becomes the current date and time |
When a conversation starts, each variable gets the first value found, in this order:
1. The **dynamic variable** with the same name, if a tool has stored a value in it.
2. The **system variable** with that name.
3. The **placeholder** you entered for it.
Most variables need only one of the three. A variable with just a placeholder is complete: nothing has to be
dynamic or come from the system. A placeholder next to a tool is the value used whenever the tool has not
stored one.
A variable with no value at all stays in the instructions as written: the Agent reads the name with its
braces.
## Example 1: a value you enter
The simplest case. The same instructions should work for any company, so the company's name is a variable.
### 1. Write the variable in the instructions
On the Agent's **Basic Info** tab, write in **Instructions**:
```text
You are the digital assistant of {{company_name}}.
Greet every caller with the company's name.
```
When you type `{{`, a list opens. Go on typing `company_name` and choose **Create company_name**. The
variable now shows in the text as a small label with its name.
### 2. Enter its value
Open the **Variables** tab. It has one row for each variable in the instructions. In the **Placeholder**
column of the row `company_name`, enter:
```text
Company A
```
### 3. Save the Agent
In every conversation from now on, the Agent reads the instructions with the value in place.
| You wrote | The Agent reads |
| --- | --- |
| You are the digital assistant of `{{company_name}}`. Greet every caller with the company's name. | You are the digital assistant of Company A. Greet every caller with the company's name. |
> **The placeholder is a real value**
>
> While the **Placeholder** field is empty it reads "Example value". What you enter there is not only an
> example: it is what the Agent gets in real conversations, whenever no tool and no system variable gives the
> variable a value.
That is all there is to it. No tool and no system variable is involved: an Agent can use instruction
variables with nothing but placeholders.
### Made for templates
Placeholders are what makes an Agent easy to reuse. Write the instructions once, with a variable for
everything that differs from one company to the next:
```text
You are the digital assistant of {{company_name}}.
We are open {{opening_hours}}.
For anything urgent, ask the caller to ring {{support_number}}.
```
Share the Agent as a [template](/agents/templates). A template is copied with its instruction variables and
their placeholders, so whoever creates an Agent from it opens the **Variables** tab and enters their own
three values. They never have to read through the instructions to find what to change.
The same goes for an Agent you keep for yourself: a detail you change now and then is changed in one place.
A variable used several times in the instructions has one row and one value.
## Example 2: something Envocal knows
The Agent should know who is calling without asking.
1. In the instructions, write "The caller's phone number is" and type `{{`.
2. Pick `system_caller_number` from the list.
```text
The caller's phone number is {{system_caller_number}}.
Don't ask for it. Read it back when you need a number to call back on.
```
There is nothing more to set up. In a phone call from +46 70 123 45 67, the Agent reads "The caller's phone
number is +46701234567."
A system variable is listed on the **Variables** tab like any other. Leave its **Placeholder** empty: a
system variable always has a value, so its placeholder is never used. Where Envocal has nothing to put in,
such as the caller's number in a web conversation, the value is empty and the variable is replaced with
nothing.
### System variables
| Variable | Value |
| --- | --- |
| `system_caller_number` | The caller's phone number, in international format (for example `+46701234567`). Empty in web conversations. |
| `system_caller_region` | The country of the caller's number, as a two-letter code such as `SE` or `GB` (`ZZ` if unknown). |
| `system_called_number` | The number the caller dialled. |
| `system_diversion_number` | The number the call was forwarded from, if it was forwarded, for example your main business number. |
| `system_diversion_region` | The country of that number. |
| `system_transcript` | The conversation so far. Mostly useful in tools that run after the conversation. |
System variables can also be used in [tools](/tools/tools#types-of-variables).
## Example 3: a value from a tool
The Agent should understand "tomorrow" and "next Friday", so it needs today's date and time. No fixed value
can give it that: a tool fetches it before each conversation.
1. The tool **Get Current Time** has a **dynamic variable** named `datetime`. Its
[response mapping](/tools/tools#response-mapping) stores the time from the answer in that variable.
2. The tool is added to the Agent under **Before Conversation**, so it has run when the conversation starts
(see [Tools](/agents/tools)).
3. The Agent's instructions say: "Current date and time is: `{{datetime}}`".
The name is what connects the two. An instruction variable gets a tool's value when it has **the same name
as the tool's dynamic variable**; capital letters make no difference.

- [Example: Get Current Time](/tools/examples#get-current-time): How the tool behind the datetime variable is configured.
**The list doesn't show my tool's variable**
The list that opens when you type `{{` holds the variables already used in these instructions and the system
variables. It doesn't list your tools' dynamic variables. Type the name as it is written on the tool's
**Variables** tab and choose **Create**.
**What if the tool has not stored a value?**
Then the next source in the order is used: the placeholder, if you entered one. A typical case is a tool that
is only available on the **Phone** channel: in a web chat it doesn't run, so nothing stores the value.
Give such a variable a placeholder that makes sense on its own. For a variable `customer_name` filled by a
tool that looks the caller up, a placeholder such as "a caller we don't know yet" keeps the instructions
readable. With no placeholder either, the name stays in the instructions with its braces.
**Which kinds of values can a tool give?**
Whatever the tool stored. A text or a number is put in as it is, and true or false as `true` or `false`. A
list or an object is put in as JSON text, for example `["Monday","Tuesday"]`.
## Compared with a tool's variables
Envocal has four things called variables. Three of them belong to [tools](/tools/tools#types-of-variables).
| | Where it is created | Who gives it its value | When |
| --- | --- | --- | --- |
| **Instruction variable** (prompt variable) | In an Agent's instructions, as `{{name}}`. Listed on the Agent's **Variables** tab | Envocal, from a dynamic variable, a system variable or the placeholder | When the conversation starts |
| **Agent variable** | On a tool's **Variables** tab | The Agent, from what is said in the conversation | Each time the Agent uses the tool, during the conversation |
| **Dynamic variable** | On a tool's **Variables** tab | A tool, through its response mapping | When that tool has run |
| **System variable** | Built in | Envocal | Always |
How they meet:
- An instruction variable takes the value of a **dynamic variable** or a **system variable** with the same
name.
- An **agent variable** never fills an instruction variable. It lives inside one tool: the Agent decides its
value when it uses the tool, and the value goes into that tool's request.
- **Placeholder** means two different things. On a tool's dynamic variable it is an example, used when you
test the tool. On an Agent's **Variables** tab it is a real value.
## Add, change and remove variables
- **Add:** type `{{` in the instructions on the **Basic Info** tab. Pick a variable from the list, or go on
typing a new name and choose **Create**. Typing the whole thing yourself, such as `{{company_name}}`, or
pasting a text that contains it, works too.
- **Find one in the list:** go on typing and the list narrows to the names that start with what you typed.
The arrow keys move in the list, Enter picks and Escape closes it.
- **Give it a value:** enter a **Placeholder** on the **Variables** tab.
- **Remove:** delete the variable from the instructions, with Backspace like any other text. When it is used
nowhere in the instructions any more, its row leaves the **Variables** tab.
The **Variables** tab can't add a variable: it shows the ones the instructions use.
## Questions
**When exactly are the values filled in?**
When the conversation starts, after the Agent's **Before Conversation** tools have run. A value that a tool
stores later, during the conversation, doesn't change the instructions the Agent already has.
If a text chat goes on as a voice conversation, the instructions are filled in again, with the values of that
moment.
**Which names can a variable have?**
Letters, digits and underscores, without spaces: `company_name`, `openingHours`, `phone2`. Names that begin
with `system_` are best left to the system variables.
**The Agent says the variable's name, braces and all**
The variable had no value when the conversation started. Check that:
- the name in the instructions is the tool's dynamic variable's name, letter for letter;
- the tool is added to the Agent under **Before Conversation**, and is available on the channel you are
testing (the tool's [Availability tab](/tools/tools#availability-tab));
- the tool's test shows the value under that dynamic variable (see [Testing](/tools/tools#testing)).
Or enter a **Placeholder**, so the variable always has a value.
**Can I set instruction variables with the API or the MCP server?**
Yes. An Agent has two fields for this: `instructions`, the text with its `{{name}}` variables, and
`variableDefinitionsJson`, the placeholders. The second is a JSON array written as text, with one object for
each variable:
```json
[
{
"name": "company_name",
"jsonType": "string",
"placeholder": "Company A",
"description": "",
"required": false
}
]
```
A variable needs an entry there only to have a placeholder: dynamic and system variables are found by name.
See [Create an agent](/api-reference/agents/create-an-agent) and
[Update an agent](/api-reference/agents/update-an-agent); with the [MCP server](/api-reference/mcp) the tools
are `create_agent` and `update_agent`. The API's descriptions call them "prompt variables": the same thing.
## Related topics
- [Basic Setup](https://docs.envocal.ai/agents/basic/)
- [Creating a Custom Tool](https://docs.envocal.ai/tools/tools/)
- [Complete Examples](https://docs.envocal.ai/tools/examples/)
- [Templates](https://docs.envocal.ai/agents/templates/)
# Agents: Knowledge (https://docs.envocal.ai/agents/knowledge/)
> Connect knowledge bases to an Agent in its Knowledge tab, so it answers from your own documents about your business, products, services and processes - everything a human colleague would know, and more.
## Adding knowledge to your Agent
Knowledge bases hold the documents an Agent answers from: FAQs, policies, price lists, manuals. First build
the knowledge base and upload what the Agent should know.
- [Build a knowledge base](/knowledge): Upload documents and describe when the Agent should use them.
Then connect it to the Agent:
### 1. Open the Knowledge tab
Open the Agent and go to its **Knowledge** tab. Save a new Agent first.
### 2. Add knowledge bases
Click **Add**, select one or more knowledge bases and click **Add Selected**.
One knowledge base can be connected to many Agents, so shared information lives in one place.

> **Remember**
>
> An Agent can use several knowledge bases. Give each a clear description of what it contains and when to use it: the Agent decides from the description which one to search.
**Edit** opens a knowledge base to change its description or documents. **Remove** disconnects it from this
Agent; the knowledge base itself stays, along with its connections to other Agents.

## Related topics
- [Knowledge](https://docs.envocal.ai/knowledge/)
- [Basic Setup](https://docs.envocal.ai/agents/basic/)
- [Conversations](https://docs.envocal.ai/conversations/)
# Agents: Telephony (https://docs.envocal.ai/agents/telephony/)
> Let an Agent answer phone calls by assigning it a phone number in its Telephony tab. No missed calls, no hold music, no IVR menus - every caller is served right away.
## How does an Agent start answering calls?
Assign it a phone number. Envocal takes care of the rest.
### 1. Open the Agent
In **Agents** in the menu, find the Agent and click **Edit Agent**. A new Agent must be saved first.
### 2. Assign a number
On the **Telephony** tab, click **Assign** and choose a number. Numbers already used by another Agent can't
be chosen.
### 3. Test it
Call the number from your phone and talk to your Agent.

> **Remember**
>
> A number belongs to one Agent at a time. Click **Change** to give the Agent another number, or **Unassign** to free the number; the Agent then stops answering it.
The numbers you can choose are your organization's [phone numbers](/phone_numbers). To fine-tune how the
Agent listens on calls, see [Advanced](/agents/advanced); to let it transfer or end calls, see
[Tools](/agents/tools).
## Related topics
- [Phone Numbers](https://docs.envocal.ai/phone_numbers/)
- [Agents: Tools](https://docs.envocal.ai/agents/tools/)
- [Advanced](https://docs.envocal.ai/agents/advanced/)
- [Conversations](https://docs.envocal.ai/conversations/)
# Agents: Widget (https://docs.envocal.ai/agents/widget/)
> Put your Agent on your website as a chat and voice widget. Set where it may run, how it behaves and how it looks, then paste one snippet into your site.
The widget puts your Agent on your website. Visitors chat with it by text, talk to it by voice, or switch from one to the other in the same conversation. Everything is set up in the Agent's **Widget** tab in Envocal Studio.
Settings apply as soon as you click **Save**: every website that already has the widget picks them up on its next page load. You never need to change the code on your website after adding it once.

## Add the widget to your website
### 1. Allow your website
Under **Allowed domains**, add the domain of every website the widget will run on, for example `mysite.com`, and click **Save**. Until a domain is added, the widget only works in Envocal Studio. See [Allowed domains](#allowed-domains).
### 2. Copy the embed snippet
Copy the code under **Embed snippet**. It contains your Agent's id, so save a new Agent first; before that, it shows `YOUR-AGENT-ID` instead.
```html