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

# Prompt Engineering

> Write clear instructions for consistent agent conversations

A good prompt tells the agent who it is, what it can do, and how to respond when a request is outside its scope.

In the dashboard, prompts are edited under **Agent Settings → Agent Instructions (System Prompt)**. The panel shows a word counter with **Validated** state and requires at least 10 words. Use **Save & Next** to persist. The same instructions entered during **Enter Agent Details** appear here for refinement. Use **AI Generate** helpers for greeting, ending, and voice sample text where offered.

## Recommended structure

1. **Identity** - company, role, and audience.
2. **Goals** - tasks the agent should complete.
3. **Conversation style** - tone, language, and response length.
4. **Knowledge rules** - sources the agent may use.
5. **Boundaries** - requests it must refuse or escalate.
6. **Closing** - how to confirm the outcome and end the conversation.

## Start with a practical template

```text theme={null}
You are the customer support voice agent for [Company].
Help callers with [supported tasks].

Ask one question at a time and keep answers concise.
Use only connected knowledge for business facts.
If the answer is unavailable, say so and offer [fallback action].
Transfer to [destination] when [transfer conditions].
Before ending, confirm the agreed next step.
```

Replace every bracketed item with a real rule. Add examples only where a term or decision could be interpreted in more than one way.

## Set priorities clearly

Put essential safety, privacy, and escalation rules near the beginning. Keep related instructions together so the agent does not have to reconcile the same topic across several sections.

When two rules could conflict, state which one takes priority. For example, explain whether the agent should continue collecting details or transfer immediately when a caller asks for a person.

## Writing tips

* Use direct instructions and short sentences.
* Put important rules before examples.
* Tell the agent to ask a question when information is missing.
* Define a safe fallback for unknown answers.
* Test one change at a time.

## Fallback and refusal patterns

Write the exact fallback sentence the agent must use, or it will improvise a different one each call. A reliable pattern is: acknowledge the gap, state the boundary, and offer the next step - for example "I don't have that information in my approved sources. I can connect you to the support team, or take your number for a callback - which do you prefer?" For out-of-scope requests, instruct a polite refusal plus redirect: "I can't help with that, but I can help with \[supported tasks]." Never let the fallback promise information the team cannot deliver.

## Example: collection script fragment

```text theme={null}
When the caller agrees to a callback, collect details in this order:
1. Full name - repeat it back to confirm spelling.
2. 10-digit mobile number - repeat it back digit by digit.
3. Preferred time window - morning, afternoon, or evening.
If any detail is missing, ask only for that detail once, then proceed.
Before ending, summarize all three details and ask "Is that correct?"
```

Notice each step names the field, the confirmation behavior, and the order. Vague "collect contact details" produces inconsistent calls; numbered collection produces auditable ones.

## Make instructions measurable

Replace vague directions such as “be helpful” with observable behavior. Tell the agent to greet the caller once, ask one question at a time, confirm names and numbers, and summarize the next step before closing.

Use examples to show difficult decisions, not to script every possible sentence. Too many examples can make the prompt harder to maintain and may cause repetitive conversations.

Response length is controlled separately in **LLM Model → Maximum words per response** (Brief 50 through Extended 300, default 100) and response style by temperature (Precise 0.1–0.3 suggested for factual support). If answers are too long or creative, tighten those settings before rewriting the whole prompt.

## Control the conversation

Define which details the agent must collect and the order in which it should collect them. Explain how to handle interruptions, corrections, silence, and a caller who changes the topic. For important actions, require the agent to repeat key details and ask for confirmation.

Avoid long lists of personality adjectives or repeated rules. A shorter instruction with a clear action is easier to test and maintain.

## Review before publishing

* Confirm the company, role, and supported tasks are accurate.
* Check that collection and transfer rules match the real process.
* Remove duplicate or outdated instructions.
* Read the prompt aloud to find unnatural wording.
* Test normal, uncertain, restricted, and interrupted conversations.

## Iterate without breaking live calls

Keep a change log with date, changed section, reason, and test result for every prompt edit. Change one section per cycle: instructions, then collection order, then fallback, then examples - never all four at once. After each cycle, rerun the full launch checklist from [Test Your AI](/test-your-ai), not just the scenario you fixed. If two consecutive cycles fail the same scenario, the problem is usually in knowledge content or voice settings, not wording - stop rewriting and investigate those panels instead.

<Warning>
  Do not add secrets, payment details, personal records, or information the
  agent should never repeat.
</Warning>

<Card title="Test your prompt" icon="circle-check" href="/test-your-ai">
  Run normal, edge, and fallback scenarios.
</Card>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.