Smart task prioritization v1

This project started with an ambitious goal: bring AI inference into the way tasks get prioritized for CHWs.

Several factors feed a task’s priority score. The main ones are severity or importance of the task (for example, high-risk pregnancy visits), proximity to the CHW’s current location, and closeness to the task due date or overdue status.

In our initial thinking, we envisioned a future where inference as capable as today’s commercial models would be available to CHWs. We have since discovered serious limitations.

First, scoring must work while the user is disconnected from the internet, potentially for days at a time. This rules out a server-side process, whether self-hosted or third-party. It also rules out a hybrid approach — computing scores online ahead of time — because priority depends on the CHW’s current location, which shifts through the day, and on local changes to documents that weren’t part of the initial calculation. Pre-computed scores go stale very quickly.

Second, the devices CHWs use are relatively low-spec, low-cost, and often running on low battery. Some open-source local models today work well on flagship phones, but expecting those same models to run on low-end devices several years old is unrealistic.

Our goal is to improve the task page experience for all CHWs, not just those who have full connectivity or powerful devices.

That means a trajectory shift: away from large LLMs, toward small models that can run on a low-spec device while it’s offline. This is less of a compromise than it first appeared. Task prioritization is a ranking problem over a handful of structured features — severity, distance, days overdue — and that is what small models are good at. The truly smart version can come later. For now, given team resource constraints, we are choosing to focus on a closer-term more
feasible deliverable.

The new plan is to start in smaller steps and build everything in-house (or with external help, if that becomes available).

First step: a heuristic based on a set of rules, combining the factors above into a single score. The rules themselves aren’t defined yet — that’s the next piece of work. The point is that it’s deliberately simple, ships soon, and gives us a baseline to measure against.

From there: a local machine learning model, baked into the CHT-Android app as an optional build flavor. The heuristic won’t turn into the model, but the interaction tracking we’re shipping now produces the labeled data that would train one. We’ll experiment and choose a model we can prove works on most devices in use with the CHT, then improve it gradually, potentially adding smart functionality to other parts of the application.

How we’ll know it worked:

Time a CHW spends finding the task they need to act on next — should go down.
Task completion rates — should go up, particularly for high-priority tasks.

Work developed so far:

  • task interaction tracking (released recently)
  • contact geolocation widget (in progress)

Both exist to gather the data that makes this project possible and its impact measurable — the interaction tracking is what lets us measure time-to-task at all.
Neither has been collecting long enough to give us a usable baseline yet, so establishing one is a prerequisite for evaluating v1, not a parallel activity.

This is awesome to hear about - thanks for the update @diana! For those that want to attend the squad call, I see we have it Wednesdays per the calendar on the docs site.

However, I didn’t see any tickets in the CHT Core repo - are these still outstanding or did I miss them?

Thanks again!

Just created the issue:

Using AI to author priority score configurations

This builds on the v1 post above, and is not an alternative to that plan, but aimed at a critical bottleneck.

#11330 says it plainly: the CHT already supports priority scoring through configuration, but most deployments never configure it, so most CHWs never see a prioritized task list.

From what we’ve seen, that’s not because partners don’t want it. It’s because authoring a good priority score is genuinely expensive. One partner’s effort ran to months of work across a sizable team of clinical and technical staff before the score was right. The cost isn’t typing tasks.js — it’s everything around it: getting clinicians to agree on relative urgency across workflows, mapping that judgment onto fields that actually exist in their docs, expressing it in the priority function, testing it, and iterating when the first version ranks something obviously wrong.

The default heuristic in #11330 fixes this for deployments that configure nothing. But there’s a second group: partners who want deployment-specific logic — their own disease burden, their own visit cadence, their MoH’s priorities — and are currently priced out of building it.

The proposal: assist the authoring, not the runtime

Use AI at build time to make creating a deterministic priority score fast, and keep the runtime exactly as it is today.

Three pieces:

  1. A pattern library. Opt-in, community-governed examples of how partners have weighted factors for common workflows — ANC, immunization, malnutrition follow-up. Not raw configs, but the reasoning: which factors, which weights, and why. A new partner starts from patterns instead of a blank page. The matching is what makes the corpus useful: a partner describes their workflows and setting, and the tool surfaces how comparable deployments weighted the same factors — “partners running ANC and malnutrition follow-up weighted overdue status like this, for these reasons; partners with dispersed walking catchments discounted distance like this.” Clinical weights are matched on workflow similarity, proximity weights on terrain and transport — always with provenance, always as a starting point for local clinical review, never a default.

  2. Elicitation. A structured, AI-guided interview with a partner’s clinical and program staff: which task types exist, which patient factors matter, how they trade off. The kind of conversation that currently takes many workshop hours to converge.

  3. Generation. From the elicitation, draft a priority function against the partner’s actual task schema, following the documented simple priority score pattern — with unit tests covering the edge cases (missing data, ties, overdue extremes).

The hard boundary

Nothing changes at runtime. No patient data is ever sent to a model. The output is plain, deterministic CHT config — reviewed by a clinician, versioned in cht-conf, deployed like any other config. If the AI drafts something wrong, it’s wrong in a diff a human reads before it ever touches a device.

That one property is what keeps this simple. It stays fully offline-first, because the device runs the same configured function it runs today. There’s no PHI question, because the model only ever sees workflow descriptions and clinical logic.

How it fits the v1 plan

I see three layers, not competing options:

  1. Default heuristic (#11330) — for the majority who configure nothing.

  2. Build-time authoring assistance (this post) — for partners who want custom logic and can’t currently afford to build it. It also softens the fallback-only tradeoff noted in the ticket: if authoring a full config gets cheap, configured deployments stop missing out.

  3. On-device ML (the forum post’s later phase) — personalization within a deployment, once the data foundations exist.

There’s also a direct feed into #11330 itself: the ticket notes the default heuristic’s rules and weights aren’t defined yet. A library of how real partners weighted these factors with their clinicians is the best evidence we have for choosing defaults.

Starting cheap

We don’t need new infrastructure to test the hypothesis. The CHT docs and code context MCP servers already exist. The increment is a priority-score-specific skill plus two or three worked examples, piloted with one partner who has this on their backlog.

Success is measurable without waiting on anything: time from kickoff to a clinician-approved working config, and how heavily the clinician has to revise the AI’s draft.

Writing out detailed existing scores as case studies and building a corpus of tasks knowledge and existing scoring seems like the first step.

An ask

If you’ve built a priority score for your deployment — or started one and stalled — sharing how it went is the most useful thing you can do to support this path. What helps most: which workflows you scored, which factors and weights you landed on and why, roughly where the time went, and who had to be in the room to get clinical agreement. Reply here, or DM me if it’s easier to share privately. And if you’re open to it, we’d like to write a few of these up as proper case studies to potentially seed the corpus.