Prompt Engineering for Assistants
The default templates in SendSeven produce a working Assistant out of the box, but real production bots almost always need a few tuning rounds before they sound on-brand and behave the way you want.
This page collects the practical recipes — what to put in the personality prompt, how to set the confidence threshold, when to flip KB-only mode, how to write escalation prompts, and the EU AI Act considerations.
The personality prompt
The personality prompt is the system message sent to the LLM on every turn. It sets the Assistant's voice, behaviors, and constraints.
Anatomy of a good prompt
A useful structure:
- Role — one sentence describing who the Assistant is.
- Tone — adjectives or short rules ("friendly but professional", "never use exclamation marks").
- Scope — what the Assistant is and isn't allowed to talk about.
- Output rules — formatting, length, language preferences.
- Edge cases — what to do when it doesn't know, when the user is rude, when the question is off-topic.
Example: support Assistant
You are Sam, a customer support assistant for Example Corp,
a B2B SaaS company selling project management software.
Tone:
- Warm but professional.
- Use the user's first name when known.
- Never use marketing language ("amazing", "revolutionary").
Scope:
- Answer questions about Example Corp's product, pricing, billing,
and integrations using the provided Knowledge Base context.
- For technical bugs, gather basic info (browser, error message)
and offer to hand off to a human engineer.
- Do not discuss competitors. If asked, politely redirect.
Output rules:
- Keep replies under 4 short paragraphs.
- Use markdown bullets for any list of 3+ items.
- Reply in the same language the user wrote in.
When you don't know:
- Say "I'm not sure about that — let me get a human teammate to help."
- Set escalation = true.
Common mistakes
- Don't restate KB rules — the Assistant already knows to use retrieved context. Telling it "always use the knowledge base" in the prompt is noise.
- Don't list product features — they belong in the KB, not the prompt. The prompt is voice; the KB is content.
- Don't write in the second person — "You will answer questions about..." is fine, but "You are talking to a customer who..." leaks instructions into the visible reply. Always frame in third person: "The Assistant should..." or first person: "I am Sam...".
- Don't paste 2000 tokens of policy — long prompts cost money on every turn and bury the important rules. Keep the prompt under 500 tokens; put detail in the KB.
Multi-language prompts
If your Assistant serves multiple languages, write the prompt in English but instruct it explicitly:
Reply in the same language the user wrote in.
Support: English, German, French, Spanish, Italian, Polish, Turkish,
Portuguese, Russian, Arabic, Croatian.
Gemini handles language switching well; the prompt doesn't need to be translated. (For Flows, where messages are static, you do need per-language variants — see the Flows guide.)
Confidence threshold
The confidence_threshold field (0.00–1.00, default 0.70) is the minimum confidence the Assistant must have before it sends a reply without escalating.
| Bot type | Suggested threshold | Reasoning |
|---|---|---|
| FAQ | 0.85 | High-signal questions only. Better to escalate than to guess. |
| Customer Support | 0.70 | Default. Balanced — replies confidently when grounded, escalates when not. |
| Sales | 0.60 | Tolerate more guesswork — a sales conversation can survive an imperfect answer if the rep follows up. |
| Internal helpdesk | 0.55 | Lower bar; employees are forgiving and can re-ask. |
How to tune: turn on debug sessions for a few days, look at the confidence scores of the bot's actual replies, and compare them to your team's judgment of correctness. If the bot is confidently wrong, raise the threshold. If it escalates correct answers, lower it.
KB-only mode (is_kb_only_mode)
When off (default), the Assistant falls back on the LLM's general knowledge when the KB doesn't cover something. When on, the Assistant refuses to answer anything not grounded in retrieved KB chunks.
| Use KB-only mode when… | Don't use it when… |
|---|---|
| Compliance, legal, medical, or financial advice — answers must be auditable. | Conversational bots — answers like "You're welcome" and "Sure, what else?" aren't in your KB. |
| Your KB is comprehensive and you want zero hallucinations. | Your KB is sparse — turning this on will make the bot say "I don't know" to most questions. |
| You're EU-regulated and need clear sourcing for every reply. | You want a friendly, conversational vibe. |
Tip: if you turn KB-only mode on, also set is_detailed_response on and update your escalation message — your bot will refuse a lot, so make the refusal helpful ("I don't have that in our knowledge base — let me get a human teammate").
Escalation prompts
When the Assistant escalates, it sends a final message to the contact before handing off. Make this message helpful:
- Bad: "Sorry, I can't help. Escalating."
- Better: "I'm not sure about this one — I've pinged a human teammate. They'll reply here shortly. In the meantime, you can also email us at [email protected]."
Settings to look at:
| Field | Description |
|---|---|
handoff_message | The message sent at the moment of escalation. |
max_failed_attempts | How many low-confidence answers in a row before the bot gives up. Default 3. |
immediate_handoff_threshold | A confidence score so low that the bot escalates immediately without trying. Default 0.30. |
escalation_keywords | Phrases that force escalation even on a high-confidence answer ("human", "agent", "support manager"). Localize these. |
offline_escalation_behavior | What to do when escalation triggers but no agent is online: leave_message (queue it), escalate_anyway (notify offline agents), or continue_bot (the bot keeps trying). |
AI disclosure (EU AI Act)
Article 50 of the EU AI Act requires you to disclose to users that they're interacting with AI, not a human. SendSeven Assistants have built-in support:
| Field | Description |
|---|---|
display_name | The name the contact sees (e.g., "Sam (AI Assistant)"). Make it obvious it's a bot. |
ai_disclosure_message | A message included in the greeting or first reply (e.g., "Hi, I'm an AI Assistant from Example Corp. I can answer questions about our product, and I'll connect you to a human teammate when needed."). |
ai_disclosure_include_escalation | When on, the disclosure message also mentions the ability to escalate to a human. Recommended. |
Recommendations:
- Leave the AI disclosure on. The cost is one extra sentence; the legal upside is significant.
- Make the display name unambiguous. "Sam" alone is borderline; "Sam (AI)" or "AI Assistant" is clearly compliant.
- Localize the disclosure for every supported language.
Iterative tuning workflow
A practical loop:
- Ship with defaults. Use the template prompt, default confidence threshold, KB-only off.
- Turn on debug sessions for a week. Every bot interaction is logged with confidence, retrieved chunks, and tokens.
- Look at the 10 worst interactions — low confidence, wrong answer, or escalation that should have been answerable.
- For each one, ask: is this a KB gap, a prompt gap, or a tuning gap?
- KB gap → add a doc or FAQ.
- Prompt gap → tweak the personality prompt.
- Tuning gap → adjust threshold or KB-only mode.
- Test in the playground until the same questions get better answers.
- Repeat weekly until the bot's escalation rate is where you want it.
What's next
- Knowledge Base — most "prompt problems" are actually content problems.
- Build an Assistant — review the full configuration walkthrough.
- Knowledge Base API — programmatically inspect what the bot retrieved.