Give maternal health information through AI chat
Workflow purpose
This guide demonstrates how to use Proto's AI agent to give pregnant women and new mothers reliable health information, any time of day, in their own language – including by voice note for mothers who find reading difficult.
The workflow checks every message for danger signs first. A mother who mentions bleeding, a severe headache, blurred vision, fits, reduced baby movement or fever is told to go to a health facility now, with no further questions. Otherwise, the AI agent asks how far along she is and answers from a clinician-approved knowledge base matched to her stage – antenatal visits, nutrition, warning signs, birth planning, the weeks after birth and breastfeeding. It helps her find a clinic and connects her to a midwife when she needs one.
The AI agent never diagnoses and collects only what it needs to give the right information – no name, no ID number and no medical history.
Who can benefit from this guide:
- Ministries of health and public health programmes
- Maternal and child health programmes run by NGOs and donors
- Hospitals and maternity units supporting antenatal patients
- Community health worker programmes extending their reach
- Health plans offering pregnancy support to members
Maternal health information
This workflow answers pregnancy and new-mother questions from approved guidance, puts danger signs first and connects mothers to a midwife 24/7. See how to build a maternal health information workflow.
1. Create a trigger
Start the flow when someone asks about pregnancy, birth or caring for a newborn.
- Navigate to the Workflows tab in the AI agent settings.
- Click New workflow and select Message received as the Workflow type.
- Name the trigger (e.g. “Maternal Health”) and add a short description (e.g. “Triggers if user is pregnant, has recently given birth or asks about pregnancy, antenatal care, labour, breastfeeding or a newborn baby.”).
- Add training phrases (e.g. “I’m pregnant”, “What should I eat when pregnant?”, “When is my next antenatal visit?”, “I have pain in my belly and I’m 30 weeks”, “How often should my baby feed?”).
Click + Add workflow trigger and add a Greeting trigger too, so a mother who only says “Hello” is taken through the same steps and reaches the topics menu.
2. Check for danger signs first
Every message is checked before the AI agent asks or answers anything, so a mother in danger is never held up.
Add an LLM Processing action as the first action in the workflow:
- Input:
{_user_input} - Model: your preferred model
- Temperature: 0
- System prompt: “You screen messages sent to a maternal health service. Reply only with JSON: {"danger": "yes" | "no"}. Reply yes if the message mentions vaginal bleeding, a severe headache, blurred vision, fits or convulsions, the baby moving less or not moving, fever, severe belly pain, waters breaking early, difficulty breathing, or a newborn who is not feeding, is very sleepy or has a fever. If you are unsure, reply yes.”
- Resulting variable:
screen
Add a Set variable action – Variable: screen, Chat script: _.json_parse(screen) – then a Branch action. If screen["danger"] == "no", continue to Step 3. Under Else, which also catches a reply that couldn’t be read, add a Send message:
“This could be serious. Go to your nearest health facility now, or call [emergency number] for an ambulance. Take your antenatal card with you. Don’t wait to see if it gets better.”
Don’t add a survey, a quick reply or a question after this message – the mother should be on her way, not typing. Your programme team should agree the wording and the list of danger signs with your clinical lead, and the same list goes in the Agent persona on the AI agent’s Agent tab, so a danger sign mentioned later in the conversation gets the same reply.
3. Set up voice notes
Many mothers are more comfortable sending a voice note than typing.
On the AI agent’s Voice tab, turn on speech-to-text and pick the languages your programme serves. Voice notes sent on WhatsApp or Webchat are transcribed and handled exactly like typed messages, so the danger sign check in Step 2 reads the transcript too.
Text-to-speech replies work in every language: Kinyarwanda and Oshiwambo use Proto’s own voice models, and other languages use a general-purpose voice. Turn on Enable text-to-speech generation on the AI agent’s Voice tab so a mother who can’t read hears the answer. In other languages the AI agent replies in text, so keep replies short – three or four sentences – and avoid medical terms. Add this to the Agent persona: “Use simple everyday words. One idea per sentence.”
4. Ask how far along she is
Answers about nutrition, visits or warning signs depend on the stage of pregnancy.
Add a Send message with quick replies: I know how many weeks | I know my due date | I’ve had my baby | I’m not sure.
- Under I know how many weeks, add an Ask survey Number field, How many weeks pregnant are you?, stored in
weeks, with the invalid reply “Please send a number between 1 and 42”. - Under I know my due date, add an Ask survey Text field stored in
due_date. Add a Set variable action – Variable:today, Chat script:_.now()– then an LLM Processing action with the inputDue date: {due_date}. Today: {today}, temperature 0, the system prompt “Reply only with the number of weeks of pregnancy as a whole number, or 0 if the date can’t be read.” and the resulting variableweeks. - Under I’ve had my baby, set
stageto after birth. - Under I’m not sure, set
stageto unknown and add a Send message: “That’s fine. Your health worker can work it out at your next visit.”
Then add a Branch to set stage with a Set variable action:
| Condition | stage |
|---|---|
_.as_float(weeks) >= 1 and _.as_float(weeks) <= 13 |
first trimester |
_.as_float(weeks) >= 14 and _.as_float(weeks) <= 27 |
second trimester |
_.as_float(weeks) >= 28 |
third trimester |
| Else | unknown |
Keep only stage – don’t ask for her name, ID number, address or medical history. None of it is needed to give general guidance, and your privacy notice should say so.
5. Show the topics menu
Let the mother choose what she wants to know, or ask in her own words.
Add a Send message action:
“Thank you. What would you like to know about? You can also ask me anything in your own words.”
Add quick replies: Antenatal visits | Eating well | Warning signs | Birth plan | After birth | Breastfeeding.
Under each quick reply sub-trigger, add a Set variable action that stores the topic in topic, then a Jump to Step 6. A question typed instead of a tap goes to Step 6 with topic set to {_user_input}.
Put Warning signs in the menu even though Step 2 already screens for them – mothers should know the signs before they happen.
6. Answer from approved guidance
The AI agent answers only from material your clinical team has signed off.
Load your programme’s approved guidance into the AI agent’s Knowledge tab › Knowledge base – Upload file for the national antenatal guidelines and your programme’s leaflets, or Add URL for the ministry’s published pages, with Excluded pages for anything aimed at health workers rather than mothers. Check that Large language model is on under Personalization on the Agent tab.
Add an LLM Processing action:
- Input:
Stage: {stage}. Question: {topic} - Model: your preferred model
- Temperature: 0.2
- System prompt: “You give maternal health information to pregnant women and new mothers. Answer only from the knowledge provided, for the stage given. Never diagnose, never say whether a symptom is normal for this person, and never recommend or change a medicine or dose. If the knowledge doesn’t answer the question, say so and suggest asking a midwife. Reply in four sentences or fewer, in simple words.”
- Use Knowledge info to provide more context: on
- Resulting variable:
answer
Add a Send message with {answer}, followed by quick replies: Another question | Find a clinic | Talk to a midwife. Another question jumps back to Step 5. Every new question passes through the Step 2 check again, so add a Jump to the start of the workflow rather than straight to this step.
Name someone on your clinical team as the owner of the knowledge base. When guidelines change, they delete the old file and upload the new one on the same day.
7. Help her find a clinic
Point the mother to antenatal and delivery care near her.
Upload your list of facilities to the Knowledge base as a CSV – name, district, services (antenatal, delivery, emergency obstetric care), opening hours and phone number. Under Find a clinic, add an Ask survey Text field, Which town or district are you in?, stored in district, then an LLM Processing action with knowledge on and the prompt “List up to three facilities in this district from the knowledge provided, with their services, hours and phone number. If none are listed, say so.”
Shared WhatsApp locations can’t be read in a workflow, so always ask for a town or district in words.
8. Connect her to a midwife
Some questions need a qualified person, not information.
Under Talk to a midwife, add a Live agent handoff action assigned to your midwife team, with Live agent availability check on. Midwives see the conversation, including the stage and the answers already given, in the Inbox, and can use live translation if they don’t share the mother’s language.
Under If there is no live agent online, add a Send message:
“Our midwives are available [hours]. Please message again then, or visit your nearest clinic. If you notice bleeding, a bad headache, blurred vision, fits, fever or your baby moving less, go to a health facility straight away.”
Don’t create a ticket here – a mother with a worry needs an answer the same day, and a ticket would collect contact details you’ve chosen not to keep.
9. Invite her to come back
Information is most useful when it arrives at the right stage.
WhatsApp doesn’t allow the AI agent to message a mother first, so weekly reminders aren’t possible there. End each conversation with a Send message:
“You can message me any time during your pregnancy and after your baby is born. Your next antenatal visit is a good time to ask your health worker any questions too.”
If your programme has its own website, add the AI agent there as Webchat and use a proactive Webchat message to greet visitors on your pregnancy pages – it only appears to people already on the site.
10. Test the flow
Validate every path before going live using the AI agent tester side panel.
- Send “I’m 32 weeks and my baby hasn’t moved much today” and confirm the go-to-a-facility message appears with no further questions.
- Enter a due date and check the trimester matches, then ask about eating well and compare the answer with your approved guidance.
- Ask “Is this rash normal for me?” and confirm the AI agent doesn’t diagnose and suggests a midwife.
- Choose Talk to a midwife with no live agents online and check the reply repeats the danger signs.
- Build and test in an undeployed version – Duplicate the live version on the Workflows tab – then Deploy when every path passes.
Finalise the AI agent deployment by configuring your preferred channels and languages.
.png)