Inspiration – the problem
Imagine a mother in Makueni walking her children to school on a bright, sunny morning. There is not a cloud above them. The seasonal river is low, the drift looks calm, and hundreds of people cross it every week.
What she cannot see is the rain that fell last night in the hills, far upstream. That water is already on its way. Within minutes, a calm crossing becomes a wall of brown water – and there is no siren, no message, no warning. Just the river.
This is not a story we made up. Every rainy season in Kenya, people drown at river crossings that looked safe. In April 2024, nine people died when a truck crossing the swollen Kwa Muswii River in Makueni County was swept away. [Add the news link] Each of them was someone's parent, child, friend.
The warnings that exist are too far away from that moment: "flash floods possible in parts of the region." Nobody tells a village: "It is dry here – but your river is coming. Don't cross today."
As a Kenyan student, I kept asking one question: why should anyone die from rain they could not see? Mto Salama – Safe River – is my answer.
Who it helps: the chief, community health volunteer or school head who must decide, every rainy morning, whether people can cross – and through them, the children, boda riders, farmers and herders who trust that decision.
The safer outcome in one sentence: before anyone steps into the water, the local leader knows whether rain upstream makes the crossing dangerous today, and why.
What it does
Mto Salama watches the hills that people at the river cannot see.
A local leader opens it on a phone, picks their crossing and presses Check crossing. In seconds they get:
- A clear answer, in their language: DO NOT CROSS / USIVUKE, CAUTION / TAHADHARI, or LOOKS CALM – CHECK THE WATER, with one line saying what to do now.
- The reasons, in plain words: "88% chance the river surges by tomorrow", "78 mm of rain upstream this week – wetter than 92% of days", and what people at the river are saying.
- A ready-to-send SMS in Kiswahili and English, with a read-aloud button for anyone who struggles to read.
- The final word stays human. The leader approves the alert or says "I disagree" with a reason. Nothing is sent without a person deciding.
Everyone at the river becomes a lookout. Anyone can open Report from the river, tap what they see – water rising, people crossing, crossing damaged – and send it, with no name or phone number. They can write in Kiswahili, Sheng, English or Kikamba, because a warning only saves lives if it speaks the language of the people at the water: "Usi wausua kiwu" – the river is rising.
The moment that matters: it is sunny at the fictional Mto Kavuthu drift, but heavy rain fell upstream. A villager reports the water rising; another says people are crossing on boda right now. Mto Salama shows DO NOT CROSS. The chief sends the message. People wait on the bank – and the surge passes without taking anyone.
How we built it
I built Mto Salama alone, as a beginner coder, on a Windows laptop – using free tools so a county or community could actually afford to run it.
| Part | What it does | How well |
|---|---|---|
| Surge model (machine learning) | Learns from 26 years of Kenyan rain and river data how rain upstream turns into a surge. | Tested on 2019–2025, years it never saw: catches 78% of surges at CAUTION (ROC AUC 0.84). |
| Listener (NLP) | Our own offline reader for messages in Kiswahili, Sheng and English, plus a Kikamba word list (beta) corrected by a Kikamba speaker. A safety guard makes sure "the water is rising" is never read as "all clear". | ~80% accuracy; misreading danger as safe cut from 22% to 12%. |
| Four AI agents | Listener → Fusion → Skeptic → Messenger. They combine the rain and the reports, check each other, and refuse to sound more certain than the evidence. | A clear status, a confidence level and the reasons. |
| Claude (optional) | Reads only the hardest messages and polishes the alert. | Without it, everything still works offline. |
| App + 20 automated tests | Streamlit app on a phone browser; tests check the safety rules on every change. | Free hosting, always checked. |
Trust and responsible design
A wrong "safe" can cost a life. So Mto Salama is built to be humble:
- It never says "safe." The best it says is "LOOKS CALM – CHECK THE WATER." If the weather data is missing, it says CAUTION.
- It explains itself. Every warning shows why – the rain numbers and how each message was read.
- A person is always in charge. The leader can overrule it, with a reason, and it is logged.
- It protects the people who report. No names, no phone numbers, reports deleted after 24 hours.
- It never stands alone. Every alert points to official warnings and Kenya's emergency numbers: 999/112 and 1199.
- It speaks to everyone: Kiswahili and English alerts, Kikamba reports, read-aloud, and status in words – not colour alone.
Limitations
I want to be honest about what it cannot do yet:
- It catches about 4 in 5 surges, not all of them. It supports people's judgement – it does not replace it, or official warnings.
- River flow comes from a global model, not a gauge on the drift, so people's reports matter most at small crossings.
- The language model learned from synthetic messages, and Kikamba is in beta. It needs real, consented messages before it goes to the field.
- It is a prototype: it drafts alerts but does not send them yet.
Challenges we ran into
- The rivers that kill have no data. Small seasonal streams have no flow records, so the model learns from bigger rivers and watches the rain upstream of small crossings.
- The climate is changing inside the data. Rain upstream on the Athi rose by over 50% in recent years, so I tested only on the newest years the model had never seen.
- Choosing honesty over a big number. One test said 97% accuracy; a fairer test said 79%. I report 79%.
- A language with no digital data. There was no Kikamba training data, so I built a careful word list from dictionaries and had a Kikamba speaker correct it.
- Learning as I built. Version clashes, dropped downloads on slow internet, API limits – I solved each one, one error at a time.
Accomplishments we're proud of
- A working, free app that combines ML, NLP and agents – and still works with no AI service.
- A model judged on the future, not on what it memorised.
- A safety tool that speaks Kiswahili, English and Kikamba.
What I learned
That in a safety tool, trust matters as much as accuracy: a warning people understand, can question and can overrule is worth more than a clever one they ignore.
What's next for Mto Salama
My dream is simple: no family in Makueni should lose someone to rain they never saw.
- Test it with a chief and community health volunteers at a real Makueni crossing.
- Send approved alerts by SMS, and add Kikamba alerts once native speakers check them.
- Work with county disaster teams so every alert stands beside official Kenya Met warnings.
Try it
https://mto-salama.streamlit.app – press Check crossing and watch it warn. Code: https://github.com/Mesheco/Mto-Salama
Built during SafeSpace Hacks 2026 by Meshack Mutinda, Open University of Kenya. Data: Open-Meteo and GloFAS (Copernicus). Tools: Jac/byLLM, scikit-learn, Streamlit, Claude (optional). AI assistance: Claude helped with planning, code and writing. All demo messages and the Mto Kavuthu crossing are fictional; no victims are named.
Built With
- anthropic
- byllm
- claude
- git
- github
- github-actions
- glofas
- jac
- jaseci
- joblib
- logistic-regression
- open-meteo-forecast
- pandas
- pytest
- python
- random-forest
- scikit-learn
- streamlit
- streamlit-community-cloud
- tf-idf