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

Anatomy of a thought
Every thought benefits from the same backbone:- Context. One sentence on the agent’s role at this point in the conversation. “You are helping the customer book a meter exchange appointment.”
- Objective. What the agent must accomplish before this state can transition. “Confirm the customer’s service address.”
- Trigger. When this thought applies, if it’s not just “always”. “If the customer provides an address that matches multiple accounts…”
- Conversation moves. Specific things to say. Quoted phrases when wording matters. “Say: ‘I’ve found your account. Would you like to schedule the earliest available appointment?’”
- Function calls. Which functions to call and what parameters they need. Reference functions by their exact name.
- Error handling. What to do when a function fails, the customer goes off-script, or there are multiple matches.
- Special cases. Anything unusual — emergency routing, accessibility accommodations, regulatory requirements.
Voice and phrasing
Use strong directives. “Must” and “will” produce more reliable behavior than “should” and “can”. Avoid telling the agent what not to do. Negative instructions can backfire. Instead, describe the action you want.❌ “Do not ask for the customer’s name again.” ✅ “After you’ve received the customer’s name, move to confirming their account.”Quote exact phrasing in single quotes when the wording matters — for greetings, legally required disclosures, brand-specific language. The agent will say what’s inside the quotes verbatim. Use placeholder variables in brackets for values that should be filled in:
[Customer Name], [Service Provider].
Multi-channel branching
Voice and text conversations need different instructions. Be explicit:Function references
Reference functions by their exact registered name and call out what they need:
“Call the Get Account By Address function. Before calling, confirm the street number, street name, and ZIP code with the customer.”
If a function emits events that drive transitions, you generally do not need to mention the events in the thought — the flow editor handles routing.
Don’t do math in thoughts
LLMs are unreliable at arithmetic. Put any calculation in a function, call the function, then relay the result.❌ “Add the installment amount to the current balance and tell the customer the total.” ✅ “CallCalculate Total AmountwithInstallmentAmountandCurrentBalance, then relay the result to the customer.”
Avoid embedded examples
Don’t put example values inside thoughts — the agent may treat them as real data.❌ “Confirm the customer’s address (e.g., 123 Main Street, 90210).” ✅ “Confirm the customer’s street number, street name, and ZIP code.”
Reference information block
When you need the agent to know facts that don’t justify a function call, list them as a reference block:Error handling
Every state that calls a function should declare what happens when the function fails or the customer goes off-script. Be specific:- The statement or trigger that activates the fallback.
- The exact response to give the customer.
- The function to call (or “end the conversation politely”).
- The escalation if the function itself fails.
Customer issue: Water leak.
Response: “I understand there’s a water leak. I’ll connect you with our emergency support.”
Function call: Transfer to Emergency.
Escalation: If the transfer fails, say “It seems I couldn’t connect you. Please call our emergency line at [Emergency Number] directly.”
Common pitfalls
| Symptom | Most likely cause | Fix |
|---|---|---|
| Agent uses phrasing you don’t like | The thought describes the goal but not the exact words | Surround the wording you want with single quotes. |
| Agent keeps asking for spelling on SMS | The thought doesn’t branch on channel | Add explicit “If voice / If text” instructions. |
| Agent forgets to call a function | Function isn’t referenced by exact name, or isn’t attached to the state | Verify the function is on this state’s Functions list and reference it by name. |
| Agent gets math wrong | Calculation lives in the thought | Move the math into a function. |
| Agent leaks placeholder text | Examples in the thought | Replace examples with parameter names. |
Thought template
A copy-paste skeleton for a typical initial state:Related
Functions and events
What functions can do and how to declare events.
Flow configuration
Settings that affect every state.
Testing flows
Validate your thoughts before publishing.
