# LemuAI docs: using the app
> Every guide, recipe and troubleshooting page: how to do things in the app. LemuAI is a hosted product at https://app.lemuai.com. Menu paths in these pages use the app's sidebar names, joined with →. When you help someone, follow these pages; if they don't cover something, say so instead of guessing.
Page index: https://docs.lemuai.com/llms.txt
---
# Introduction
> Reach customers by voice, WhatsApp and email with AI agents and journeys built on your own customer data
URL: https://docs.lemuai.com/getting-started
## About Lemu AI
Lemu AI is a platform for building voice AI agents and journeys: conversational phone agents backed by an easy drag-and-drop workflow builder, plus a journey layer that can trigger calls, messages, and HTTP actions from your own data and events.
Lemu AI is multichannel. Voice agents handle calls, and journeys can also send [WhatsApp messages](https://docs.lemuai.com/messaging/whatsapp) and [email](https://docs.lemuai.com/email/setup), and pick up replies in the [Inbox](https://docs.lemuai.com/messaging/inbox). Your audience comes from your own customer data: [contacts](https://docs.lemuai.com/contacts/overview) with their consent for each channel, [segments](https://docs.lemuai.com/segments/overview) that update themselves as people match your rules, and [custom records](https://docs.lemuai.com/records/overview) such as orders or subscriptions. Events from your system, your Shopify store and the [website pixel](https://docs.lemuai.com/website-pixel/overview) keep that data current.
With Lemu AI you can:
- Design a conversation flow visually and connect a phone number in minutes
- Run calls at scale with campaigns, using your own contact lists
- Extend beyond voice with journeys that send WhatsApp messages and email, call APIs, and react to events, webhooks and schedules
- Build agents, journeys, tools and contact lists from one chat with [AI Copilot](https://docs.lemuai.com/copilot/overview)
- Test your agents automatically with AI personas before they ever talk to a real caller

## Getting started
1. Sign in at [app.lemuai.com](https://app.lemuai.com)
2. Create your first voice agent: talk through your use case with the AI Copilot and it builds the starting workflow as you speak
3. Test it with a web call or phone call directly from the builder
4. Connect a telephony provider to take real calls. See [Telephony](https://docs.lemuai.com/integrations/telephony/overview)
## Next Steps
- [How Lemu AI Works](https://docs.lemuai.com/core-concepts/how-lemu-works): The big picture, from your data to a conversation to the result
- [Voice Agent Builder](https://docs.lemuai.com/voice-agent/introduction): Build your first conversation flow
- [Configurations](https://docs.lemuai.com/configurations/inference-providers): Choose your LLM, voice, and transcription providers
- [Campaigns](https://docs.lemuai.com/core-concepts/campaigns): Running agents at scale
- [Journeys](https://docs.lemuai.com/automation/introduction): Reach people by call, WhatsApp and email when something happens
- [Contacts](https://docs.lemuai.com/contacts/overview): Your audience, with consent for each channel
---
# Use these docs with AI
> Give ChatGPT, Claude, Gemini, Cursor or any AI assistant the LemuAI docs, so it can walk you through any task or error step by step.
URL: https://docs.lemuai.com/getting-started/use-with-ai
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Troubleshooting](https://docs.lemuai.com/troubleshooting/overview), [Glossary](https://docs.lemuai.com/getting-started/glossary), [Overview](https://docs.lemuai.com/mcp/overview)
Every page of these docs is written so an AI assistant can read it and help you: exact menu paths and button names, every field explained, worked examples, and every error message quoted exactly as the app shows it. Give your assistant the docs, describe what you want or paste the error, and it can guide you.
## Four ways to get the docs
### 1. One page
At the top of every page:
- **Open in ChatGPT** or **Open in Claude** opens a new chat that has already been asked to read this page.
- **Copy page** copies the page as plain text (Markdown) to paste into any assistant.
- **Markdown** opens the same text in a new tab. Any page's address followed by `.md` works too, for example `https://docs.lemuai.com/segments/overview.md`.
### 2. Everything at once
**Copy all docs for AI** (top of every page) copies every page for your audience into one block of text to paste into a chat. Or give the assistant one of these links:
| File | What's in it | Use it for |
|---|---|---|
| [`/llms-users.txt`](https://docs.lemuai.com/llms-users.txt) | Every guide, recipe and troubleshooting page | Doing things in the app, fixing errors |
| [`/llms-developers.txt`](https://docs.lemuai.com/llms-developers.txt) | The API reference, SDKs, events, webhooks, MCP | Building on LemuAI with code |
| [`/llms-full.txt`](https://docs.lemuai.com/llms-full.txt) | All of the above | Assistants with a large context |
| [`/llms.txt`](https://docs.lemuai.com/llms.txt) | A short index of every page with a one-line summary | Letting the assistant pick the pages it needs |
| [`/openapi.json`](https://docs.lemuai.com/openapi.json) | The public REST API as an OpenAPI 3 file | Coding assistants, Postman, code generators |
Assistants that can browse (ChatGPT, Claude, Gemini, Perplexity) can read these links directly; others need the text pasted in.
### 3. Inside your editor or AI app
- **Cursor, VS Code, Windsurf:** add `https://docs.lemuai.com/llms-developers.txt` as a docs source (in Cursor: **@Docs → Add new doc**).
- **Claude or ChatGPT connected to your workspace:** the [LemuAI MCP server](https://docs.lemuai.com/mcp/overview) also has a `search_docs` tool, so the assistant can look up these docs while it works in your workspace.
### 4. On paper or as a PDF
The whole user guide and the developer reference are also each on one printable page: [/handbook/guide](https://docs.lemuai.com/handbook/guide) and [/handbook/developers](https://docs.lemuai.com/handbook/developers). Open one and use your browser's **Print → Save as PDF**. They're built from the same pages as this site, so they're always current.
## How big the files are
`llms-users.txt` is about 90,000 words and `llms-developers.txt` about 35,000. Claude, Gemini and ChatGPT's larger models read them whole. For assistants with a smaller limit, give one page (**Copy page**) or a few pages from [`/llms.txt`](https://docs.lemuai.com/llms.txt) instead.
## Prompts that work well
Copy one, fill in the brackets, and send it with the docs.
**Do something in the app**
```text
Using the LemuAI docs at https://docs.lemuai.com/llms-users.txt,
walk me through [sending a WhatsApp reminder 3 days before each EMI due date].
Give me the exact menu path and button names for each step,
tell me what I need set up first, and how to check it worked.
```
**Fix an error**
```text
I use LemuAI. I got this error: "[paste the exact message]"
I was [what you were doing, e.g. sending a WhatsApp campaign].
Using https://docs.lemuai.com/llms-users.txt (the Troubleshooting pages quote every message),
tell me what it means, why it happened, how to fix it, and who in my team can fix it.
```
**Plan a campaign**
```text
Read https://docs.lemuai.com/llms-users.txt. I run [a footwear brand selling to retailers in North India].
Suggest 3 journeys I should build in LemuAI to [win back retailers who haven't ordered in 60 days],
with the trigger, each step, and the segment rules, using only features the docs describe.
```
**Write code against the API**
```text
Using https://docs.lemuai.com/llms-developers.txt and https://docs.lemuai.com/openapi.json,
write a [Python] script that sends a Purchase event to LemuAI for each new order in my system,
with retries and the right headers.
```
**Explain in my language**
```text
Read https://docs.lemuai.com/segments/overview.md and explain in simple Hindi
how to make a segment of customers who ordered twice but not in the last 30 days.
```
## Tips
- **Paste the exact error.** The troubleshooting pages quote messages word for word, so the assistant can match them.
- **Say what you were doing** and which page of the app you were on.
- **Ask it to quote the docs page** it used, so you can check.
- If the assistant suggests a button or menu that doesn't exist, tell it to use only what the docs say. The docs reflect the app version shown at the bottom of each page.
---
# Glossary
> What every LemuAI term means, in one place: contacts, segments, records, journeys, runs, consent, the 24-hour window, balances and more.
URL: https://docs.lemuai.com/getting-started/glossary
For: Everyone
Checked against LemuAI app version 1.0.53
Related: [Introduction](https://docs.lemuai.com/getting-started), [How Lemu Works](https://docs.lemuai.com/core-concepts/how-lemu-works), [Troubleshooting](https://docs.lemuai.com/troubleshooting/overview)
Terms are in alphabetical order. Each links to the page that explains it in full.
| Term | Meaning |
|---|---|
| **24-hour window** | WhatsApp lets you send free-form messages only within 24 hours of the customer's last message. After that, only approved [templates](https://docs.lemuai.com/messaging/whatsapp). Also called the reply window or customer service window |
| **A/B split** | A journey step that splits contacts between 2 to 5 branches by weight, to see which message or timing works better. Each contact always gets the same branch |
| **Ad audience** | A [segment](https://docs.lemuai.com/segments/overview) kept in sync with a Meta or Google ad audience. See [Ad audiences](https://docs.lemuai.com/ads/overview) |
| **Agent** | See **Voice agent** |
| **Allowed hours** | The hours and days a journey may call, message or email, per channel, in its time zone. Outside them, steps wait |
| **API key** | A secret that lets your own systems use the LemuAI API (`X-API-Key` header). Created under **Settings → API Keys**. See [Authentication](https://docs.lemuai.com/api-reference/authentication) |
| **Attribution window** | How long after a message or answered call an order is still credited to it (default WhatsApp 72 h, email 120 h, calls 72 h). See [Journey goals and revenue](https://docs.lemuai.com/automation/goals-and-links) |
| **Autopilot** | Copilot launching and running campaigns on its own, within a budget you set. See [Autopilot](https://docs.lemuai.com/copilot/autopilot) |
| **Balance** | Prepaid money or credits for a channel: **Voice minutes**, **WhatsApp balance**, **Email credits**, **SMS credits**, **AI balance**. Added under **Usage & Plan → Usage & balances** |
| **Calculated field** | One number or date per contact worked out from their events or records, like total spent. See [Calculated fields](https://docs.lemuai.com/segments/calculated-fields) |
| **Caller ID** | The phone number your calls come from. Must be a number on your telephony provider account |
| **Campaign** | Calling, WhatsApp-ing or emailing a list or segment once. Under **Engage → Campaigns** (Voice, WhatsApp, Email tabs). See [Campaigns](https://docs.lemuai.com/core-concepts/campaigns) |
| **Catalog** | Your products (or any items) with price, stock, image and link, often synced from Shopify. See [Catalog](https://docs.lemuai.com/records/catalog) |
| **Consent** | Whether a contact agreed to be contacted on a channel (WhatsApp, email, calls). Marketing needs a yes; an opt-out is always respected |
| **Contact** | One person, found by phone, email or external ID. See [Contacts](https://docs.lemuai.com/contacts/overview) |
| **Conversion event** | The event that counts as an order for revenue, `Purchase` by default. See [Sending Limits](https://docs.lemuai.com/settings/sending-limits) |
| **Copilot** | The AI in the app that plans and builds agents, journeys, segments, templates and campaigns from a chat. See [AI Copilot](https://docs.lemuai.com/copilot/overview) |
| **Custom field** | Your own field on a contact, like `city` or `loyalty_tier` |
| **Custom record** | Something a contact has several of, like orders, loans or bookings, in a **record type** you define. See [Custom Records](https://docs.lemuai.com/records/overview) |
| **Disposition** | The outcome a call ended with, like interested or call back |
| **Event** | Something a contact did, like `Purchase`, `AddToCart` or `link_clicked`, with properties. See the [Event Log](https://docs.lemuai.com/event-log/overview) |
| **Experience** | A popup, bar, block or widget on your website. See [Experiences](https://docs.lemuai.com/website/experiences) |
| **External ID** | The ID of a person in your own system (CRM, store), used to match updates to the right contact |
| **Extraction / variables** | Details a voice agent saves from a call, like `preferred_date`. See [Agent Node](https://docs.lemuai.com/voice-agent/agent) |
| **Frequency cap** | The most marketing messages (or calls) one contact gets on a channel in a period. Set under **Settings → Sending Limits** |
| **Global Node** | Instructions every step of a voice agent follows. See [Global Node](https://docs.lemuai.com/voice-agent/global) |
| **Inbox** | Where your team and the AI assistant read and answer WhatsApp conversations. See [Inbox](https://docs.lemuai.com/messaging/inbox) |
| **Journey** | Automatic steps (calls, messages, waits, conditions) that run for each contact who qualifies, from a trigger. See [Journeys](https://docs.lemuai.com/automation/introduction) |
| **Landing page** | A web page built in LemuAI with a form. See [Landing pages](https://docs.lemuai.com/website/landing-pages) |
| **Lines** | How many calls your telephony account allows at the same time |
| **List** | A named group of contacts you add people to (by import, sheet or hand) |
| **MCP** | A way for AI assistants like Claude or ChatGPT to use your LemuAI workspace. See [AI Assistants (MCP)](https://docs.lemuai.com/mcp/overview) |
| **Offer / offer head** | A discount and its code; the head is the slot messages link to (`{{ offer.welcome.code }}`). See [Offers](https://docs.lemuai.com/offers/overview) |
| **Opted out** | A contact who asked not to be contacted (on one channel or all). LemuAI never sends to them on that channel. On WhatsApp an opt-out stops marketing; replies, order updates and codes still go |
| **Prediction** | Churn risk, next order date, lifetime value and RFM, per buyer. See [Predictions](https://docs.lemuai.com/segments/predictions) |
| **Quality rating** | Meta's rating of a WhatsApp number, lowered when people block or report messages |
| **Record type** | The definition of a kind of custom record (its fields and key), like `loans` |
| **RFM** | Recency, frequency and monetary scores (1-5) and segments like Champions or At risk |
| **Role** | What a team member can do: Owner, Admin, Member, Editor, Viewer or Finance. See [Team](https://docs.lemuai.com/settings/team) |
| **Run** | One go through an agent (a call) or a journey (one contact). See [Runs](https://docs.lemuai.com/runs/overview) |
| **Segment** | A live group of contacts that match rules, updated every 15 minutes. See [Segments](https://docs.lemuai.com/segments/overview) |
| **Sender** | The email address emails come from, on a verified domain. See [Email Setup](https://docs.lemuai.com/email/setup) |
| **Step / node** | One box in a journey or voice agent |
| **Suppressed** | An email address LemuAI won't send to, after a hard bounce or spam complaint |
| **Telephony provider** | The phone company account calls go through (Plivo, Exotel, Twilio…). See [Telephony](https://docs.lemuai.com/integrations/telephony/overview) |
| **Template (WhatsApp)** | A message approved by Meta, needed outside the 24-hour window and for marketing. Has variables like `{{1}}` |
| **Template variable** | A `{{…}}` placeholder filled in per contact, like `{{first_name}}`. See [Template Variables](https://docs.lemuai.com/voice-agent/template-variables) |
| **Tool** | Something a voice agent can do during a call: transfer, end the call, call your API, look up a catalog. See [Tools](https://docs.lemuai.com/tools-library/overview) |
| **Tracking source** | Your website or app sending events to LemuAI (snippet or SDK), with a write key. See [Tracking Sources](https://docs.lemuai.com/website-pixel/overview) |
| **Transactional** | Order and account updates, as opposed to marketing. Transactional emails don't need marketing consent |
| **Trigger** | What starts a journey: an event, entering a segment, a WhatsApp message, a record date, a schedule, a webhook… |
| **Voice agent** | An AI that makes or answers phone calls, built from steps with prompts. See [Voice Agent Builder](https://docs.lemuai.com/voice-agent/introduction) |
| **Workspace / organization** | Your company's space in LemuAI, with its own contacts, agents, journeys and team. You can belong to several |
---
# What's new
> Changes in each LemuAI app version, newest first. The version you're on is shown at the bottom of the app's sidebar.
URL: https://docs.lemuai.com/getting-started/whats-new
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Introduction](https://docs.lemuai.com/getting-started), [Troubleshooting](https://docs.lemuai.com/troubleshooting/overview)
The app's version is at the bottom of the sidebar. Each docs page says which version it was last checked against.
## 1.0.12
- **Segments:** the rule types now say where they look: **In a list (Contacts)** and **Has records (Custom records)**. The rule type picker is wider so the names fit. See [Segments](https://docs.lemuai.com/segments/overview).
## 1.0.11
- **All contacts:** **Audience → Contacts** opens on **All contacts**, with search across name, phone (including the last 4 digits), email, company and external ID, and sortable columns. See [Contacts](https://docs.lemuai.com/contacts/overview).
- **Contact timeline:** a contact opens on a **Timeline** of orders, website visits, WhatsApp, email and SMS messages (with their text) and calls, with filters by kind.
- **Custom records filters:** each filter row has its own **and** / **or**; "and" is checked first. The and/or picker is wider. See [Custom Records](https://docs.lemuai.com/records/overview#filtering-the-list).
- **API:** [List Contacts](https://docs.lemuai.com/api-reference/contacts/list) takes up to 500 per page and `sort_by` / `sort_dir`; [Contact Messages](https://docs.lemuai.com/api-reference/contacts/messages) returns each message's `text`.
## 1.0.10
- **Custom records filters:** filters can be joined with **or**; the filter box no longer moves while you type; the list shows **Loading…** while it updates.
## 1.0.9
- **Segments:** **is in** and **is not in** with comma-separated values (up to 500), and an **and** / **or** picker between rules and groups.
- **Journeys:** **Catalog lookup** can find an item by other columns (**Find the item by**), not only its key. See [AI, conversation, data and ticket steps](https://docs.lemuai.com/automation/more-steps#catalog-lookup).
- **Inbox:** a WhatsApp-style thread, with template messages showing their text, ticks, day chips, and **Enter** to send. See [Inbox](https://docs.lemuai.com/messaging/inbox).
## Earlier
Earlier versions added, among others: Offers, Experiences and Landing pages, Ad audiences, Predictions and calculated fields, journey goals and link tracking, Copilot autopilot, the Lemu Tickets integration, app SDKs and standard conversion events, and the Event Log side panel.
---
# How Lemu Works
> The big picture, from your customer data to a call, message or email and its result
URL: https://docs.lemuai.com/core-concepts/how-lemu-works
Lemu is a platform for building and running voice AI agents. You define a conversation flow, connect a phone number, and Lemu handles the rest: transcribing the caller's speech (STT), generating intelligent responses (LLM), speaking them back in a natural voice (TTS), and returning structured results when the call ends.
## Voice, WhatsApp and email
Calls are one channel. [Journeys](https://docs.lemuai.com/automation/introduction) decide who to reach, when and how: a journey can place a call with a voice agent, send a [WhatsApp message](https://docs.lemuai.com/messaging/whatsapp) or an [email](https://docs.lemuai.com/email/templates), wait, and branch on what happened. Replies come back to the [Inbox](https://docs.lemuai.com/messaging/inbox).
The audience is your customer data:
- **[Contacts](https://docs.lemuai.com/contacts/overview)**: the people you reach, matched across phone, email, your own ids and website visits, with consent recorded for each channel.
- **[Segments](https://docs.lemuai.com/segments/overview)**: groups defined by rules (for example "ordered in the last 30 days"), kept up to date as people match or stop matching.
- **[Custom records](https://docs.lemuai.com/records/overview)**: orders, subscriptions, bookings and other data linked to a contact, which journeys, segments and messages can use.
Events keep this data current. They come from your own system through the [API](https://docs.lemuai.com/api-reference/events/trigger), from Shopify, from the [website pixel](https://docs.lemuai.com/website-pixel/overview), and from every message and call. You can see them in the [Event Log](https://docs.lemuai.com/event-log/overview).
The rest of this page explains what happens during a call.
## The core loop
- : Dashboard / your app triggers a call
- : Telephony provider dials the contact
- : Audio streams to Lemu
- : STT → LLM → TTS on every turn
- : Extract context, fire webhooks
- : Run record (transcript, recording, gathered data)
## Key components
**Workflows (Agents)**
The conversation logic. A workflow is a graph of nodes (conversation steps) connected by edges (conditional transitions). You define what the agent says, when it moves on, and what data it collects.
**Runs**
Every execution of a workflow creates a run. The run record holds the transcript, recording, extracted data, and cost information.
**Telephony**
The phone infrastructure. Lemu connects to your telephony provider (Twilio, Vonage, etc.) to place and receive calls. The audio streams between the caller and Lemu in real time.
**Transcriber (STT)**
Converts the caller's speech to text in real time. Lemu sends the audio stream to your configured speech-to-text provider and uses the transcript to drive both the LLM and the final run record.
**LLM Provider**
Processes the transcript and the active node's prompt to generate the agent's next response. It also evaluates edge conditions to decide when to move the conversation forward.
**Voice Synthesizer (TTS)**
Converts the LLM's text response to audio and streams it back to the caller. The choice of TTS provider and voice is configurable per agent.
## How it fits together
When you trigger a call:
1. Lemu instructs your telephony provider to dial the number
2. When the caller answers, a real-time audio pipeline opens
3. The caller's speech is transcribed by the STT provider
4. The transcript is sent to the LLM with the active node's prompt and conversation history
5. The LLM responds, and the response is synthesized to audio by the TTS provider and streamed to the caller
6. When an edge condition is met, Lemu transitions to the next node
7. When an end node is reached, the call ends
8. Post-call: context is extracted, webhooks fire, the run record is saved
## Next steps
- [Workflows & Agents](https://docs.lemuai.com/core-concepts/workflows-and-agents): How the conversation graph works
- [Calls & Runs](https://docs.lemuai.com/core-concepts/calls-and-runs): The lifecycle of a call
- [Context & Variables](https://docs.lemuai.com/core-concepts/context-and-variables): How data flows through a conversation
- [Campaigns](https://docs.lemuai.com/core-concepts/campaigns): Running agents at scale
---
# Workflows & Agents
> How conversation flows are defined in Lemu
URL: https://docs.lemuai.com/core-concepts/workflows-and-agents
In Lemu, what you see as an **agent** in the dashboard is called a **workflow** in the API. They are the same thing — a workflow is the underlying definition, agent is the product name for it.
**Note:** Anywhere the API says `workflow`, think "agent". Anywhere the API says `workflow_definition`, think "the conversation logic inside your agent".
## The graph model
A workflow is a **directed graph** — a set of nodes connected by edges.
- : Start Call
- : Qualify Intent
- : Support Agent
- : Sales Agent
- : End Call
**Nodes** are the steps in the conversation. Each node has a prompt that tells the LLM what to say and do at that point.
**Edges** are the transitions between nodes. Each edge has a condition — a natural language description of when to move on. The LLM evaluates whether the condition has been met based on the conversation so far.
## Node types
| Type | What it does |
|---|---|
| `startCall` | Entry point for telephony calls. The first thing the agent says when a call connects |
| `agentNode` | An LLM-powered conversation step. The core building block |
| `globalNode` | Defines instructions that apply across all agent nodes (e.g. tone, language, fallback behaviour) |
| `endCall` | Terminates the call |
| `trigger` | Entry point for API-triggered runs (non-telephony) |
| `webhook` | Fires an HTTP request when reached — use for CRM updates, notifications, etc. |
| `qa` | Runs automated quality analysis on the completed call |
## Edges and transitions
An edge connects two nodes and fires when its condition is satisfied:
`transition_speech` is optional — if set, the agent speaks it before moving to the next node.
## Versioning
Every time you update a workflow's `workflow_definition`, Lemu saves a new version while keeping the history. The current version is always what runs. Old versions are retained for auditing.
## Creating workflows
There are two ways to create a workflow via the API:
- **From a definition** — provide the full node/edge graph yourself. Best for programmatic generation.
- **From a template** — describe the use case in natural language and Lemu generates the initial graph using an LLM. Best for getting started quickly.
---
# Calls & Runs
> The lifecycle of a call and how runs capture its results
URL: https://docs.lemuai.com/core-concepts/calls-and-runs
Every time a workflow executes, Lemu creates a **run**. The run is the record of that execution: what was said, what data was collected, how long it took, and what it cost.
## Calls vs runs
A **call** is the audio connection — whether over the phone via a telephony provider, or through the browser via Web Call.
A **run** is the Lemu record of the workflow execution. Every call — outbound, inbound, web, or campaign — creates a run with the same contents: transcript, recording, gathered context, usage, and cost. Campaign runs are additionally linked to their parent campaign.
## Call lifecycle
The call lifecycle tracks the telephony connection — from the moment a number is dialed to when the line drops.
- : Ringing
- : Connected
- : Ended
A ringing call can also go straight to **Ended** on no answer or voicemail — without ever reaching Connected.
For inbound calls, the flow starts when the caller dials in and the telephony provider routes the call to Lemu.
## Inbound vs outbound
**Outbound calls** are initiated by Lemu — you trigger them via the API or dashboard with a phone number and agent. Used for proactive outreach, reminders, and campaigns.
**Inbound calls** are initiated by the caller — your telephony provider routes incoming calls to a Lemu agent via a webhook URL. Used for support lines, hotlines, and IVR replacement.
## Web Calls
Web Call lets you talk to your agent directly from the browser — no phone number or telephony setup required. It runs the full pipeline: STT, LLM, TTS, recording, and transcript, exactly the same as a phone call.
Use it to try out your agent before going live. The run view shows the live transcript as the conversation progresses, node transitions as the workflow moves through the graph, and any tool or function calls the agent makes in real time.
## What a run contains
After a call completes, the run record includes:
| Field | Description |
|---|---|
| `status` | Final run state |
| `recording_url` | Download URL for the call audio |
| `transcript_url` | Download URL for the conversation transcript |
| `gathered_context` | Structured data extracted by the agent during the call |
| `initial_context` | The data passed in when the call was triggered |
| `usage_info` | Duration in seconds, token count |
| `cost_info` | Cost in USD |
---
# Context & Variables
> How data flows into, through, and out of a conversation
URL: https://docs.lemuai.com/core-concepts/context-and-variables
Lemu has a simple data model for passing information through a call. Understanding it is key to building agents that feel personalised and to extracting useful results after a call.
## The three context objects
```
initial_context ──► Agent ──► gathered_context
│
[template variables](/voice-agent/template-variables)
(used in prompts)
```
### initial_context
Data available to the agent before the call starts — the contact's name, account details, appointment information, anything the agent should know upfront. It can be set from several places:
- **API trigger** — pass it in the request body when calling `POST /public/agent/{uuid}` or `POST /telephony/initiate-call`
- **Campaign CSV** — columns beyond `phone_number` automatically become `initial_context` fields for each contact's call
- **Dashboard** — set default template context variables on the agent, used when no external context is provided
```json
{
"phone_number": "+14155550100",
"initial_context": {
"customer_name": "Jane Smith",
"plan": "premium",
"renewal_date": "April 1"
}
}
```
### Template variables
Values from `initial_context` are available in your agent's prompt using `{{double_brace}}` syntax.
```
You are calling {{customer_name}} about their {{plan}} plan,
which renews on {{renewal_date}}. Be friendly and confirm
whether they'd like to continue.
```
When the call starts, Lemu substitutes the values before sending the prompt to the LLM — so the agent speaks naturally as if it already knows the contact.
### gathered_context
Data the agent collects *during* the call. You configure what to extract in the agent node's extraction settings — each variable has a name, type, and a prompt that tells the LLM what to look for.
`gathered_context` is returned in the run record after the call completes and is available in [webhook payloads](https://docs.lemuai.com/voice-agent/webhook) for downstream processing.
## Data flow example
- : Your system sends initial_context (e.g. customer_name, plan)
- : Lemu substitutes {"{{variable}}"} placeholders into the agent prompt
- : LLM responds turn by turn
- : Lemu extracts gathered_context (e.g. renewal_confirmed)
- : Run record with gathered_context goes back to your system
## Where variables are available
| Location | Variables available |
|---|---|
| Agent node prompts | `initial_context` fields via `{{variable_name}}` |
| Edge conditions | Evaluated against the live conversation — no explicit variable syntax needed |
| Webhook payload templates | All context objects via `{{initial_context.field}}`, `{{gathered_context.field}}` etc. |
| Campaign CSV columns | CSV columns beyond `phone_number` become `initial_context` fields automatically |
---
# Campaigns
> Running a voice agent against a list of contacts at scale
URL: https://docs.lemuai.com/core-concepts/campaigns
A campaign is how you run a workflow against many contacts automatically. Instead of triggering calls one by one via the API, you upload a list of phone numbers and Lemu dials them for you — respecting scheduling windows, concurrency limits, and retry rules.
## How a campaign works
- : Contacts CSV
- : Upload to Lemu
- : Create Campaign
- : Scheduling & Concurrency
- : Outbound Calls
- : Run Records
- : Progress & Reports
1. **Upload a contacts CSV** — must have a `phone_number` column; any extra columns become `initial_context` for each call
2. **Create the campaign** — link it to a workflow, set concurrency, time slots, and retry behaviour
3. **Start it** — Lemu begins dialing contacts up to your concurrency limit
4. **Monitor progress** — track processed, completed, failed, and pending counts in real time
5. **Pause and resume** — stop and restart at any point without losing progress
## The contacts CSV
The CSV drives the campaign. Each row is one contact.
```csv
phone_number,customer_name,account_id,plan
+14155550100,Jane Smith,acc_001,premium
+14155550101,Bob Jones,acc_002,basic
```
Columns beyond `phone_number` are automatically passed as `initial_context` to each call, making them available as template variables in your agent's prompt — so each call can feel personalised at scale.
### People who opted out
Lemu doesn't call contacts who opted out of calls or of everything, whether the campaign uses a contact list, a Google Sheet or a CSV file (matched by phone number). They're left out when the campaign loads its rows. Someone who opts out while the campaign runs is skipped just before their call, and that row counts as failed.
## Scheduling and concurrency
**Concurrency** controls how many calls run simultaneously. It's capped by your telephony plan. Set it conservatively to start.
**Time slots** restrict when Lemu is allowed to dial — useful for respecting business hours or regulations:
```json
{
"timezone": "America/New_York",
"time_slots": [
{ "day": "monday", "start": "09:00", "end": "17:00" },
{ "day": "tuesday", "start": "09:00", "end": "17:00" }
]
}
```
If no time slots are set, Lemu dials continuously once the campaign is started.
## Retry behaviour
Lemu can automatically retry contacts who didn't answer, were busy, or went to voicemail:
```json
{
"retry_config": {
"max_attempts": 3,
"retry_interval_minutes": 60
}
}
```
## Circuit breaker
The circuit breaker automatically pauses a campaign when the call failure rate gets too high — protecting against wasted spend and telephony reputation issues caused by a misconfigured agent or a bad contact list.
When enabled, Lemu monitors the failure rate within a rolling time window. If it exceeds the threshold, the campaign is paused automatically and must be manually resumed after the issue is investigated.
| Setting | Default | Description |
|---|---|---|
| Failure Threshold (%) | `50` | Pause when the failure rate within the window exceeds this percentage |
| Window (seconds) | `120` | Rolling time window over which the failure rate is calculated |
| Min Calls in Window | `5` | Minimum number of calls required before the circuit breaker can trip — prevents false positives on small samples |
A campaign paused by the circuit breaker behaves the same as a manually paused campaign — in-flight calls complete normally, and it can be resumed once the underlying issue is resolved.
## Campaign lifecycle
| Status | Meaning |
|---|---|
| `draft` | Created but not started |
| `running` | Actively dialing |
| `paused` | Stopped; resumes from where it left off |
| `completed` | All contacts processed |
| `failed` | Encountered a fatal error |
You can pause and resume a campaign at any time. In-flight calls complete normally before a pause takes effect.
## Results
Each contact's call creates a run record with the full transcript, recording, and gathered context, the same as a manually triggered call. Open the campaign in the dashboard to see every call and its outcome. To receive results in your own system as calls finish, add a [Webhook](https://docs.lemuai.com/voice-agent/webhook) node to the agent.
---
# Recipes
> Step-by-step setups for common goals: COD confirmation calls, abandoned carts, EMI reminders, repeat-buyer segments, order lookups and win-backs.
URL: https://docs.lemuai.com/recipes/overview
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Journeys](https://docs.lemuai.com/automation/introduction), [Segments](https://docs.lemuai.com/segments/overview), [Use these docs with AI](https://docs.lemuai.com/getting-started/use-with-ai)
Each recipe is a complete setup for one goal: what you need first, every step with the exact menu paths, how to check it worked, and what usually goes wrong. Change the names, messages and numbers to fit your business.
| Recipe | What you'll have | Channels |
|---|---|---|
| [COD order confirmation call](https://docs.lemuai.com/recipes/cod-confirmation-call) | An AI call confirms each cash-on-delivery order and tags it in Shopify | Call, WhatsApp |
| [Abandoned cart on WhatsApp](https://docs.lemuai.com/recipes/abandoned-cart-whatsapp) | A WhatsApp reminder an hour after checkout is left, stopped if they buy | WhatsApp, email |
| [EMI or payment reminder from a Google Sheet](https://docs.lemuai.com/recipes/payment-reminder-google-sheet) | Reminders 3 days before each due date, with the sheet updated | WhatsApp, call |
| [Repeat buyers in Delhi](https://docs.lemuai.com/recipes/repeat-buyers-segment) | A live segment of customers in Delhi who ordered at least twice | Any |
| [Look up an order or product in a journey](https://docs.lemuai.com/recipes/order-lookup-in-journey) | A journey that finds the product or order and uses its details in the message | WhatsApp |
| [Win back inactive retailers](https://docs.lemuai.com/recipes/win-back-inactive-retailers) | Retailers who haven't ordered in 60 days get a WhatsApp offer, then a call | WhatsApp, call |
New to journeys? Read [Journeys](https://docs.lemuai.com/automation/introduction) first. Stuck on an error? See [Troubleshooting](https://docs.lemuai.com/troubleshooting/overview).
---
# COD order confirmation call
> An AI voice agent calls every cash-on-delivery order a few minutes after it's placed, confirms or cancels it, and tags the order in Shopify.
URL: https://docs.lemuai.com/recipes/cod-confirmation-call
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Shopify](https://docs.lemuai.com/integrations/shopify), [Start Call](https://docs.lemuai.com/voice-agent/start-call), [Journey Nodes & Triggers](https://docs.lemuai.com/automation/nodes-and-triggers), [Calls and telephony](https://docs.lemuai.com/troubleshooting/calls)
At the end you'll have a journey that, five minutes after a cash-on-delivery (COD) order, calls the customer, confirms the order (tag `cod-confirmed`) or cancels it with the reason, and sends a WhatsApp message if nobody answers. Fewer fake orders and fewer returned parcels.
## Before you start
- Your Shopify store connected under **Settings → Integrations** (see [Shopify](https://docs.lemuai.com/integrations/shopify)), with **Order placed** events on. To confirm or cancel orders, the app needs the `write_orders` permission.
- Telephony set up under **Voice Agents → Telephony** with a caller ID (see [Telephony](https://docs.lemuai.com/integrations/telephony/overview)), and **Voice minutes** in **Usage & Plan**.
- For the fallback message: WhatsApp connected and an approved template, for example "Hi {{1}}, please confirm your order {{2}} of ₹{{3}}" with **Confirm** and **Cancel** buttons.
## Steps
**Step: Create the voice agent**
Open **Voice Agents → Agents** and create an agent named `COD confirmation` (Copilot can build it: "An agent that confirms cash on delivery orders in Hindi or English").
In **Start Call**:
- **Greeting:** `Namaste {{first_name}}, this is Riya from Asian Footwears about your order {{order_name}}.` (use your store's name)
- **Prompt:** `Confirm the customer wants the order of {{total_price}} rupees delivered with cash on delivery. If yes, thank them. If they want to cancel, ask why politely.`
- **Enable Variable Extraction:** `confirmed` (Boolean), `cancel_reason` (String).
**Step: Create the journey**
Open **Engage → Journeys → New Journey**. Choose the trigger **Events**, event `Purchase`, with the condition `payment_method` is `cod`. Set the delay to 5 minutes and add `shopify.order.cancelled` as an exit event, so a cancelled order isn't called.
**Step: Add the call**
Add a **Call** step: choose the `COD confirmation` agent and phone `{{context.phone}}`. List the variables the agent's prompts use (`first_name`, `order_name`, `total_price`) so they're filled from the order event, and `confirmed` and `cancel_reason` as outcomes to bring back into the journey.
**Step: Act on the answer**
From the call's **completed** exit, add a **Condition**: `{{context.confirmed}}` is true.
- **true** → **Shopify** step, action **Confirm order** (adds the tag `cod-confirmed`).
- **false** → **Shopify** step, action **Cancel order**, reason from `{{context.cancel_reason}}` (only unpaid, unshipped orders can be cancelled).
**Step: Handle no answer**
From the call's **no_answer**, **busy** and **voicemail** exits, add a **WhatsApp** step with your confirmation template, then **Wait for reply** (24 hours): the **Confirm** button → Shopify **Confirm order**; **Cancel** → **Cancel order**; **timeout** → Shopify **Tag order** with `not-reached`.
**Step: Set allowed hours and go live**
In the journey's **Workflow Settings**, set **Allowed hours** for calls (for example 10:00 to 19:00). Then **Go live**.
## Check it worked
1. Place a test COD order on your store with your own phone number.
2. Within about 5 minutes your phone rings. Answer and confirm.
3. **Insights → Runs → Journey Runs** shows the run with each step; **Agent Calls** shows the call with `confirmed = true`.
4. In Shopify, the order has the tag `cod-confirmed`.
## Common problems
| What you see | Fix |
|---|---|
| No run starts | Check **Order placed** is ticked in the Shopify integration's **Store events**, and the order's payment method name contains `cash on delivery` or `cod` (see Cash-on-delivery payment methods) |
| The run waits at the Call step | Outside allowed hours, or all phone lines busy. See [Journeys troubleshooting](https://docs.lemuai.com/troubleshooting/journeys) |
| "The caller ID is not on the provider account" | See [Calls and telephony](https://docs.lemuai.com/troubleshooting/calls) |
| Shopify step fails | Cancelling a paid or shipped order isn't allowed by Shopify. Tag it instead |
---
# Abandoned cart on WhatsApp
> Send a WhatsApp reminder with the cart link an hour after a shopper leaves checkout, then an email if they don't react, and stop as soon as they buy.
URL: https://docs.lemuai.com/recipes/abandoned-cart-whatsapp
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Goals and Revenue](https://docs.lemuai.com/automation/goals-and-links), [Shopify](https://docs.lemuai.com/integrations/shopify), [Standard and Conversion Events](https://docs.lemuai.com/website-pixel/standard-events), [WhatsApp and Inbox](https://docs.lemuai.com/troubleshooting/whatsapp)
At the end you'll have a journey that sends a WhatsApp reminder one hour after someone starts checkout without ordering, waits for them to click, emails them if they don't, and leaves them alone the moment they buy. Orders after the reminder are credited to it in the journey's report.
## Before you start
- Checkout events reaching LemuAI: from Shopify (**Checkout started** in Store events) or from your site's [tracking snippet or SDK](https://docs.lemuai.com/website-pixel/standard-events) sending `InitiateCheckout` with the shopper's phone.
- WhatsApp connected and an approved **Marketing** template, for example:
> Hi {{1}}, you left something in your cart. Complete your order here: {{2}}
- Optional: an email template for the follow-up, and a sender under **Engage → Email → Setup**.
## Steps
**Step: Create the journey**
**Engage → Journeys → New Journey**, trigger **Events**, event `InitiateCheckout`. Delay: 60 minutes. Exit events: `Purchase`, so anyone who orders leaves the journey at once.
**Step: Check link tracking**
Open the journey's **Settings** and check **Track link clicks** is on (it is by default). Optionally turn on **Own attribution windows** with WhatsApp at 24 hours. See [Link Click Tracking](https://docs.lemuai.com/messaging/link-tracking).
**Step: Send the WhatsApp reminder**
Add a **WhatsApp** step with your template. Set `{{1}}` to the contact's first name (with a fallback like `there`) and `{{2}}` to the cart link: `{{context.checkout_url}}` for Shopify checkouts, or the URL your site sends.
**Step: Wait for a click**
Add **Wait for reaction**: events `link_clicked`, timeout 6 hours.
- **reacted** → **End** (they're back on the site; the exit event stops the journey if they buy).
- **no_reaction** → next step.
**Step: Email follow-up**
Add an **Email** step with your cart email template (kind **Marketing**), then **End**.
**Step: Go live**
Check **Allowed hours** for WhatsApp and email (for example 09:00 to 21:00), then **Go live**.
## Check it worked
1. On your store, add something to the cart and start checkout with your own phone number, then close the tab.
2. After an hour you get the WhatsApp message. Tap the link: it opens your checkout.
3. **Insights → Runs → Journey Runs** shows the run took the **reacted** path.
4. Complete the order: the run shows `exited: …` and the journey's report credits the order.
## Common problems
| What you see | Fix |
|---|---|
| No run starts | The checkout event had no phone, so there's no contact to message. Make sure the checkout asks for a phone before the event is sent |
| Message skipped: "no WhatsApp consent (marketing)" or opted out | The shopper hasn't agreed to WhatsApp marketing. Collect consent at checkout |
| "The number of values doesn't match the template's variables" | A variable had no value. Add fallbacks. See [WhatsApp troubleshooting](https://docs.lemuai.com/troubleshooting/whatsapp) |
| Orders aren't credited | Check the order arrives as `Purchase` with `order_id` and `value`, within the attribution window |
---
# EMI or payment reminder from a Google Sheet
> Keep due dates in a Google Sheet, remind each customer on WhatsApp 3 days before the due date, call those who don't respond, and write the result back to the sheet.
URL: https://docs.lemuai.com/recipes/payment-reminder-google-sheet
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Google Sheets](https://docs.lemuai.com/integrations/google-sheets), [Custom Records](https://docs.lemuai.com/records/overview), [AI, Data and Ticket Steps](https://docs.lemuai.com/automation/more-steps), [Journeys](https://docs.lemuai.com/troubleshooting/journeys)
At the end you'll have reminders going out automatically 3 days before each customer's EMI or payment due date: a WhatsApp message first, a call from an AI agent if they don't react, and the outcome written back to your Google Sheet.
There are two ways to keep due dates in LemuAI. This recipe uses **custom records** (one record per loan or invoice, with its due date), because a customer can have several. The sheet feeds the records; journeys run on the record's date.
## Before you start
- A Google Sheet with one row per loan or invoice, with columns like: `loan_id`, `phone`, `name`, `emi_amount`, `due_date` (as `2026-12-05` or `05/12/2026`), `status`.
- Google Sheets connected under **Settings → Integrations** (see [Google Sheets](https://docs.lemuai.com/integrations/google-sheets)).
- WhatsApp connected with an approved **Utility** template, for example: "Hi {{1}}, your EMI of ₹{{2}} is due on {{3}}. Reply PAID if you've already paid."
- For the call: a voice agent like the one in [Agent Node](https://docs.lemuai.com/voice-agent/agent) (payment reminder), telephony and **Voice minutes**.
## Steps
**Step: Create the record type**
**Audience → Custom records → New record type** named `Loans`, from the spreadsheet: fields `loan_id` (the identifier), `emi_amount` (Number), `due_date` (Date), `status` (Choice: active, paid, overdue). The owner is matched by `phone`. See [Custom Records](https://docs.lemuai.com/records/overview).
**Step: Load the rows**
Import the sheet (or a CSV export of it) into **Loans**, mapping each column. Re-import when the sheet changes, or send changes with the [records API](https://docs.lemuai.com/api-reference/records/upsert).
**Step: Create the journey**
**Engage → Journeys → New Journey**, trigger **Record date**: record type `Loans`, date field `due_date`, **3** days **before**, start at `10:00` in `Asia/Kolkata`, with the filter `status` is `active`. Each record starts one run per due date; changing the date sets it up again.
**Step: WhatsApp reminder**
Add a **WhatsApp** step with the template. `{{1}}` = first name, `{{2}}` = `{{context.object.emi_amount}}`, `{{3}}` = `{{context.object.due_date}}`.
**Step: Wait for a reply**
Add **Wait for reply** (24 hours).
- **text** → **AI step** in **Classify** mode with labels `paid`, `will_pay`, `problem`. On `paid`: **Update record** `status` = `paid`, then **End**.
- **timeout** → next step.
**Step: Call**
Add a **Call** step with your payment reminder agent (pass `emi_amount` and `due_date`; bring back `promised_date`).
**Step: Write back to the sheet**
Add **Update Google Sheet**: columns `last_reminder` = `now()`, `promised_date` = `{{context.promised_date}}`. The row is found by the contact's phone.
**Step: Go live**
Set **Allowed hours** (calls 10:00 to 19:00 are typical for collections), then **Go live**.
## Check it worked
1. Add a test row with your phone and a due date 3 days from today, and load it.
2. At the start time (10:00) on the day 3 days before the due date, you get the WhatsApp message. Record date journeys check every 15 minutes after the start time; a record added later that day still starts.
3. Don't reply: after 24 hours your phone rings. Promise a date.
4. The sheet row now has `last_reminder` and `promised_date`, and **Journey Runs** shows each step.
## Common problems
| What you see | Fix |
|---|---|
| Import errors like "isn't a date (YYYY-MM-DD or DD/MM/YYYY)" | Fix the date format in the sheet. See [Contacts and data](https://docs.lemuai.com/troubleshooting/contacts-and-data) |
| "No contact {phone} in this organization" | The phone is missing or wrong in the row |
| Update Google Sheet fails | The column headers must already exist in the sheet, spelled exactly |
| Calls go out at night | Set **Allowed hours** for calls in **Workflow Settings** |
---
# Repeat buyers in Delhi
> Build a live segment of customers in Delhi (or any cities) who ordered at least twice, and use it in a campaign, a journey or an ad audience.
URL: https://docs.lemuai.com/recipes/repeat-buyers-segment
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Segments](https://docs.lemuai.com/segments/overview), [Calculated fields](https://docs.lemuai.com/segments/calculated-fields), [Ad audiences](https://docs.lemuai.com/ads/overview), [Contacts and data](https://docs.lemuai.com/troubleshooting/contacts-and-data)
At the end you'll have a segment that always holds your customers in Delhi who placed at least two orders, updated every 15 minutes, ready for a campaign, a journey or an ad audience.
## Before you start
- Contacts have a city: a contact field or custom field like `city` (from an import, Shopify's shipping address, or a form).
- Orders reach LemuAI as `Purchase` events (Shopify, the tracking snippet or the events API). Check the [Event Log](https://docs.lemuai.com/event-log/overview).
## Steps
**Step: New segment**
**Audience → Segments → New segment**. Name: `Repeat buyers, Delhi`.
**Step: City rule**
**+ Rule** → **Contact property** → `city` → **is in** → `Delhi, New Delhi, Gurgaon, Noida`. Matching ignores upper and lower case; list every spelling your data has.
**Step: Orders rule**
**+ Rule** → **Did an event** → **did** `Purchase` **at least 2 times**. Leave the days empty for "ever", or set `in the last 365 days`.
**Step: Check the joiner and save**
Keep the word between the two rules as **and**. The right panel shows how many match and a few examples; **In plain words** should read like "city is in Delhi, New Delhi, Gurgaon, Noida, and did Purchase at least 2 times". Click **Create segment**.
## Variations
- **Big spenders only:** create a [calculated field](https://docs.lemuai.com/segments/calculated-fields) `total_spent` (Total of a property `value` on `Purchase`), then add the rule `total_spent ≥ 10000`.
- **Repeat buyers who've gone quiet:** add **Did an event** → **didn't do** `Purchase` in the last 60 days.
- **About to leave:** turn on [Predictions](https://docs.lemuai.com/segments/predictions) and add `Churn risk level is high`.
- **Exclude a list:** **In a list (Contacts)** → **is not in** your "Do not contact" list.
## Use it
- **Campaign:** **Engage → Campaigns → WhatsApp**, audience = the segment.
- **Journey:** trigger **Enters or leaves a segment**, so everyone who becomes a repeat buyer gets a thank-you or loyalty offer.
- **Ads:** sync it to Meta or Google under [Ad audiences](https://docs.lemuai.com/ads/overview).
## Check it worked
Open the segment: the member count and list fill in within a few minutes. Open a member's **Timeline** (**Audience → Contacts**) to see their orders.
## Common problems
| What you see | Fix |
|---|---|
| 0 members | Check the city values in your contacts (Delhi vs delhi vs DELHI is fine; "Dilli" isn't). Check orders are `Purchase` events in the Event Log |
| "{rule}: at most 500 values" | Use fewer values, or put the cities in a list |
| A rule shows "a value is needed" | Fill in every rule's value box |
---
# Look up an order or product in a journey
> Find the product a customer viewed or asked about, by SKU or name, and use its title, price, image and link in a WhatsApp message.
URL: https://docs.lemuai.com/recipes/order-lookup-in-journey
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [AI, Data and Ticket Steps](https://docs.lemuai.com/automation/more-steps), [Catalog](https://docs.lemuai.com/records/catalog), [Journey Nodes & Triggers](https://docs.lemuai.com/automation/nodes-and-triggers)
At the end you'll have a journey that finds a product in your catalog (by ID, SKU or name) and sends a WhatsApp message with its name, price and link. The same pattern works for any catalog or record type, like orders or loans.
## Before you start
- A [catalog](https://docs.lemuai.com/records/catalog) under **Audience → Catalog**, for example the **Products** catalog synced from Shopify, with fields like `sku`, `title`, `price`, `url`, `image_url`.
- An approved WhatsApp template, for example: "Still thinking about {{1}}? It's ₹{{2}} today: {{3}}"
## Two ways to get the value to look up
| Journey starts from | Where the product comes from |
|---|---|
| An event about the product (`ViewContent`, `AddToCart`) | The event itself: `{{context.content_ids}}` or `{{context.product_id}}` |
| Something else (entering a segment, a schedule) | A **Look up events** step first: the product they viewed most |
## Steps
**Step: Trigger**
**Engage → Journeys → New Journey**, trigger **Enters or leaves a segment** (for example "Viewed but didn't buy, last 7 days").
**Step: Find the product they viewed most**
Add **Look up events**: event `ViewContent`, look back 7 days, group by `content_ids`. **found** → next step; **not_found** → **End**.
**Step: Look it up in the catalog**
Add **Catalog lookup**: catalog `Products`, key `{{context.events.top.value}}`. Under **Find the item by**, tick `sku`, then `group_id` if your events send SKUs or style codes instead of product IDs. **found** → next; **not_found** → **End**.
**Step: Send it**
Add a **WhatsApp** step: `{{1}}` = `{{context.catalog_item.title}}`, `{{2}}` = `{{context.catalog_item.price}}`, `{{3}}` = `{{context.catalog_item.url}}`.
**Step: Go live**
Check **Track link clicks** is on in the journey's **Settings** (it is by default), then **Go live**.
## Find by name instead of ID
If customers or events give a product name (for example a WhatsApp reply "Blue kurta" extracted by an **AI step**), set **Find the item by** to `title`. Matching is exact but ignores case, so "blue kurta" finds "Blue Kurta". The run shows which column matched (`matched_field`).
## Check it worked
View a product on your site with your phone known (logged in or after a message click), join the segment, and check **Journey Runs**: the Catalog lookup step shows **found** and the item.
## Common problems
| What you see | Fix |
|---|---|
| Catalog lookup goes to **not_found** | The value doesn't match exactly in the chosen columns. Compare the event's value with the catalog's `sku` / key; add another column under **Find the item by** |
| Price shows empty | The catalog item has no `price` field or it's empty |
| Look up events goes to **not_found** | The contact has no `ViewContent` events in the window. Check the [Event Log](https://docs.lemuai.com/event-log/overview) |
---
# Win back inactive retailers
> Retailers or customers who haven't ordered in 60 days get a WhatsApp offer with their own code, then a call from an AI agent if they don't respond.
URL: https://docs.lemuai.com/recipes/win-back-inactive-retailers
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Calculated fields](https://docs.lemuai.com/segments/calculated-fields), [Offers](https://docs.lemuai.com/offers/overview), [AI, Data and Ticket Steps](https://docs.lemuai.com/automation/more-steps), [Repeat buyers in Delhi](https://docs.lemuai.com/recipes/repeat-buyers-segment)
At the end you'll have a journey that notices when a regular buyer (for example a retailer who orders from you every month) hasn't ordered in 60 days, sends them a WhatsApp offer with a unique code, and has an AI agent call the ones who don't respond. Orders that follow are credited to the journey.
## Before you start
- Orders reaching LemuAI as `Purchase` events, or as records of an orders record type (for distributors: invoices or bills).
- A [calculated field](https://docs.lemuai.com/segments/calculated-fields) `last_order_date` (**Date of the most recent time**, `Purchase`) and `orders_total` (**Number of times**, `Purchase`, ever).
- An [offer](https://docs.lemuai.com/offers/overview) with an offer head, key `winback`, for example "5% extra margin on your next order" with **Unique codes Lemu makes**.
- An approved WhatsApp **Marketing** template: "Hi {{1}}, we miss your orders! Use code {{2}} for {{3}} on your next order, valid this week."
- A voice agent for the follow-up call (telephony and **Voice minutes**).
## Steps
**Step: Segment of inactive regulars**
**Audience → Segments → New segment** `Inactive retailers 60d`:
- **Contact property** `orders_total` **≥** `3` (they were regulars),
- **and** **Contact property** `last_order_date` **not in the last** `60` days.
**Step: Journey trigger**
**Engage → Journeys → New Journey**, trigger **Enters or leaves a segment** → `Inactive retailers 60d` (enters). Leave **Exit when the contact leaves the segment** on, and add exit event `Purchase`.
**Step: WhatsApp offer**
Add a **WhatsApp** step: `{{1}}` = first name, `{{2}}` = `{{ offer.winback.code }}`, `{{3}}` = `{{ offer.winback.headline }}`.
**Step: Wait for a reaction**
**Wait for reaction**: events `link_clicked`, `Purchase`, timeout 3 days. **reacted** → **End**.
**Step: Call the rest**
On **no_reaction**: a **Call** step with your agent. In its **Start Call**, add the `winback` offer under **Offers**, so the agent can mention it and read out the caller's own code.
**Step: Go live**
Set **Allowed hours**, check **Track link clicks** is on (the default), then **Go live**. Everyone already in the segment enters too.
**Tip:** Let LemuAI pick the channel and offer per person instead: replace the WhatsApp and Call steps with **Choose channel, time and offer** (see [AI, conversation, data and ticket steps](https://docs.lemuai.com/automation/more-steps)). It gives a bigger offer to at-risk big spenders and calls only the ones worth a call.
## Check it worked
- The segment's member count matches your expectation (open a few members' **Timeline**).
- **Journey Runs** shows runs at the Wait for reaction step.
- **Engage → Offers → Codes** shows codes **Given out**, and **Used** after orders with the code.
- The journey's report shows orders and revenue credited to it.
## Common problems
| What you see | Fix |
|---|---|
| The message has no code | The offer head had no live offer, or the code pool is empty. See [Offers](https://docs.lemuai.com/offers/overview) |
| Some contacts skipped: frequency cap | They already got your marketing limit this week. See [Journeys troubleshooting](https://docs.lemuai.com/troubleshooting/journeys) |
| The agent doesn't mention the offer | Add the offer to the step's **Offers** and mention it in the prompt |
---
# Dashboard
> Read the Dashboard: revenue credited to your journeys, how many people you reached on each channel, and where to act.
URL: https://docs.lemuai.com/dashboard/overview
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Goals and Revenue](https://docs.lemuai.com/automation/goals-and-links), [Journey Reports](https://docs.lemuai.com/automation/reports), [Runs](https://docs.lemuai.com/runs/overview), [Reports & Usage](https://docs.lemuai.com/reports-and-usage/overview)
The **Dashboard** (first item in the sidebar) shows revenue, reach and responses across your journeys and agents for the period you pick. Use it to see what's working, then open a journey's report or the runs for details.
## Before you start
- Revenue appears once orders reach LemuAI as conversion events (Shopify, the [tracking snippet or SDKs](https://docs.lemuai.com/website-pixel/overview), or the [events API](https://docs.lemuai.com/api-reference/events/trigger)). See [Journey goals and revenue](https://docs.lemuai.com/automation/goals-and-links).
- Every role except Finance can see the Dashboard.
## Filters
At the top: a date range (pick both days, then **Apply**) and a journey filter (**All journeys** or one journey). Every number on the page follows both.
## What each part shows
### Top row
| Card | What it counts |
|---|---|
| **Revenue** | Orders credited to your journeys' and campaigns' messages and calls in the period |
| **Conversations** | Calls where someone picked up and talked to the agent |
| **Messages delivered** | WhatsApp messages and emails the provider confirmed as delivered |
| **Responses** | Qualified calls (the agent captured what it was asked for), WhatsApp replies within 24 hours, and email link clicks |
| **Contacts reached** | People reached on any channel |
### Conversion funnel
Pick **All**, **Calls**, **WhatsApp** or **Email**:
| Channel | Steps |
|---|---|
| All | **Targeted** (called, messaged or emailed) → **Reached** (answered or delivered) → **Engaged** (talked 30s, read or opened) → **Responded** (qualified, replied or clicked) |
| Calls | **Attempted** → **Connected** (someone answered) → **Engaged** (stayed 30s or longer) → **Qualified** (data captured) |
| WhatsApp | **Sent** (accepted by WhatsApp) → **Delivered** (reached the phone) → **Read** (blue ticks) → **Replied** (wrote back within 24h) |
| Email | **Sent** → **Delivered** → **Opened** (tracking pixel loaded) → **Clicked** (a tracked link) |
### Where revenue came from
Revenue split by channel, with **Orders**, **Avg order**, **WhatsApp spend** and **ROI** (revenue for each rupee spent on messages).
### Journey performance
Every journey with its reach, responses and revenue. Click one to open its [report](https://docs.lemuai.com/automation/reports).
### Calls
For voice: **Connect rate** (conversations divided by attempts), **Qualified outcomes**, **Avg call duration**, **Talk time**, **Best hours to dial**, and **What the agents captured** (the variables your agents extracted). **Outcomes over time** shows the trend.
### Alerts
A strip at the top warns about things to fix, for example **Email sending is paused** (see [Email troubleshooting](https://docs.lemuai.com/troubleshooting/email)).
## Common questions
- **Revenue is ₹0 but I have orders:** orders count only when they arrive as conversion events and follow a message or answered call within the attribution window. Check **Settings → Sending Limits → Revenue attribution** and that orders reach the [Event Log](https://docs.lemuai.com/event-log/overview) as `Purchase` events.
- **Calls show no spend or ROI:** call minutes aren't counted as message spend, so ROI reflects WhatsApp and email costs.
- **A number looks too low:** check the date range and journey filter at the top.
---
# Contacts
> Find anyone in All contacts, see everything that happened with them on one timeline, and keep them in lists with your own custom fields.
URL: https://docs.lemuai.com/contacts/overview
For: Everyone
Checked against LemuAI app version 1.0.53
Related: [Importing Contacts](https://docs.lemuai.com/contacts/import), [Segments](https://docs.lemuai.com/segments/overview), [Custom Records](https://docs.lemuai.com/records/overview), [Contacts and data](https://docs.lemuai.com/troubleshooting/contacts-and-data)
## Overview
**Contacts** in the sidebar is where you keep the people your agents call and message. Contacts are grouped into **lists**, such as "Distributors" or "Website Customers", and campaigns call everyone on a list.
Each person is kept as **one contact**, even if they are on several lists or arrive from different places (a file import, a Google Sheet, Shopify or the API). When new details come in, Lemu finds the existing contact by phone, external ID or email and updates it instead of creating a duplicate.
Each contact has:
- **Phone** (international format, for example `+919876543210`), **Email**, **First name**, **Last name** and **Company**
- **External ID**: the ID of this person in your CRM or other system, used to match updates
- **Custom fields**: any extra details you want your agent to use, such as a city or an order number. Custom fields can be used in your agent's prompts as [template variables](https://docs.lemuai.com/voice-agent/template-variables)
## All contacts and search
**Audience → Contacts** opens on **All contacts**, the first entry in the list sidebar: every contact in the workspace, whichever lists they're on. The search box is ready to type in (press `/` to jump back to it) and finds people by:
- name (first, last, or full name like `Priya Sharma`),
- phone (any part of the number: `98765`, the last 4 digits, or the full number with or without `+91`),
- email, company, or external ID.
Click a column heading (First name, Last name, Phone, Email, Company, Job title, External ID, Opted out, Created) to sort by it; click again to reverse. Your own lists appear below **All contacts**.
## Create a list and add contacts
1. Go to **Contacts** and click **New Contact List**. Give it a name and an optional description
2. Open the list and click **Import contacts**
3. Choose a source:
- **CSV or Excel file**: a header row is required. You choose what each column becomes, and extra columns become custom fields
- **Google Sheet**: pick a sheet from your connected [Google Sheets](https://docs.lemuai.com/integrations/google-sheets) integration. A list linked to a sheet reads the sheet again when you import
4. You can also add or edit a single contact by hand from the list
See [Importing Contacts](https://docs.lemuai.com/contacts/import) for column options, matching rules and file limits.
## A contact's profile
Click a contact to open their profile. The top shows their name, when they were added and last active, how many lists they're in, and their tags. It has these tabs:
- **Timeline** (opens first): everything that happened with this person, newest first and grouped by day: orders and carts, website visits, WhatsApp, email and SMS messages (with the message text, direction and status: sent, delivered, read, failed), calls (with outcome, the run and what the agent captured), and other events. Filter it with **All**, **Orders & carts**, **Website**, **Messages**, **Calls** and **Other**; each shows a count. Open an event to see its details. **Show older activity** loads more.
- **Details**: their fields, custom fields, email consent, and the lists they're in (click a list to open it).
- **WhatsApp**: their WhatsApp conversation.
- **Custom records**: things this contact has, such as loans, policies or bookings. See [Custom Records](https://docs.lemuai.com/records/overview).
- **Tickets**: their [Lemu Tickets](https://docs.lemuai.com/integrations/lemu-tickets) tickets, if connected.
Phone numbers are masked unless you're an Owner or Admin or have **See unmasked contact phone numbers** turned on (**Settings → Team**). Click the reveal button to see the full number.
## Opted out contacts
Contacts who asked not to be contacted are marked **Opted out**. They are skipped by campaigns, so they won't be called again. Contacts who opted out of calls only (on their contact page, or by a WhatsApp STOP when [Sending limits](https://docs.lemuai.com/settings/sending-limits) says a STOP stops every channel) are skipped by campaigns too.
## Using contacts
- **Campaigns** call everyone on a list. See [Campaigns](https://docs.lemuai.com/core-concepts/campaigns)
- **Journeys** can call or message contacts as one of their steps. See [Journeys](https://docs.lemuai.com/automation/introduction)
- **Segments** group contacts automatically by what they do, such as orders placed or messages read. See [Segments](https://docs.lemuai.com/segments/overview)
- **Custom records** keep things each contact has, like loans or bookings, for use in journeys and messages. See [Custom Records](https://docs.lemuai.com/records/overview)
## Keep contacts in sync from your own system
To create or update contacts automatically from your CRM or database, use the [Contacts API](https://docs.lemuai.com/api-reference/contacts/overview).
---
# Importing Contacts
> Add contacts to a list from a CSV or Excel file or a Google Sheet, and choose what each column becomes
URL: https://docs.lemuai.com/contacts/import
## Overview
You can add many contacts at once by importing a file or a Google Sheet into a contact list. Every imported row becomes a contact, or updates one you already have, and is added to the list you imported into.
## Import a file
**Step: Open the import**
Go to **Contacts**, open a list (or create one with **New Contact List**) and click **Import contacts**. The **Import Contacts** window opens with two tabs: **CSV or Excel file** and **Google Sheet**.
**Step: Choose your file**
On the **CSV or Excel file** tab, click **Choose a CSV or Excel file**. The first row must be the header. Not sure how to lay it out? Download the **Sample file** to start from.
**Step: Check each column**
Lemu reads the header and suggests what each column becomes. Change any column with its dropdown before importing (see the table below).
**Step: Import**
Click **Import N rows**. When it finishes you see a summary like "Import complete: 120 created, 15 updated, 0 failed, 3 skipped", with the reason for up to 20 rows that didn't import.
## What a column can become
| Option | What it does |
| --- | --- |
| **Phone** | The contact's phone number. Numbers are tidied into international format |
| **Email** | The contact's email address |
| **First name** / **Last name** | The contact's name |
| **Full name (split into first and last)** | One name column, split into first and last name for you |
| **Company** | Company name |
| **Job title** | Job title |
| **External ID** | The person's ID in your own CRM or system |
| **Tags (comma-separated)** | Tags for the contact. Commas, semicolons and vertical bars all work as separators |
| **Custom field** | Saves the column as a custom field. Type the field name you want |
| **Don't import** | Skips the column |
Columns that don't match a built-in field become custom fields. Their names are saved in lowercase with underscores, so a column called "Order Number" becomes `order_number`. If a custom field with nearly the same name already exists (only the case or spaces differ), the existing one is reused.
**Tip:** Custom fields can be used in agent prompts and messages as [template variables](https://docs.lemuai.com/voice-agent/template-variables).
## Rules for each row
- **Each row needs a phone, email or external ID.** Rows with none of these are skipped and listed with their row number.
- **Existing contacts are updated, not duplicated.** Lemu looks for a match by phone first, then external ID, then email.
- If two columns point at the same field, the first one with a value is used.
- Blank rows and empty columns are ignored.
- **Import** stays disabled until at least one column is set to Phone, Email or External ID, and every **Custom field** column has a name.
## File limits
| Limit | Value |
| --- | --- |
| File types | `.csv` and `.xlsx` |
| File size | Up to 50 MB. Split larger files into parts |
| Excel sheets | Only the first sheet is read |
| Phone | Up to 50 characters |
| Email | Up to 255 characters |
| First name, Last name | Up to 100 characters each |
| Company, Job title, External ID | Up to 255 characters each |
Your plan also sets how many contacts you can keep. If an import would go over it, Lemu tells you before importing.
## Import from a Google Sheet
On the **Google Sheet** tab, pick a sheet from your connected [Google Sheets](https://docs.lemuai.com/integrations/google-sheets) integration. A list linked to a sheet reads the sheet again when you import, so new and changed rows are picked up.
## Import from your own system
To send contacts from your CRM or database without a file, use the [Contacts API](https://docs.lemuai.com/api-reference/contacts/overview). One call can add up to 5,000 contacts.
## Next steps
- [Contacts](https://docs.lemuai.com/contacts/overview): How contacts, lists and custom fields work.
- [Segments](https://docs.lemuai.com/segments/overview): Build live groups of contacts from what they do.
---
# Segments
> Live groups of contacts built from rules, such as who added to cart and didn't order, that update every 15 minutes and can start journeys
URL: https://docs.lemuai.com/segments/overview
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Calculated fields](https://docs.lemuai.com/segments/calculated-fields), [Predictions](https://docs.lemuai.com/segments/predictions), [Contacts](https://docs.lemuai.com/contacts/overview), [Contacts and data](https://docs.lemuai.com/troubleshooting/contacts-and-data)
## Overview
A **segment** is a live list of contacts. Instead of adding people by hand, you describe who belongs, for example "added to cart in the last 7 days and didn't order", and Lemu keeps the list up to date. Segments update every 15 minutes.
Use segments to:
- Start a [journey](https://docs.lemuai.com/automation/introduction) for everyone who joins or leaves a segment
- See how many people match a set of rules before you message them
- Save a snapshot of the members as an ordinary contact list
## Create a segment
**Step: Start a new segment**
Go to **Audience → Segments** and click **New segment**.
**Step: Name it**
Give it a **Name** (for example "Cart abandoners, last 7 days") and an optional **Description**.
**Step: Add rules**
Click **+ Rule** to add each rule. Between two rules there's a small **and** picker: leave it on **and** (contacts must match every rule) or switch it to **or** (any one rule is enough). The word is the same for all rules at one level, so switching one switches them all; to mix **and** and **or**, put some rules in a group (below). The panel on the right shows how many contacts match and a few examples, and updates as you edit.
**Step: Save**
Click **Create segment**. Lemu works out who is in it, and the member list fills in shortly after.
## Rule types
| Rule | What it checks | Example |
| --- | --- | --- |
| **Contact property** | A contact field or custom field | First name is set, Tags include "vip", Number of calls `>` 3 |
| **Can be messaged** | Whether the contact can be messaged on a channel | can be messaged on whatsapp |
| **Did an event** | Whether the contact did (or didn't do) an event, at least a number of times, in the last N days | did `Purchase` at least 2 times in the last 30 days |
| **Message activity** | Whether a message was sent, delivered, read, failed or received on a channel | hasn't read a whatsapp message in the last 14 days |
| **In a list (Contacts)** | Whether the contact is in one of your contact lists | is in "Website Customers" |
| **Has records (Custom records)** | Whether the contact has [custom records](https://docs.lemuai.com/records/overview) of a type, optionally with filters | has at least 1 Loans record where status is overdue |
| **WhatsApp** | WhatsApp activity: replied, inside the 24-hour window, opted out, ordered, came from an ad | replied in the last 7 days |
### Contact properties
You can filter on **First name**, **Last name**, **Email**, **Phone**, **Company**, **Title**, **External id**, **Number of calls**, **Added on**, **Last called**, **Opted out of everything**, **Tags** and any custom field.
The choices depend on the kind of field:
- **Text**: is, is not, is in, is not in, contains, doesn't contain, starts with, is set, is not set
- **Numbers**: `=`, `≠`, `>`, `≥`, `<`, `≤`, is set, is not set
- **Dates**: in the last … days, not in the last … days, before, after, is set, is not set
- **Yes / no**: yes, no
- **Tags**: include, don't include, include any of, include none of
**is in** and **is not in** take a list of values separated by commas, for example `Delhi, Mumbai, Pune`, up to 500 values. Matching ignores upper and lower case. Event and record filters (**+ where…**) have them too.
Calculated fields (like total spent) and [predictions](https://docs.lemuai.com/segments/predictions) (like churn risk) appear in the property list marked "(calculated)". See [Calculated fields](https://docs.lemuai.com/segments/calculated-fields).
### Event rules
Pick an event name from the list (or type one), choose **did** or **didn't do**, and set **at least … times** and **in the last … days**. Leave the days empty to mean "ever". Click **+ where…** to narrow by the event's own properties, for example only purchases where `value` is more than 1000. You can add up to 10 filters to one event rule.
A rule on one of Meta's [standard events](https://docs.lemuai.com/website-pixel/standard-events) also counts events stored under its older name, so did `Purchase` includes orders recorded as `order_placed`.
Event rules use events received through the [Events API](https://docs.lemuai.com/api-reference/events/trigger), Shopify and WhatsApp.
**Note:** Website page and product views from your [Tracking Sources](https://docs.lemuai.com/website-pixel/overview) (**Settings → Tracking Sources**) are included in event rules only once this is turned on for your workspace. Until then, the builder shows a note saying so. Contact support to have it turned on.
### Groups
Click **+ Group** to add a set of rules that are checked together, with their own **and** / **or** between them. For example: "In a list (Contacts) is VIP" **and** (did `InitiateCheckout` **or** did `ViewContent`). Use **Rule in group** to add rules inside it. Groups go one level deep.
The summary under the builder (**In plain words**) reads the whole segment back as a sentence, with brackets around groups, so you can check it says what you mean.
## Limits
| Limit | Value |
| --- | --- |
| Rules in one segment | 30, counting rules inside groups |
| Filters on one event or records rule | 10 |
| Days in a "last … days" rule | 1 to 3,650 |
| How often members update | Every 15 minutes |
## Working with a segment
Open a segment to see its **Members** list and when it was last updated. From there you can:
- **Save** your changes to the name or rules. Members update a moment later
- **Refresh now** to update members right away instead of waiting for the next 15 minute update
- **Copy to a list** to save today's members as a regular contact list. The list doesn't change when the segment does
- **Delete** the segment. Journeys that start from it stop firing
If an update fails, the reason is shown under the segment name and in the **Updated** column on the Segments page.
## Start a journey from a segment
In a journey's trigger, under **Start from a segment**, choose **Enters a segment** or **Leaves a segment**, then pick the segment. The journey runs for each contact who joins (or leaves), with their phone available as `{{phone}}`.
- People who were already in the segment when you created or edited it don't start the journey. Only people who join or leave after that do.
- With **Exit when the contact leaves the segment** turned on (the default), someone who leaves the segment while the journey is waiting doesn't get its remaining messages or calls.
**Warning:** If more than 5,000 contacts join or leave a segment in a single update, the members still update but journeys are not started for that change. This protects you from accidentally messaging a very large group after a big edit.
See [Nodes and triggers](https://docs.lemuai.com/automation/nodes-and-triggers) for the rest of the journey setup.
## Next steps
- [Custom records](https://docs.lemuai.com/records/overview): Store loans, policies or bookings and use them in segment rules.
- [Importing contacts](https://docs.lemuai.com/contacts/import): Bring your contacts in from a file or Google Sheet.
---
# Calculated fields
> Work out one figure per contact from their events or records, like orders in the last 90 days or total spent, and use it in segments, messages and journeys.
URL: https://docs.lemuai.com/segments/calculated-fields
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Segments](https://docs.lemuai.com/segments/overview), [Predictions](https://docs.lemuai.com/segments/predictions), [Custom Records](https://docs.lemuai.com/records/overview), [Standard and Conversion Events](https://docs.lemuai.com/website-pixel/standard-events)
A **calculated field** is a number or date LemuAI works out for every contact, for example "orders in the last 60 days", "total spent", "average order value" or "last order date". It's stored on the contact like any other field, so you can use it in:
- segment rules (**Contact property** → the field, marked "(calculated)"),
- message templates (`{{ contact.metrics.total_spent_60d }}`),
- journeys and the contact page.
They're under **Audience → Segments → Calculated fields**.
## Create one
**Step: Name and key**
**Name** (like `Total spent in the last 60 days`) and **Key** (like `total_spent_60d`). The key is fixed once created, because templates use it.
**Step: Choose what to calculate from**
**From events** (a contact's events, like `Purchase`) or **From records** (a record type, like orders or loans).
**Step: Choose the calculation**
| From events | From records |
|---|---|
| Number of times | Number of records |
| Total of a property | Total of a field |
| Average of a property | Average of a field |
| Smallest value of a property | Smallest value of a field |
| Largest value of a property | Largest value of a field |
| Number of different values of a property | Number of different values of a field |
| Date of the first time | |
| Date of the most recent time | |
Pick the event (or record type), the property or field (for events, type a property name like `value`, `order.total` or `items.quantity`), and a time window if you want one.
**Step: Preview and create**
**Preview** shows sample values. **Create field**: values are calculated in a few minutes.
## How values update
- Recalculated every hour, when you save the field, and when you press **Recalculate now**.
- Only contacts with something to show get a value. A count or total of 0 is left empty; segments treat an empty count or total as 0.
- Deleting a field removes its values from every contact; messages that use it show nothing in its place.
## Examples
| Name | From | Calculation |
|---|---|---|
| Orders in the last 90 days | Events: `Purchase` | Number of times, last 90 days |
| Total spent | Events: `Purchase` | Total of a property: `value` |
| Last order date | Events: `Purchase` | Date of the most recent time |
| Loans outstanding | Records: `loans` (filter status is active) | Number of records |
| Different categories bought | Events: `Purchase` | Number of different values of a property: `items.category` |
Then a segment "Total spent is at least 10000 and Orders in the last 90 days is 0" finds big spenders who stopped buying.
---
# Predictions
> Predicted churn risk, next order date, lifetime value and RFM segments for every buyer, recalculated nightly and usable in segments and messages.
URL: https://docs.lemuai.com/segments/predictions
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Calculated fields](https://docs.lemuai.com/segments/calculated-fields), [Segments](https://docs.lemuai.com/segments/overview), [Standard and Conversion Events](https://docs.lemuai.com/website-pixel/standard-events)
**Predictions** work out, for every customer who has ordered, how likely they are to keep buying and what they're worth. They appear as built-in [calculated fields](https://docs.lemuai.com/segments/calculated-fields), so segments, journeys, templates and the contact page can use them like any other field.
Find them under **Audience → Segments → Calculated fields**, in the **Predictions** card.
## Turn them on
1. In the **Predictions** card, choose where orders come from (**Orders from**): **Purchase events** (the default) or a record type of orders (**Custom records**, with its date field).
2. Turn predictions on. The first run takes a few minutes ("Working out the first predictions…").
3. Optionally create the RFM segments: one segment per RFM group, found under **Segments**.
Predictions are recalculated nightly (**Updated nightly**) and when you press **Recalculate**. Only buyers get values; with no orders yet the card says "No orders yet. Predictions appear once customers order."
## The fields
| Field | Key | Meaning |
|---|---|---|
| Churn risk (%) | `churn_risk` | Chance (0-100) the customer has stopped buying, from how often and how recently they ordered compared with customers like them |
| Churn risk level | `churn_risk_level` | low (under 40%), medium (40-70%) or high (70% and above) |
| Predicted next order date | `next_order_date` | When the next order is expected. Empty when another order is unlikely |
| Expected orders, next 90 days | `expected_orders_90d` | Orders to expect in the next 90 days |
| Predicted spend, next 12 months | `predicted_clv_12m` | Expected orders in the next 12 months times the expected order value |
| Lifetime value | `lifetime_value` | Spent so far plus predicted spend in the next 12 months |
| RFM recency score | `rfm_recency` | 1-5; 5 = ordered most recently |
| RFM frequency score | `rfm_frequency` | 1-5; 5 = orders most often |
| RFM monetary score | `rfm_monetary` | 1-5; 5 = spent the most |
| RFM segment | `rfm_segment` | Champions, Loyal, Potential loyalists, New customers, Promising, Need attention, About to sleep, Can't lose them, At risk or Hibernating |
## Use them
- **Segment:** "Churn risk level is high and Lifetime value is at least 20000" → valuable customers about to leave.
- **Journey:** start a win-back journey when a contact **Enters or leaves a segment** of high churn risk.
- **Template:** `We miss you! Your next order usually comes around {{ contact.metrics.next_order_date }}.`
- **Choose channel, time and offer** step uses churn risk and value to decide who gets a bigger offer or a call.
## Common problems
- **"The recalculation stopped before it finished. Try again."** Press **Recalculate** again.
- **Values look wrong:** check **Orders from** points at your real orders, and that each order carries its value (the `value` property of `Purchase`, or the order record's total).
---
# Ad audiences
> Keep segments in sync with Meta and Google ad audiences, and send purchases to the Meta Conversions API.
URL: https://docs.lemuai.com/ads/overview
For: Owners and admins
Checked against LemuAI app version 1.0.12
Related: [Segments](https://docs.lemuai.com/segments/overview), [Standard and Conversion Events](https://docs.lemuai.com/website-pixel/standard-events), [Contacts](https://docs.lemuai.com/contacts/overview)
**Audience → Ad audiences** does two things:
1. **Synced audiences:** a [segment](https://docs.lemuai.com/segments/overview) becomes a custom audience in Meta Ads or a Customer Match list in Google Ads, and stays up to date: people who join the segment are added, people who leave it are removed.
2. **Meta Conversions API:** purchases (and other standard events you choose) are sent to Meta from LemuAI's server, so Meta can measure and optimise your ads even when the browser pixel is blocked.
Setting this up needs the **config** permission (Owner or Admin).
## Before you start
- A Meta ad account (for Meta) or a Google Ads account (for Google) you can manage.
- At least one segment of the people you want to reach.
## Sync a segment to an ad audience
**Step: Connect the ad account**
Under **Ad accounts**, connect Meta or Google and choose the accounts LemuAI may use. For Google, you can also enter a **Manager account ID (optional)** such as `123-456-7890` if you manage ads through a manager account.
**Step: Pick the segment and account**
Under **Sync a segment to an ad audience**, choose the **Segment** and the **Ad account**. **Audience name (optional)** defaults to `Lemu: `.
**Step: Create it**
LemuAI creates the audience and runs the first sync: "Audience created. The first sync is running."
### How syncing works
- Only hashed email and phone are sent (SHA-256), never names in plain text. Meta and Google match them to their users.
- Contacts who opted out are never sent. Contacts with neither email nor phone can't be matched and are skipped.
- Each sync sends only the changes: new members are added, people who left the segment (or opted out) are removed, and someone whose email or phone changed is updated.
- **Synced audiences** lists each audience with **Sync now** and **Stop syncing**. When you stop, the audience stays in the ad account with its current members.
## Send purchases to the Meta Conversions API
**Step: Connect**
Under **Meta Conversions API**, enter your **Dataset ID** (the pixel or dataset ID from Meta Events Manager) and an **Access token** generated in Events Manager.
**Step: Choose the events**
Under **Events to send**, pick the standard events to send. **Purchase** is the default.
**Step: Test**
Enter a **Test event code** from Events Manager (like `TEST12345`) and send a test purchase. You should see it under **Test events** in Meta Events Manager.
Every matching event LemuAI records from then on (from Shopify, the tracking snippet, the events API or WhatsApp orders) is sent with the contact's hashed details. Turning it on doesn't send past events.
## Common problems
- **Needs a new token:** the access token expired or was revoked. Generate a new one in Meta and press **Reconnect**.
- **The audience is small in Meta:** Meta shows only matched people, and small audiences may show as "below 1,000". Add more people or check contacts have email and phone with country code.
- **No events sent yet.:** no matching event has arrived since you connected. Check the [Event Log](https://docs.lemuai.com/event-log/overview) for `Purchase` events.
---
# Custom Records
> Store things a contact can have several of, like loans, policies or bookings, and use them in journeys, segments, messages and agents
URL: https://docs.lemuai.com/records/overview
For: Everyone
Checked against LemuAI app version 1.0.12
Related: [Catalog](https://docs.lemuai.com/records/catalog), [Segments](https://docs.lemuai.com/segments/overview), [Overview](https://docs.lemuai.com/api-reference/records/overview), [Contacts and data](https://docs.lemuai.com/troubleshooting/contacts-and-data)
## Overview
**Custom records** hold things a contact can have several of, each with its own dates and amounts. A lender might keep **Loans**, an insurer **Policies**, a clinic **Appointments**.
Each kind of thing is a **record type** with fields you choose. Every record belongs to one contact, called its **owner**. Once records are in Lemu you can:
- Start a journey a few days before a due date or renewal date
- Start a journey when a record is added or changes
- Call or message everyone with a matching record, once
- Find contacts by their records in a [segment](https://docs.lemuai.com/segments/overview)
- Show record values in messages, emails and agent calls
**Tip:** For things that aren't tied to one contact, like products, branches or plans, use a [Catalog](https://docs.lemuai.com/records/catalog) instead.
## Create a record type
**Step: Start a new type**
Go to **Custom records** in the sidebar and click **New record type**.
**Step: Start from a spreadsheet (optional)**
Under **Have a spreadsheet? Start from it.**, click **Upload CSV or Excel**. Lemu sets up the fields from the file's columns and imports its rows once you create the type. The file needs a phone, email or customer ID column so each row can be linked to its contact. Without one, rows can't be imported.
**Step: Name it**
Enter a **Name**, such as "Loans". Lemu also makes an API name from it (for example `loans`) that you use in the API and in templates.
**Step: Add fields**
List the fields each record has. See [Fields](#fields) below.
**Step: Choose the identifier**
Under **Each one is identified by**, pick the field that holds the ID from your own system, like a loan number. Importing or sending a record with the same ID updates that record instead of adding a new one. The identifier must be a Text or Number field.
**Step: Create**
Click **Create record type**.
## Fields
Each field has a name, a type and two switches.
| Type | Use it for |
| --- | --- |
| **Text** | Names, codes, short notes |
| **Number** | Amounts, counts |
| **Yes / no** | Flags such as "autopay on" |
| **Date** | Due dates, renewal dates |
| **Date and time** | Appointment times |
| **Choice** | One value from a fixed set. Type the choices separated by commas, for example `active, overdue, closed` |
| **Link** | A web address |
- **Required**: every record must have a value.
- **Personal**: the value is kept out of journey data, events and AI prompts, and is hidden from teammates who aren't allowed to see personal data. Use it for things like account numbers.
Lemu also picks up to 5 fields to make quick to filter on in triggers, segments and the records list, choosing dates first.
### Changing fields later
Open the record type and go to **Fields & settings**. While no records exist, any field can change. Once records exist, a field's type can't change and fields can only be **archived**: they are hidden but their values are kept. To store something new, add a new field.
## Add records
There are three ways to add records.
### By hand
On the **Records** tab, click **Add record**, fill in the fields and give the **Owner**'s phone or email. If no contact has that phone or email, a new contact is created.
### Import a file
On the **Import** tab, click **Choose CSV or Excel file**.
1. Lemu suggests what each column becomes. Change any column, or set it to **Don't import**.
2. Map at least one owner column: **Owner: phone**, **Owner: email**, **Owner: your customer id** or **Owner: Shopify customer id**.
3. Check the preview of the first 20 rows as they'll be saved, then click **Import N rows**.
The import runs in the background. The **Imports** list shows its progress and, when done, how many records were new, updated, unchanged or failed. Open **Rows that failed** to see why.
Things to know:
- A row with the same identifier as an existing record updates that record.
- A blank cell leaves that field as it is.
- Dates can be `YYYY-MM-DD` or `DD/MM/YYYY`.
- New records need the owner's phone or email. A contact is created when no one matches.
### From your system with the API
Send records from your own system with an [API key](https://docs.lemuai.com/configurations/api-keys). Each call creates or updates one record by its identifier:
- Fields you send replace the stored value, fields you leave out are kept, and `null` clears a field.
- Name the owner with `phone`, `email` or `external_id`. A new contact can only be created from a phone or email.
- Send up to 1,000 records in one call with the batch endpoint.
See [Upsert a record](https://docs.lemuai.com/api-reference/records/upsert) for the full request. The **How to use** tab on each record type shows a ready-to-copy example for that type.
## View and manage records
The **Records** tab lists every record with its identifier, fields, owner and when it was last updated. Use the search box and **Filter** to narrow the list, and the icons on each row to edit or delete a record.
### Filtering the list
Press **Filter** and add rows ("Show only records where"): pick a field, an operator and a value. Text and choice fields have **is**, **is not**, **is in**, **is not in** (comma-separated values, like `Paid, Partly paid`), **contains**, **doesn't contain**, **starts with**, **is set** and **is not set**; numbers have `=`, `≠`, `>`, `≥`, `<`, `≤`; dates have **in the next … days**, **in the last … days**, **on**, **before** and **after**.
Each row after the first has its own **and** / **or**. When you mix them, **and** is checked first: "A and B or C" means "(A and B) or C". The active filters show as chips next to the button, with **or** between the ones joined by or, and the list shows **Loading…** while it updates.
When you delete a record, journeys already running for it can still read it for 30 days. After that it is removed for good. Sending it again with the same identifier brings it back.
A contact's records also show on their profile, on the **Custom records** tab. See [Contacts](https://docs.lemuai.com/contacts/overview).
### Archive or delete a record type
On **Fields & settings**, click **Archive** to hide a record type without losing anything (turn on **Show archived** on the Custom records page to see it again, and **Unarchive** to bring it back). **Delete record type** is only offered while it has no records.
**Warning:** Journeys, segments and templates that use a deleted record type stop finding it.
## Use records in journeys and segments
| You want to | Use |
| --- | --- |
| Start a journey a few days before or after a date, like 3 days before a due date | Journey trigger **Record date** |
| Start a journey when a record is added or changes | Journey trigger **Record changes** (events `object_created` and `object_updated`) |
| Call or message every matching record once | A one-time journey with **Records** as the source |
| Find people by their records | Segment rule **Has records** |
See [Nodes and triggers](https://docs.lemuai.com/automation/nodes-and-triggers) for how to set these up.
## Use records in messages and emails
A journey that starts from a record (a date, a change, or a records source) has that record as `object`. Every journey and email also has all of the person's records as `objects`. Personal fields are left out.
```text
{{ context.object.amount_due }} in journey steps
{{ object.amount_due }} in email templates sent by that journey
{{ objects.loans.count }} how many loans the person has
{{ objects.loans.latest.amount_due }} the most recently updated loan
```
Replace `loans` and `amount_due` with your own API name and field. Values are read again before each step, so a message sent after a wait shows the latest numbers.
## Limits
| Limit | Value |
| --- | --- |
| Fields per record type | 50 |
| Choices in a Choice field | 100 |
| Text field length | 2,000 characters |
| Identifier length | 255 characters |
| Data in one record | 16 KB |
| Records in one batch API call | 1,000 |
| Days before or after a date in a Record date trigger | Up to 365 |
Your plan sets how many record types you can create.
## Next steps
- [Catalog](https://docs.lemuai.com/records/catalog): Products, branches and plans your agents can look up.
- [Segments](https://docs.lemuai.com/segments/overview): Group contacts by what their records say.
---
# Catalog
> Keep products, branches or plans in a catalog that voice agents and journeys can look up
URL: https://docs.lemuai.com/records/catalog
## Overview
A **catalog** holds items that aren't tied to one contact, like products, branches or plans. Your voice agents can look items up during a call (for example to answer "how much is it?" or "is it in stock?"), and journeys can look up an item and use its details in later messages.
Catalogs work like [custom records](https://docs.lemuai.com/records/overview), with two differences: items have no owner contact, and they are used through lookups rather than triggers.
## Create a catalog
**Step: Start a new catalog**
Go to **Catalog** in the sidebar and click **New catalog**.
**Step: Start from a spreadsheet (optional)**
Under **Have a spreadsheet? Start from it.**, click **Upload CSV or Excel**. Lemu sets up the fields from the file's columns and imports its rows once you create the catalog.
**Step: Name it and add fields**
Enter a **Name**, such as "Products", and list the fields each item has, like name, price and link. Field types are the same as for [custom records](https://docs.lemuai.com/records/overview#fields).
**Step: Choose the identifier**
Under **Each one is identified by**, pick the field that holds the ID from your own system, like a SKU or branch code. Importing an item with the same ID updates that item. The identifier must be a Text or Number field.
**Step: Create**
Click **Create catalog**.
## Add and manage items
Open a catalog to see its tabs:
- **Items**: every item in the catalog. Use **Search items** to find one and **Add item** to add one by hand. Edit or delete items from their row.
- **Import**: upload a CSV or Excel file of items. This works the same as [importing custom records](https://docs.lemuai.com/records/overview#import-a-file), without the owner columns.
- **Fields & settings**: rename the catalog, add a description, change fields, or archive it.
- **How to use**: a ready-to-copy API example and how to use the catalog in journeys and agents.
You can also send items from your own system with the [records API](https://docs.lemuai.com/api-reference/records/upsert). Up to 1,000 items fit in one batch call.
## Shopify products catalog
If you connect [Shopify](https://docs.lemuai.com/integrations/shopify), Lemu creates a **Products** catalog for you and keeps it in sync with your store every 30 minutes.
- Its fields are set by Lemu and can't be changed, and it has no **Import** tab.
- It doesn't count toward the number of catalogs your plan allows.
- If you already have a catalog called `products`, the Shopify one is named `shopify_products`.
- The catalog page shows when it last synced. If a sync fails, the reason is shown there.
**Note:** If you connected Shopify with a custom app, the app needs the `read_products` scope for products to sync. Customers keep syncing either way.
## Let a voice agent look up items
**Step: Create the tool**
Go to **Agent Setup > Tools**, create a new tool and choose **Catalog lookup**.
**Step: Pick the catalog**
Give the tool a name (for example "Look up product"), choose the **Catalog**, and describe in **When should the agent use it?** when the agent should look something up, such as "when the customer asks about price, stock or details".
**Step: Attach it to the agent**
Add the tool to your voice agent. During a call, the agent can look an item up by its identifier or by name.
Personal fields are never shown to the agent. See the [Tools library](https://docs.lemuai.com/tools-library/overview) for how tools work.
## Look up an item in a journey
Add a **Look up catalog item** step to a journey:
| Setting | What to enter |
| --- | --- |
| **Catalog** | The catalog to look in |
| **Item key** | The item's identifier, usually from the event that started the journey, for example `{{context.product_id}}` |
| **Save as** | The name later steps use for the item. Defaults to `catalog_item` |
The step has two paths: **found** and **not found**. Steps after **found** can use the item's fields, for example `{{context.catalog_item.price}}`.
See [Nodes and triggers](https://docs.lemuai.com/automation/nodes-and-triggers) for building journeys.
## Next steps
- [Custom records](https://docs.lemuai.com/records/overview): Records that belong to a contact, like loans or bookings.
- [Segments](https://docs.lemuai.com/segments/overview): Live groups of contacts built from rules.
---
# Inbox
> Read and answer your customers' WhatsApp messages in one place, with your team and the AI assistant
URL: https://docs.lemuai.com/messaging/inbox
For: Everyone
Checked against LemuAI app version 1.0.53
Related: [AI Assistant](https://docs.lemuai.com/messaging/inbox-assistant), [WhatsApp Messaging](https://docs.lemuai.com/messaging/whatsapp), [WhatsApp and Inbox](https://docs.lemuai.com/troubleshooting/whatsapp), [Lemu Tickets](https://docs.lemuai.com/integrations/lemu-tickets)
**Note:** **Setup required:** the Inbox shows customer replies only once your WhatsApp provider sends them to Lemu. Connect a provider and set up its webhook as described in [WhatsApp Messaging](https://docs.lemuai.com/messaging/whatsapp#receive-replies-and-delivery-receipts).
**Inbox** (top level in the sidebar) holds your WhatsApp conversations with customers, answered by your team and, if you turn it on, the [AI assistant](https://docs.lemuai.com/messaging/inbox-assistant).
There is one conversation per contact. It holds every WhatsApp message to and from that person: their replies, what your team wrote, and what journeys, voice agents and the AI assistant sent.
## Find a conversation
The list on the left shows each conversation with the contact's name or phone, the latest message and an unread count. When the latest message is one you sent, it starts with who sent it: **AI**, **Team**, **Journey**, **Campaign** or **API**. The total unread count is shown next to **Conversations**.
Search by name or phone with the box above the list, and pick a view under it:
| View | Shows |
|---|---|
| Open | All open conversations |
| Mine | Open conversations assigned to you |
| Needs a person | Open conversations your team is handling, including ones the AI handed over |
| AI handling | Open conversations the AI assistant is handling |
| Closed | Conversations you closed |
### Filters
Press **Filters** next to the search box. The button shows how many filters are on, and each one shows as a chip under the views: press **×** on a chip to remove it, or **Clear all** to remove them all.
| Filter | Options | Shows |
|---|---|---|
| **Last message from** | Anyone, Customer (waiting for a reply), AI, Team, Journey, campaign or API | Conversations whose newest message came from them. **Customer** means the customer wrote last and is waiting for an answer. A reaction doesn't count, and neither does a message that failed to send. |
| **Has replied** | Customer, AI, Team (tick any) | Conversations where any one you ticked wrote at least once. With dates picked, that message has to be in those days. |
| **Reply window** | Any, Open, Closed | **Open**: the customer wrote in the last 24 hours, so you can reply freely. **Closed**: only templates can be sent. |
| **Unread only** | On or off | Conversations with unread messages. |
### Sort and dates
Under the views:
- **Sort**: **Newest message** (the default), **Oldest message**, **Waiting longest** (conversations waiting for a reply first, the longest wait on top, then the rest newest first) or **Most unread**.
- **Dates**: **All time** by default. Pick Today, Yesterday, This week, Last week, This month, Last month, Last 7 days, Last 30 days or your own days, then press **Apply**. The list shows conversations with a message in those days.
Example: to answer today's customers who have waited longest, press **Filters**, choose **Customer (waiting for a reply)**, set **Sort: Waiting longest** and pick **Today** in the dates.
When nothing matches, the list says "No conversations match these filters." with a **Clear filters** button.
## Read a conversation
Open a conversation to see the full thread. The header shows the contact's phone, who is handling it (**AI assistant is handling** or **Team is handling**) and who it is assigned to.
Each message you sent shows where it came from and how far it got:
- **From**: AI assistant, Team, Journey, Voice agent or Test send
- **Status**: Queued, Sent, Delivered, Read or Failed
If the AI handed the conversation to your team, a note under the header says why, for example "Handed to the team: The customer asked for a person".
## Reply
WhatsApp only allows free-form messages within 24 hours of the customer's last message.
The thread looks like WhatsApp: your messages on the right with their time and ticks (one grey tick sent, two grey delivered, two blue read), the customer's on the left, and a chip for each day. Template messages show their text and buttons, not just the template name.
- **Inside the 24 hours**: type in the **Type a message** box and press **Enter** to send (**Shift + Enter** starts a new line), as on WhatsApp. Attach a file with a caption, send products from your [WhatsApp catalog](https://docs.lemuai.com/whatsapp/catalog), or send a template.
- **After 24 hours**: the composer shows **Reply window closed**, because WhatsApp only allows an approved template until the customer replies. Pick a template, fill in its variables and click **Send template**. See [Working with templates](https://docs.lemuai.com/messaging/whatsapp#working-with-templates).
Replying yourself takes the conversation over from the AI, so the assistant stops answering it.
**Info:** A contact who replied STOP or stopped marketing still gets your replies in a chat they start; only broadcasts and marketing templates are refused. A contact marked **Opted out of everything** gets nothing, from the Inbox or anywhere else.
## Manage a conversation
| Button | What it does |
|---|---|
| Assign to me | Assigns the conversation to you, so it shows under **Mine** |
| Unassign | Removes the assignee |
| Take over | Your team handles the conversation; the AI stops replying |
| Hand back to AI | The AI assistant answers again |
| Close | Closes the conversation |
| Reopen | Opens a closed conversation again |
When a customer writes in, a closed conversation opens again automatically and its 24-hour window restarts.
## Where messages come from
- Customer replies arrive through your WhatsApp provider's webhook.
- Messages sent by journeys (a **message** step), by voice agents (the **Send Message** tool) and by the AI assistant are added to the same conversation, so your team always sees the whole history.
- Each customer message is also recorded as a `whatsapp_message_received` event on the contact, which you can use in segments and journeys.
---
# Inbox AI Assistant
> Let an AI assistant answer WhatsApp messages in the Inbox and hand conversations to your team when it should
URL: https://docs.lemuai.com/messaging/inbox-assistant
**Note:** **Setup required:** the assistant answers WhatsApp messages that reach the [Inbox](https://docs.lemuai.com/messaging/inbox), so your WhatsApp provider's webhook must be set up first. See [WhatsApp Messaging](https://docs.lemuai.com/messaging/whatsapp#receive-replies-and-delivery-receipts). The assistant is off until an admin turns it on.
The WhatsApp AI assistant answers customers automatically in conversations it is handling, using your instructions and documents. It hands the conversation to your team when a customer asks for a person, is upset, or when it isn't sure.
## Turn it on
**Step: Open the settings**
In the [Inbox](https://docs.lemuai.com/messaging/inbox), click **AI assistant** above the conversation list.
**Step: Fill in the details**
Switch on **Answer customers automatically**, then fill in the settings below.
**Step: Save**
Click **Save**. The assistant starts answering new messages in conversations it is handling.
## Settings
| Setting | What it does |
|---|---|
| Answer customers automatically | Turns the assistant on or off |
| Business name | The name the assistant answers for |
| Instructions | What you sell, delivery times, return policy, store hours, tone of voice, and what the assistant must never promise. Up to 8,000 characters |
| Knowledge documents | Documents from your [Knowledge Base](https://docs.lemuai.com/knowledge-base/overview) the assistant searches for each message. Up to 50 |
| Message when handing over to the team | Sent to the customer when the conversation goes to your team. Leave empty to send nothing. Default: "Thanks! I'm connecting you with our team, they'll reply here shortly." |
| Most replies per conversation per hour | A safety limit, from 1 to 60 (10 by default). Stops endless loops, for example with another business's bot |
The assistant uses the same AI model as your voice agents.
## How it answers
- New conversations start with the AI handling them. If the assistant is off, they simply wait for your team.
- After a customer writes, the assistant waits a few seconds, so several quick messages get one answer.
- It replies in the customer's language, in short, friendly WhatsApp style.
- It only states facts from your instructions, your documents and the conversation. It does not invent order details, prices, dates, policies or links. If it doesn't know, it says a teammate will help and hands over.
- It only replies within WhatsApp's 24-hour window. It never sends templates.
## When it hands over
The assistant hands the conversation to your team, sends your hand-over message, and shows the reason in the Inbox, when:
- The customer asks for a person (for example "talk to a human", or "agent se baat" in Hindi)
- The customer is upset or complaining, or wants a refund, a cancellation or anything the assistant can't do
- The assistant isn't sure of the answer
- It reached **Most replies per conversation per hour**
- Its reply couldn't be generated or sent
Handed-over conversations appear under **Needs a person**. Click **Hand back to AI** when you want the assistant to take over again.
## When your team replies
Replying yourself takes the conversation over from the AI. The assistant stays quiet in that conversation until someone clicks **Hand back to AI**.
## STOP and START
Replies of STOP or START (and similar words such as "unsubscribe" or "opt in") are not answered by the assistant. They update the contact's WhatsApp consent instead. A STOP stops marketing, not replies: if the customer writes again later, the assistant answers as usual. See [WhatsApp Messaging](https://docs.lemuai.com/messaging/whatsapp#opt-out-and-opt-in).
---
# Voice Agent Builder
> Build a voice agent by creating a new agent at https://app.lemuai.com/workflow and talking through the setup with the AI Copilot.
URL: https://docs.lemuai.com/voice-agent/introduction

Creating a new agent opens the workflow canvas with a default flow already scaffolded — a Global node, a Start Call node, a main conversation node, and an End Call node — plus an **AI Copilot** panel on the right. The Copilot adds extra steps when your use case needs them (for example, finding a slot and then confirming the booking).
Talk (or type) through what you're building — the Copilot has a live call connection while you describe your use case, and fills in the canvas nodes and prompts as you speak. Be as specific as you like: deadlines, offers, what to say when a customer refuses, how firm or friendly the agent should be. Everything you ask for is written into the agent as you said it. The only exceptions are abusive language, made-up threats and harassment, which Lemu agents never use. See [AI Copilot](https://docs.lemuai.com/copilot/overview) for more on what it can do beyond initial setup.
Once the starting flow is in place, you can:
- Edit any node's prompt directly on the canvas to fit your use case
- Test the agent with a **Call** right from the builder
- **Save** your changes as a draft, or **Publish** when it's ready to take real traffic
---
# Editing a Workflow
> Learn the fundamentals of building workflows with nodes, pathways, and conversation flow in the voice agent builder.
URL: https://docs.lemuai.com/voice-agent/editing-a-workflow
## Overview
A workflow is a graph of connected nodes representing conversation stages, with pathways defining agent movement between stages.
## Global Node
Contains instructions applicable across the entire call:
- Company context
- Overall agent goal
- Tone and personality
- Common objection handling
## Node-Level Toggles
### Add Global Prompt
- Recommended to inject [Global Node](https://docs.lemuai.com/voice-agent/global) instructions into most nodes
### Allow Interruption
- **Default "On"**: Bot stops and responds to user interruption
- **"Off"**: Bot continues speaking, ignoring user input
### Detect Voicemail
- Available only in Start Node
- Automatically disconnects if voicemail detected
## Variable Extraction
Supported in Agent and End Call Nodes:
- Extract structured variables
- Define name, type, and description
- Examples: customer name, budget, interest
## [Webhook Node](https://docs.lemuai.com/voice-agent/webhook)
- Executed at call end
- Sends payload to specific endpoint
- Use for:
- Storing call data
- Triggering a journey
- Syncing with CRMs
## Editing Workflows
- Selectively delete nodes/pathways
- Completely reset workflow
## Pathways and Tool Calls
- Define agent node movement
- Use [tool calls](https://docs.lemuai.com/voice-agent/tools/http-api) to transition between nodes
- **"tool"** is a reserved keyword for function calls and actions
---
# Template Variables
> You can use Template Variables in your prompts for your Agent nodes, or when constructing the payload for the Webhook Node
URL: https://docs.lemuai.com/voice-agent/template-variables
## Template Rendering
You can reference template variables which is passed as [`initial_context`](https://docs.lemuai.com/core-concepts/context-and-variables#initialcontext) either using the [API Trigger](https://docs.lemuai.com/voice-agent/api-trigger) or when uploading a Sheet for a [campaign](https://docs.lemuai.com/core-concepts/campaigns). You can also use any extracted variable as [`gathered_context`](https://docs.lemuai.com/core-concepts/context-and-variables#gatheredcontext)
The template rendering can take nested values.
Example: If the initial context is
```
{
"initial_context": {
"user": {
"name": "John"
}
}
}
```
You can write your prompt to access the user's name as below
Prompt: `You are Alice, who is talking to {{initial_context.user.name}}.`
## Nodes
Lemu Voice Agents are composed of various nodes. These nodes can provide instructions to the voice agent, help you setup a [trigger](https://docs.lemuai.com/voice-agent/api-trigger) where you can trigger the voice agent to call someone, or help you setup a [webhook](https://docs.lemuai.com/voice-agent/webhook), where you can update the results of the call in your CRM or trigger a downstream workflow in n8n. In the next steps, we will be documenting the nodes that you can use in building the voice agent.
---
# Agent Settings
> Voice, language, turn detection, call limits and background sound for one voice agent
URL: https://docs.lemuai.com/voice-agent/agent-settings
## Overview
Each voice agent has its own settings for how it sounds and how it handles a call. Open an agent and click **Configurations** (the gear icon) in the editor toolbar. Click **Save Configuration** when you're done.
## Agent name
The name of your agent, as shown in your list of voice agents.
## Voice (TTS) settings
- **Select Agent Voice**: pick from the voices in your [Voice Library](https://docs.lemuai.com/voice-library/overview)
- **Voice Language**: the language the agent speaks
- **Speech speed** and **Speech volume**: shown when the voice supports them. Leave them alone to use your organization's default
See [Voice](https://docs.lemuai.com/configurations/voice) for more.
## Transcriber (STT) settings
- **Transcriber Language**: the language the caller is expected to speak. See [Transcriber](https://docs.lemuai.com/configurations/transcriber)
Background noise from the caller's side is filtered out automatically on every call, before the audio is transcribed. There is nothing to turn on.
## Ambient noise
Mix a quiet background sound under the agent's voice so the call feels more natural.
1. Switch on **Use Ambient Noise**
2. Choose a **Sound**. Click the play button next to any sound to hear a preview:
| Sound | What it sounds like |
|---|---|
| Office – Typing | Keyboard typing and office sounds, no voices |
| Office – Calm | A quieter modern office |
| Call Center | An office with people talking in the background |
| Cafe | A coffee shop |
| Rain | Gentle rain |
| Nature | Forest and birds |
| Traffic | Street traffic |
| Flute | Soft flute music |
3. Set the **Volume** (0 to 100%, default 30%). Previews play at the volume you choose, so you can hear how loud it will sit under the agent's voice
**Tip:** Phone calls carry narrowband audio, so the sound will be a little duller on a real call than in the preview. Make a test call before going live.
## Turn detection
Turn detection decides when the caller has finished speaking and the agent can reply. Too eager and it interrupts; too patient and replies feel slow.
| Detection Strategy | Best for |
|---|---|
| Transcription-based | Short answers such as yes or no, amounts and dates. Ends the caller's turn after a short silence once speech is transcribed |
| Smart Turn Analyzer | Longer answers with natural pauses. Uses a speech model to tell a pause from a finished thought |
With **Smart Turn Analyzer**, **Incomplete Turn Timeout (seconds)** sets how long to wait in silence when the caller seems to be mid-thought (0.5 to 10 seconds).
## Call management
- **Max Duration (s)**: the longest a call can last before the agent ends it (default 600 seconds)
- **Idle Timeout (s)**: how long the agent waits when the caller says nothing (default 10 seconds)
## Other agent settings in the toolbar
| Toolbar button | What it does |
|---|---|
| **Template Context Variables** | Default values for the variables used in your prompts. See [Template Variables](https://docs.lemuai.com/voice-agent/template-variables) |
| **Dictionary** | Words the transcriber should recognize, such as product names and brand terms |
| **Recordings** | Upload pre-recorded audio clips the agent can play during a call |
| **Voicemail Detection** | Detect when a call reaches voicemail and handle it instead of talking to the machine |
| **Deploy Workflow** | Put the agent on your website. See [Web Widget](https://docs.lemuai.com/voice-agent/web-widget) |
---
# Testing Your Agent
> Try your voice agent by browser call, phone call, text chat, or against another AI agent before going live
URL: https://docs.lemuai.com/voice-agent/testing
## Overview
Every voice agent can be tested straight from its editor. Open the agent and click **Call** in the top-right corner to choose a test.
| Test | What it does |
|---|---|
| **Web Call** | Talk to the agent through your browser microphone. The quickest way to hear how it sounds |
| **Phone Call** | The agent calls a real phone number using your [telephony provider](https://docs.lemuai.com/integrations/telephony/overview) |
| **Test Chat** | Chat with the agent by text. Useful for checking the conversation flow and tool use without speaking |
| **Test vs Agent** | Run a LoopTalk test, where another AI agent plays the caller |
**Note:** Save your changes before testing so the test picks them up. Publish them when you're happy (see Versions below).
## Web call and phone call
A **Web Call** asks for microphone access the first time. A **Phone Call** needs a telephony provider connected under **Agent Setup → Telephony**; if none is set up, the dialog walks you through it.
After the call, open it from **Runs** in the sidebar to see the transcript, the recording, the details the agent captured, and every tool call. See [Tracing](https://docs.lemuai.com/configurations/tracing).
## Test Chat
**Test Chat** opens a chat window where you type as the caller and the agent replies in text. It follows the same prompts, transitions and tools as a voice call, so it's a fast way to check the logic before testing by voice.
## LoopTalk: test against another agent
**Test vs Agent** creates a LoopTalk test. Instead of you playing the caller, another voice agent (the **Adversary Agent**) does. Write that agent's prompt like a customer persona, for example an impatient caller or someone who keeps changing their mind.
- **Test Type**: **Single Test** runs one conversation; **Load Test** runs several at once
- **Concurrent Pairs (1 to 10)**: how many conversations run in parallel in a load test
LoopTalk tests and their transcripts are listed on the **LoopTalk** page.
## Versions: draft, publish and history
Changes you make are saved to a **draft**. Calls and campaigns keep using the published version until you click **Publish**. Use **Discard draft** to throw away unpublished changes.
Click the history (clock) button to see earlier published versions. While viewing an older version, click **Back to Draft** to return to your working copy.
---
# Web Widget
> Put your voice agent on any website as a chat window, a voice call button or both, with product buttons and support tickets.
URL: https://docs.lemuai.com/voice-agent/web-widget
For: Everyone
Checked against LemuAI app version 1.0.51
Related: [Agent Node](https://docs.lemuai.com/voice-agent/agent), [Lemu Tickets](https://docs.lemuai.com/integrations/lemu-tickets), [Template Variables](https://docs.lemuai.com/voice-agent/template-variables), [Calls and telephony](https://docs.lemuai.com/troubleshooting/calls)
The web widget puts your voice agent on your own website. Visitors press a button and **chat with the agent by text**, **talk to it by voice in the browser**, or both in one window. You paste one piece of code into your site once; whatever you save later in LemuAI reaches your site by itself.
The widget can also show the products your agent looks up as cards with your own buttons (like **Add to cart**), and let the agent open support tickets in Lemu Tickets for visitors it can verify.
## Before you start
- A voice agent to put on the site (see [Voice Agent Builder](https://docs.lemuai.com/voice-agent/introduction)).
- For product cards: a catalog the agent looks items up in (see [Catalog](https://docs.lemuai.com/records/catalog)).
- For support tickets: Lemu Tickets connected in **Settings → Integrations** (see [Lemu Tickets](https://docs.lemuai.com/integrations/lemu-tickets)).
## Steps
**Step: Open the Deploy dialog**
Open your voice agent and press **Deploy Workflow** in the editor toolbar. The dialog is called **Put your agent on your website**, with a **Live preview** of the widget on the right that you can try.
**Step: Setup**
Under **What visitors can do**, pick **Chat and call** (one window for both: a call carries on from the chat, and the chat from the call), **Chat**, or **Call**.
Under **Websites it works on**, type your site, such as `yourshop.com`, and press **Add**. `*.yourshop.com` covers every subdomain, and `yourshop.com` also covers `www.yourshop.com`. Anywhere else the widget doesn't show.
**Step: Button, Window and Behaviour**
Match the widget to your site. The fields are listed in [Customization](#customization) below. The preview changes as you go.
**Step: Products & tickets (optional)**
Turn on product cards and choose their buttons, and let the agent open tickets for verified visitors. See [Product cards and buttons](#product-cards-and-buttons) and [Support tickets](#support-tickets).
**Step: Save and get the code**
Press **Save and get code**. The dialog moves to **Add to website**.
**Step: Add to website**
1. **Copy the code** and paste it just before the closing `