Inspiration

In Senegal, only 27% of young people in rural areas complete secondary school (MENA / ANSD). The gap is not motivation — it is access. A student in Kaolack or Thiès preparing the Baccalauréat has the same exam as a student in Dakar, but not the same tutor, not the same library, and not the same bandwidth.

Every "AI tutor" I tried had the same two flaws for that student. It required an app and a data plan. And when the student got stuck, it simply gave the answer — which produces a completed homework sheet and no learning at all.

SunuMind was built against both of those.

What it does

SunuMind is an AI tutor that lives inside Telegram, the messaging channel that actually works on low-end phones and weak networks in rural Senegal. No app to install, no account to create, minimal data.

It does three things that a generic chatbot does not:

It is anchored in the real curriculum. Every exercise it generates names the official MENA chapter, the matching Baccalauréat past paper with its point value, and the key formula. Not "probability" — Probabilités conditionnelles, Terminale S2, Bac S2 sessions 2023 Ex 1 and 2021 Ex 1, 4–5 points.

It refuses to hand over the answer. This is the core design rule, enforced in the system prompt. When a student answers wrong, the tutor corrects the reasoning, recalls the relevant formula, and asks one question back. The demo video shows this happening live: the student answers 0.5, and instead of correcting to 0.48, the bot replies "That's not quite it, but good reflex to try!" and walks them to it.

It adapts its format on demand. Ask "that's too long, just give me the first step" and it collapses to a single step with a mental-maths shortcut. Modes exist for ADHD, dyslexia and performance anxiety — conditions that go almost entirely undiagnosed in rural classrooms.

Exercises are contextualised locally: groundnut cooperatives, irrigation in the Niayes, mango harvests. Correct answers are validated in Wolof"Baax na!"

How I built it

  • Runtime: Node.js + Express, containerised and deployed on Google Cloud Run (us-central1), with Artifact Registry and Cloud Build.
  • Intelligence: the Gemini API (gemini-3.5-flash), driven by a system prompt that encodes the socratic constraint, the curriculum anchoring format, and the neurodivergent modes.
  • Persistence: Firestore for conversation memory, analytics and payment intents.
  • Interface: the Telegram Bot API over webhooks, plus a web "Situation Room" cockpit that reads live production telemetry from a single public endpoint.

The cockpit is deliberately public and unauthenticated for aggregates only — anyone can see which AI provider served the last call and how many messages have been processed. Student identifiers are behind a token and never exposed.

Challenges I ran into

Model retirement is faster than release cycles. In five days, two models the fallback chain depended on were withdrawn. gemini-2.5-flash returned "no longer available" on 10 August; gemini-2.0-flash did the same on 15 August. The chain still listed both, which meant the Gemini ladder effectively had one working rung — and the moment it wavered, traffic fell straight through to a free third-party model that leaks its internal reasoning into student-facing answers.

I found this the hard way: mid-recording, a student message took 53 seconds and came back from the wrong model.

The fix was empirical rather than assumed. I probed every candidate model three times against the live key and ordered the chain on measured results — pinned versions ahead of moving aliases, because an alias that silently follows a broken release is worse than a fixed identifier you verified yourself. I also learned that ListModels lies: gemini-2.5-flash still appears in the catalogue and still returns 404 when you call it.

Transient failures were being treated as permanent. A 503 means "overloaded right now", not "impossible" — the same semantics as a 429, which was already retried. It was falling through to the next provider on the first hiccup. Now both are retried three times with backoff before the chain moves on.

Filming production is a security surface. While recording proof-of-execution footage, the Cloud Run console displayed its environment variables panel for ten seconds — API keys legible on screen. Nothing was published, but the file was one deploy away from being served publicly. All three keys were rotated, the footage was excluded from the repository and the build context, and the mistake is now documented in the shooting checklist.

Accomplishments I'm proud of

The bot is genuinely in production, not staged: 51 revisions deployed since 7 July, live logs, live telemetry. The demo video is a real screen recording, not a mockup.

And the socratic rule holds under pressure. That was the thing most likely to break — a language model asked to withhold an answer will usually cave — and watching it refuse, correct, and hand the reasoning back to the student is the moment this project stopped being a prototype.

What I learned

Verify, then claim. Nearly every problem in this build came from a number or a status that was assumed rather than measured — a model believed available, a key believed revoked, a deployment believed done. The habit that fixed it was boring and mechanical: probe the live system before writing anything down.

What's next for SunuMind

Scaling beyond the current handful of real users is the honest next step — the infrastructure is ready, the audience is not yet reached. Concretely: sponsored access at scale (an initial €150 educational sponsorship funds 300 student passes), Orange Money for Premium, peer micro-groups of 5–10 students arbitrated by the bot, and deeper Wolof coverage so that the tutor meets students in the language they think in.

Built With

Share this project:

Updates