The door closes

There is a moment in every clinic day that nobody outside medicine ever thinks about.

The patient stands up. You shake his hand. He walks out. The door closes behind him.

And that is the last thing you will ever know about him.

I'm a cardiologist. People assume the hard part of this job is the emergency. It isn't. In an emergency I know exactly what to do, I do it with my hands, and within minutes I find out whether it worked.

The hard part is the quiet.

I write a plan for a man. Get a lipid panel in two weeks. Start this tablet at night. Check your blood pressure twice a day for a week. Come back in a month. He nods. He means it. He walks out.

Nobody tells me if he got the test. Nobody tells me if he stopped the tablet because it made him dizzy and he was too embarrassed to say. Nobody tells me anything at all.

Sometimes, three weeks later, my phone lights up at 1 a.m. and it's him, frightened, asking me something he should never have had to wait three weeks to ask. And somewhere in that message I understand that the plan I gave him died the moment the door closed, because it was never written anywhere he could go back to, and there was nobody on this earth whose actual job it was to carry it for him.

Those are the ones I hear from.

I think about the ones I don't.

What I wanted

I didn't want a reminder app. Reminders fire on a date and don't care what comes back. I didn't want a portal, because a portal sits there waiting for a frightened man to log into it. I didn't want a scribe, because a scribe writes down the visit and then stops exactly when the visit stops. And I didn't want a chatbot, because a chatbot answers when it's asked, and the patient I'm most worried about is the one who has gone completely silent.

Every tool I could find waits.

I wanted the opposite of waiting. I wanted something that walks out of the room with the patient.

In Arabic there's a word for that. Sanad. It's what you call the person who holds you up when you can't hold yourself up. Your father is a sanad. Your oldest friend is a sanad. It isn't a reminder. It's someone who carries the weight so you don't have to carry all of it alone.

So that's what I built, and that's what I called it.

What happens now, after the door closes

I dictate my plan out loud, the way I'd actually say it. Sanad breaks it into care contracts. One for each thing I asked for. Each one carries what would count as proof it really happened, and the day it's due. I read the card once, I tap confirm, and from that second on they belong to him, not to me. I do not have to type it. I can dictate it, send a voice note, or photograph the prescription. All three enter the same structured proposal, and nothing is saved until I review and confirm it. That confirmation also creates a one-time Telegram link and QR code. I can print it with the prescription or show it on my screen. The patient scans it once; Telegram binds that chat to the correct record, consumes the token so it cannot bind another phone, introduces Sanad as an AI, and sends back the plan I confirmed. From then on, Sanad can message first.

Then Sanad goes to work.

Day 3. The patient messages, in Arabic, asking what LDL even means. Sanad explains it. For a question about his care, the plan I confirmed is the authority. For a general educational question, Sanad can explain, but code prevents it from introducing a new dose, target, or treatment instruction.

Day 14. The test is due. Nobody has to remember this, because two weeks ago the plan scheduled its own wake-up call. Sanad messages him. He says the lab is far and expensive. Sanad doesn't hand that to me as a problem: it goes and looks for a nearer one, and only comes to me if it genuinely couldn't solve it, with what it already tried printed on the card.

Day 16. A photograph of a lab slip arrives, crooked, taken on a phone, the way they always do. Sanad reads it. It checks the printed name against the record and the collection date against my order before a single value is allowed to count. And then it sees potassium at 6.4.

Day 16, one second later. The patient gets an emergency instruction, and my phone rings. Not a notification I'll see tomorrow. It rings.

No model made that decision. A table in the code did.

And the man who came back at 1 a.m. panicking three weeks late? He came back on day 16 instead, because something was carrying his plan the whole time he wasn't.

I stopped being the project manager. I became the exception.

The rule the whole thing rests on

No model is ever allowed to decide anything clinical.

Every boundary that can escalate is written in plain code. The AI is allowed to vote, and its vote can only ever add an escalation, never take one away. And every single one of those calls fails closed, which means if the model is down or confused, the message comes to me unanswered. It never quietly turns into "nothing to see here."

There are seven agents in Sanad and not one of them talks to another one. No agent chat, no handing off a conversation. One returns a value, plain code checks that value, the next one gets called with facts the code built.

That sounds like the boring choice right up until you ask what happens when one of them breaks. Any single agent can die and the system falls back to code and keeps running. And every decision on the board says who made it. Not "the AI decided." The agent, by name, and the file that could have overruled it.

In medicine, the impressive part isn't what a system does when it works. It's what it does when it doesn't.

How I built it, and what it cost me

It's one service on Google Cloud Run in Europe. FastAPI and Python, Google's ADK, Gemini 3.5 Flash through Vertex AI. Firestore holds what's true, Cloud Storage holds the photos, and Cloud Tasks holds the future, which is the part that lets a plan wake itself up two weeks later with nobody present.

I built it in slices, and every slice went live and got driven on the real service before the next one started.

Two things humbled me.

The first was an adversarial review. I asked a reviewer to try to disprove my safety claims, and it produced twenty-nine regression tests from failures it found. One still bothers me: my emergency-triage call was catching its own exception and returning “nothing found.” A model outage was quietly becoming a clean bill of health. It was one line of code, the difference between a real safety rail and a decoration shaped like one. Those findings were fixed and retained as permanent regression gates. The wider suite separately declares ten expected failures for known gaps rather than hiding them.

The second was the first time I tested it on a real phone instead of a laptop. A woman was addressed as a man in Arabic, the whole way through the conversation, because Arabic conjugates the second person and I'd only written one form. No test caught it. No log flagged it. It would just have quietly told every woman who used it that this thing was not built for her. The bugs that matter in a system that talks to human beings are not the ones that crash.

What I'm not pretending

Telegram is the working patient channel in this build because it supports one-time QR onboarding and proactive messages. WhatsApp is where many of my patients actually live, but it is deliberately not claimed here: the Business verification, approved outbound templates, consent work, and production review do not exist yet.

And no real patient has touched this, on purpose. Before one does: a proper data-protection review under Egypt's Law 151, a real consent flow, and clinical sign-off on every threshold. None of that exists yet and I won't onboard a single person until it does. Then a small pilot with my own patients, where I read every escalation it makes before I trust it any further.

Every patient in this project is invented. Sanad is not a medical device and its replies are not medical advice.

Why it exists

I can't be awake for every patient at 1 a.m. But I can refuse to accept that the door closing is the end of the story.

That's all Sanad is. Something that walks out with them, and doesn't stop until either the thing I asked for actually happened, or I'm told exactly why it didn't.

Built With

Share this project:

Updates

Submission history