> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyreach.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompts and personas

> How to write instructions that actually shape agent behavior.

Anyreach assembles the agent's system prompt from your inputs across three sections: **Purpose & Personality**, **Agent Instructions**, and **Rules & Boundaries**. This page is about writing those sections well.

## Mental model

Think of the system prompt as four layers, in order of strength:

1. **Identity** — who the agent is, what it's for
2. **Personality** — how it speaks
3. **Conversation flow** — what it should do
4. **Hard rules** — what it must never do

Higher layers should be brief; lower layers should be specific.

## Identity

One sentence. Concrete role, not a job description.

✅ "You are Sam, an appointment scheduler for Riverside Dental."
❌ "You are a helpful AI assistant designed to help patients."

The first version anchors every downstream choice. The second tells the model nothing.

## Personality

Three to five adjectives, plus one or two phrases of texture.

✅ "Warm, concise, professional. Never sound rushed. Use short sentences in casual moments and slightly more formal ones when discussing medical concerns."

❌ "Be friendly and helpful and engaging."

LLMs respond strongly to specificity in tone descriptions. Describe the *register* (casual, formal, technical) and *cadence* (short sentences, longer reflective ones) separately.

## Conversation flow

This is where most teams over-write. Keep it imperative and bulleted.

✅

```
1. Greet the caller and ask how you can help.
2. If they're scheduling an appointment:
   - Ask for their full name and date of birth
   - Ask for the type of appointment (cleaning, checkup, emergency)
   - Offer the next three available slots from the schedule
   - Confirm the slot they pick
3. If they're calling for any other reason, transfer to the front desk.
```

❌

```
You should be helpful and try to figure out why the caller is calling and
then handle their request appropriately, making sure to ask any questions
you need to ask to schedule an appointment if that's what they want...
```

The bulleted version produces more reliable agents because the model can track its position in the flow turn-by-turn.

## Hard rules

Rules are absolute. Use them sparingly — every rule competes for the model's attention.

Good rules:

* Never quote prices over the phone. Direct callers to the website.
* Never confirm appointments without verifying date of birth.
* Never make medical recommendations. Refer all medical questions to the doctor.

Avoid soft rules ("Try to keep calls under five minutes") in this section — those belong in the conversation flow.

## Variables in prompts

You can interpolate dynamic values into prompts using `{{variable}}` syntax. The agent platform exposes a few built-in variables:

* `{{caller_phone_number}}` — the caller's E.164 number (inbound only)
* `{{current_time}}` — ISO-8601 timestamp at conversation start
* `{{agent_phone_number}}` — the number the call came in on

You can pass additional variables via the API when starting an outbound call.

## Patterns that work

### Confirm-and-summarize

After collecting information, have the agent confirm it back. Reduces error rate dramatically.

```
After collecting an appointment, repeat it back: "So that's [name], [date],
[time], for a [appointment type]. Is that correct?"
```

### Graceful fallback

For anything outside scope, define one fallback:

```
If the caller asks anything you can't handle from these instructions,
say "Let me get someone who can help with that" and transfer to the
front desk using the transfer_to_front_desk tool.
```

### Silence handling

Set a maximum silence duration in **Advanced Instructions**, then define what the agent says when it elapses:

```
If the caller is silent for 5 seconds, say "Are you still there?"
If silent for another 5 seconds, say "I'll let you go now — call us
back any time." and end the call.
```

## Iteration

The first version of any prompt will be wrong. Plan to iterate by:

1. Reading 10 transcripts after each publish
2. Identifying the most common failure mode
3. Adding one specific instruction or rule to address it
4. Republishing

Stop adding to the prompt when failure modes are spread across many low-frequency cases — that's the sign you've reached prompt saturation and need a different lever (a tool, a KB, a flow change).
