Autonomous agents with memory and context — patent filed with the USPTO

Hal-AI for Hospitals · Outpatient schedule

Schedule, capacity utilisation and no-shows

Your published schedule is not your capacity. Between the slot the roster offered and the patient sitting in the consulting room there are three leaks: the slot nobody booked, the booking that was undone, and the patient who never showed. Three different problems, with three different owners — and the panel measures all three separately, every day.

Outpatient consultations only. The panel reads the official schedule through the HIS API — at Hal-AI there is no parallel calendar.

Team gathered in front of screens, tracking the indicators of a customer service operation.
Offered → booked → seen

Three leaks, three owners, three remedies

The roster publishes the week's schedule. By the end of the day, part of it became a visit and part of it evaporated. The classic mistake is to treat that evaporation as a single number — "utilisation is low" — and send everyone chasing the same thing. It is not one problem. It is three.

Leak 1

The slot nobody booked

The slot was published and sat there until closing time. The problem here is demand or access: either there is no queue for that specialty, or there is a queue and it cannot reach the front desk. Those are opposite diagnoses, and the waiting list is what tells them apart.

Who owns it: whoever publishes the schedule, and whoever runs access.

Leak 2

The booking that was undone

The patient told you they were not coming. That is good news — better than a no-show. The problem is what happens next: the slot goes back to open, and if nobody takes it in time, the cancellation costs exactly as much as a no-show. The window between the warning and the appointment is the asset here.

Who owns it: whoever works the waiting list.

Leak 3

The patient who never showed

They booked, nobody heard a word, and the slot died with a name on it. This is the most expensive leak, because nobody else could use the slot. It is also the most predictable one: the odds of a no-show grow with the age of the booking, and that can be attacked in advance.

Who owns it: the active confirmation routine.

The rigor the panel will not trade away

Open, canceled and no-show are not three slices of the same pie

A slot canceled at nine in the morning is back on the open list at one minute past nine. If nobody takes it, it ends the day on both lists: it was canceled and it finished empty. Adding the two columns counts the same slot twice — and that is why so many schedule dashboards close with a total larger than the whole schedule.

Here the math closes along a single path. The panel subtracts: slots offered minus appointments completed gives the capacity that never became a visit. Only then does it break that remainder down by cause, with no overlap — how many were never booked, how many were booked and canceled without anyone else taking the slot, how many were booked and the patient did not come.

Cancellation rate and utilisation measure different moments of the same day. They do not add up, and the panel says so in large type.

How the day is read

Four readings of the same schedule, in the order the day happens

The Squad wakes up before opening hours, calls api_get_schedule_capacity for the previous day's schedule and api_get_appointments for the state of each slot. What it builds is a timeline, not a snapshot:

  • Offered — what the roster published, before any booking.
  • Booked at day open — how many slots reached the day with a patient on them. That is utilisation.
  • Bookings still standing — what survived the cancellations of that day and the one before.
  • Completed — a visit on record. It is the only number that pays the bills.

The gap between the second and the third is cancellation. The gap between the third and the fourth is no-shows. The gap between the first and the second is the slot that never found a patient. Each of those three gaps has a different action attached to it — and none of them is "ask the front desk to try harder".

Tuesday

One day's schedule, in four readings

Offered500 Booked at day open430 Bookings still standing401 Completed305

500 − 305 = 195 slots never became a visit, and they break into three parts that do not overlap: 70 were never booked, 29 were canceled without anyone else taking the slot, and 96 turned into no-shows. 70 + 29 + 96 = 195.

500 slots is one weekday in a hospital that offers around 2,500 consultation slots a week.

The four numbers of the day

Every indicator next to its own median

Is 86% utilisation good or bad? On its own, the number does not answer. It only means something against what that same schedule usually does on that day of the week — because Monday opens with demand held back over the weekend, Friday loses to the long weekend, and Saturday runs half a schedule for a different crowd. Monday does not compare with Saturday.

61% slot→visit conversion · median of previous Tuesdays: 49%
86% schedule utilisation · median of previous Tuesdays: 74%
24% no-show rate over bookings still standing · median: 35%
6.7% cancellation rate · in line with the median of Tuesdays
Why the median, not the average

One long weekend should not run your indicator

All it takes is a transport strike, heavy rain or the eve of a public holiday for the average of the last few weeks to drift away from normal — and then the panel flags a drop that is nothing but calendar noise. The median of six equivalent weeks does not flinch at an outlier: it keeps describing the typical day.

The comparison is also run by day-of-week band and by specialty. A Tuesday orthopedics clinic is compared with orthopedics Tuesdays, not with the average of the entire outpatient operation, which dilutes everything.

Being honest about the example

The gap you see here is wide on purpose

The median shown is the one for Tuesdays before active confirmation went live. That is why the difference shows up in tens of points: these are two different operating regimes, not two consecutive weeks.

Once the routine is running, the comparison turns into small steps — a percentage point here, half a point there. And that is exactly when it starts to earn its keep: a three-point drop in one specialty's utilisation becomes a question the same morning, instead of a surprise at month-end close.

A good indicator is not the one that impresses in a presentation. It is the one that changes color early enough for somebody to act.

How each indicator is calculated, with the parts in plain sight

The four indicators of the day, the formula for each one with numerator and denominator spelled out, the value for the day and the median of the six previous Tuesdays.
Indicator How it is calculated Day Median of Tuesdays
Slot→visit conversion completed ÷ offered = 305 ÷ 500 61% 49%
Schedule utilisation booked at day open ÷ offered = 430 ÷ 500 86% 74%
No-show rate no-shows ÷ bookings still standing = 96 ÷ 401 24% 35%
Cancellation rate canceled ÷ booked at day open = 29 ÷ 430 6.7% in line
Different denominators on purpose — the four do not add up, and they should not 500 · 500 · 401 · 430 6 Tuesdays

How the Squad builds and delivers this panel every day

The deliverable

The "Daily Funnel" panel, as it reaches the coordination team

It is not a screen somebody has to open. It is a document published by the Squad at the end of the morning read — in HTML to read right away, and as a PDF to attach to the minutes of the capacity meeting. The agent writes the sections and points every table and every chart at the API call it made itself during the run. The server does the math and the drawing.

The run that produced the document

Finished Daily Funnel · run #112 on schedule · 06:38
06:38:02Context loaded — Tuesday schedule, outpatient scope, 28 specialties 06:38:05api_get_schedule_capacity(day="tuesday", scope="outpatient") — 500 slots offered 06:38:11api_get_appointments(day="tuesday") — 430 bookings at day open 06:38:1929 cancellations in the period; slots returned to the open list, none of them retaken 06:38:34api_get_schedule_capacity(window="6 tuesdays") — median by specialty 06:39:02cancellation reason blank or "other" on most of the 29 records — causes section suppressed 06:39:404 indicators closed · 7 rows by specialty · 4 lead-time bands 06:40:07Document published in HTML and PDF and sent to the authorized list
500 slots read · 305 completed · 1 gap declared audit trail recorded
Closed recipient list checked twice before sending · the agent adds nobody to it 4 authorized recipients
Hal-AI · Document published by the Squad PDF · 186 KB

Daily Funnel

How much of Tuesday's schedule became a visit, and where the rest escaped

Reading of the previous day's outpatient schedule, published by the Squad at 6:40 AM. Comparison: median of the six previous Tuesdays, by specialty.

scope outpatient consultations schedule 500 slots source api_get_schedule_capacity source api_get_appointments
01The four numbers of the day

The schedule offered 500 slots and delivered 305 completed appointments. Utilisation came in above the median of Tuesdays and the no-show rate below it; cancellations stayed at their usual level. That is the number to watch over the next few weeks: as active confirmation matures, part of the no-show volume turns into advance notice, and the cancellation rate rises before conversion does.

Slot→visit conversion 61% 305 of 500 · median of Tuesdays: 49%
Schedule utilisation 86% 430 of 500 at day open · median: 74%
No-show rate 24% 96 of 401 still standing · median: 35%
Cancellation rate 6.7% 29 of 430 · no meaningful change
02How the 500 slots ended up

The four bars below are successive readings of the same schedule, not categories you can add together. Between booked at day open (430) and bookings still standing (401) sit the 29 cancellations, whose slots went back to the open list and were not retaken. Between still standing (401) and completed (305) sit the 96 no-shows.

Slots offered500 Booked at day open430 Bookings still standing401 Appointments completed305

Figure 1 — the day's schedule at four moments. Capacity that never became a visit is 500 − 305 = 195 slots, broken into 70 never booked + 29 canceled without being retaken + 96 no-shows.

03Where capacity was lost, by specialty

Each bar adds the slots that finished empty to the ones that turned into no-shows — that is, everything the specialty offered and did not deliver. The shape of the bars separates two diagnoses that call for opposite decisions: a tight schedule with a long queue, and a schedule to spare with a short wait.

Capacity that never became a visit — slots by specialty source: api_get_schedule_capacity

Figure 2 — the tallest bar is the sum of the 22 remaining specialties, not a single clinic. It is here to give the other six a sense of scale.

04The day's schedule, row by row
Slots offered, appointments completed, slots that finished empty and no-shows, by specialty, in the Tuesday schedule.
Specialty Offered Completed Empty No-shows Reading
Orthopedics 96 60 14 22 52-day queue
Ophthalmology 84 58 9 17 schedule in balance
Cardiology 72 50 8 14 schedule in balance
Dermatology 58 29 21 8 supply to spare
Endocrinology 54 35 6 13 schedule in balance
Neurology 46 21 18 7 supply to spare
Remaining 22 specialties 90 52 23 15 combined
Day total — 500 = 305 + 99 + 96 500 305 99 96

Of the 99 slots that finished empty, 70 were never booked and 29 were canceled without anyone else taking the slot. In every row, offered = completed + empty + no-shows.

05A field nobody fills in

The cancellation reason came in blank or tagged as "other" on most of the day's 29 records. Until that field is genuinely filled in at the front desk, this panel publishes no chart of cancellation causes — reporting a distribution that rests on an empty field is worse than reporting nothing.

What the coordination team has to decideDermatology and Neurology closed the day with 39 empty slots between them, while Orthopedics still has a 52-day wait. Moving a block of schedule from one specialty to another is a human decision: the Squad sizes the opportunity and does not touch the roster.

What you are looking at

The outpatient day in a single piece: the four indicators with the median of the same weekday beside them, the schedule read at four moments, the capacity lost by specialty, and the row-by-row table where each specialty closes its own math. At the end, a note that is not a number: what needs a person to decide.

The math closes

No aggregate appears without its parts printed. 500 = 305 + 99 + 96 is in the table footer; 99 = 70 + 29 is in the caption; 195 = 500 − 305 is in the figure. Whoever gets the PDF can redo any sum on paper, and that is what separates a panel from a sales pitch.

Only on Hal-AI

Notice what the piece does not carry: no identified patient, no clinical data, no reason for the visit. The aggregate panel works with slot counts. And when a field at the source is empty — the cancellation reason, in this example — the document declares the gap instead of drawing a pretty chart on top of it.

How the document is assembled by reference to the API

The predictor nobody uses

The older the booking, the higher the chance of a no-show

A patient who books today for forty days from now has had a problem for forty days. In the meantime they got better, got worse and went to the emergency room, moved house, switched health plans, or simply forgot. Booking lead time is the cheapest piece of data a hospital already has, and almost never looks at.

The panel splits the day's standing bookings into four lead-time bands and calculates the no-show rate inside each one. The shape tends to be the same every time this is drawn: the curve climbs from left to right.

  • Same day — a fit-in, a follow-up booked right after, a slot recovered from a cancellation. The person just agreed to it; they come.
  • Up to 7 days — the appointment is still inside the horizon of whoever booked it. No-shows grow only a little.
  • 8 to 30 days — the most crowded band of the schedule, and where the absolute loss is largest, even though it is not the highest percentage.
  • More than 30 days — the booking has aged. In the scenario shown, this band no-shows at almost twice the rate of the same-day band.

That changes the order of the confirmation queue. Instead of firing a message at everyone at once — which burns the 24-hour window, spends templates and wears the patient out — the routine starts with the people who booked longest ago and with the specialties whose no-show rate is above their own median. Same number of messages, different order.

No-shows by lead-time band

No-show percentage within each band 401 bookings still standing · 96 no-shows

5 of 32 · 17 of 88 · 44 of 177 · 30 of 104. Added up: 96 no-shows across 401 standing bookings, the day's 24% no-show rate.

Where the volume is is not where the percentage is

The 8-to-30-day band does not have the highest no-show rate, but it does have the biggest share of the schedule: in the scenario, 177 of the 401 standing bookings. Going after the highest-percentage band alone is comfortable and pays little. The panel shows both readings side by side precisely so that the decision is not made with only one of them.

Same day32 Up to 7 days88 8 to 30 days177 More than 30 days104

32 + 88 + 177 + 104 = 401 standing bookings. The band with the highest no-show percentage is the smallest in volume; the largest in volume ranks third in percentage. Confirm the 30-day-plus band first and you recover rate; cover the 8-to-30-day band and you recover slots.

The cross-reading that matters

A 52-day queue on one side, a schedule to spare on the other

This is the finding that only shows up when the waiting list and schedule utilisation are read in the same table. Apart, each one tells half a story — and both lead to the same wrong conclusion.

Reading the waiting list alone

  • Orthopedics among the longest queues, with a 52-day average wait
  • The obvious read: we are short of doctors, we need to hire
  • Hiring takes months, lands on the payroll and cannot be undone
  • If the bottleneck is a room or a machine, the new hire arrives and sits down
  • The queues in other specialties drop out of the conversation

Reading queue and utilisation together

  • Orthopedics offered 96 slots and only 14 finished empty — the schedule really is tight
  • Dermatology offered 58 and finished with 21 empty; Neurology offered 46 and finished with 18
  • Together, 39 empty slots a day in two clinics whose wait is a matter of days
  • The decision becomes moving a block of schedule, not opening a headcount
  • The effect shows up the following week, and it is reversible if it does not work

The three clinics in the cross-reading, side by side

Comparison between the specialty with the longest queue and the two with supply to spare: empty slots in the day, share of the schedule and wait.
Specialty Offered Empty in the day Share of the schedule Wait Reading
Orthopedics 96 14 15% 52 days Tight schedule, long queue
Dermatology 58 21 36% a few days Supply to spare
Neurology 46 18 39% a few days Supply to spare
Slots available to move — 21 + 18 39 per day against a 52-day queue in the clinic next door
The conclusion, worked through

Reallocate the schedule, do not hire

Hiring another orthopedic surgeon is the reflex answer to a 52-day queue, and it is not always the right one. It takes time, it is expensive, it is hard to undo, and it solves exactly one of the possible bottlenecks — the surgeon's hours. If what you are short of is a consulting room on Tuesday morning, or the machine that exists in only two rooms, the new contract does not move the queue by a single day.

Reallocation costs one coordination meeting. You move a consulting-room shift from a clinic with slots to spare to a clinic that is short, publish the new schedule and watch the effect for two weeks. If it does not work, you move it back. In the scenario shown, recovering about 17 of the 39 empty slots a day — fewer than half — gives 17 × 66 business days ≈ 1,120 appointments in the quarter: the order of magnitude of +1,150 appointments completed per quarter with the same schedule, and not one new hire.

The effect on the queue comes with it: the average wait in the longest-queue specialties goes from 52 to 31 days once the reallocated schedule is added to the drop in no-shows. The agent does not do this — the coordination team does, with the breakdown in hand.

Before you move any block

Not every slot is interchangeable

The panel points at where there are slots to spare. It does not know whether those slots can become something else. Before reallocating, the coordination team has to check four constraints that are not in the calendar:

  • Room and equipment — a dermatology room does not always work for orthopedics.
  • The clinician's contract — contracted hours come with a shift and a day attached.
  • Payer contracts — not every specialty is in network with every payer (health plan).
  • Access rules — a regulated referral queue is not the hospital's own queue, and its order is not an internal decision.

The agent shows the opportunity. Schedules are moved by people, with a name, a date and a deadline to review the decision.

From reading to action

What the hospital does with this on Tuesday morning

A panel that does not end in two actions with an owner and a deadline is just a good-looking report. The Daily Funnel document arrives at 6:40 AM and produces exactly two decisions — one automatic, one human.

1

Prioritized active confirmation — run by the agent, exceptions handled by the front desk

At 7:00 AM the Squad calls api_get_appointments for the coming days and sorts the confirmation queue by what the panel has just shown: first the bookings made more than 30 days out, then the specialties whose no-show rate the day before came in above their own median. The channel agent sends the confirmation over the official Meta WhatsApp — inside the 24-hour window as a regular message; outside it, only as an approved template.

Anyone who answers "I can't make it" has the slot canceled in the official schedule through api_post_booking, and the freed slot enters that specialty's waiting list the same minute. Anyone who comes back with a question the agent was not given is handed to a person with the history attached. The front desk stops calling one by one, and the team needed to carry the same volume gets considerably smaller: what reaches a person is the case that needs judgment.

How booking, rescheduling and canceling reach the official schedule

2

Capacity review — run by outpatient coordination

Monday's panel, broken down by specialty, goes on the agenda of Tuesday's capacity meeting, as a PDF attached to the minutes. There is one question and it is a concrete one: of these six specialties, which block of hours moves to another clinic this week, and who publishes the new schedule? The answer comes out with an owner's name, a start date and a review date four weeks later.

The following week, the same panel shows whether the block that moved became visits or just changed address. That is the only way reallocation becomes a habit instead of a project somebody ran once.

The Squad that publishes and delivers the panel every day

What the manager asks in plain language

Between one panel and the next, a one-off question does not have to become a BI ticket. The HAL Copilot queries the same data in read-only mode and answers with a table and a chart on screen.

  • Which specialties got worse on no-shows this week?
  • How many neurology slots finished empty this month?
  • Is confirming the 30-day-plus band paying off?
  • Compare this Tuesday with the six before it.
Where every number comes from

It all comes from the system of record, through the API

The schedule offered, the state of each slot, the cancellations and the attendance all come from the HIS — the hospital information system — through calls declared one by one in the agent's configuration. There is no spreadsheet in between, no manual export and no parallel calendar: the panel counts the same base the front desk sees.

When a call fails or returns less than it should, the document goes out with the gap flagged — an incomplete day is declared, never filled in with an estimate. Access, retention and legal basis follow LGPD, Brazil's data protection law, and every run leaves an audit trail.

Transparency

What this panel does not cover

Naming the scope before the contract saves the hard conversation after it. This panel is about outpatient consultations — and nothing else.

Imaging, inpatient care and the operating room are a different scope

The unit of capacity changes completely. Consultations are measured in slots on a schedule; imaging is measured in machine time and preparation; inpatient care is measured in bed-days and turnover; the operating room is measured in room time, assembled teams and turnaround for cleaning. An offered → booked → completed funnel applied to an operating room produces a number that means nothing.

Each of those scopes is a panel of its own, with its own source and its own conversation with the coordination team. None of them comes free with this one.

Cancellation reasons only appear when the field is genuinely filled in

The cause of a cancellation is the most requested and least reliable piece of information in any hospital schedule. If the front desk records "other" in most cases, or leaves the field blank, any chart of causes is fiction dressed up as analysis.

The panel declares the field inconclusive and moves on without it. When the data entry improves — and improving that is a process decision, not a software one — the section shows up in the document on its own.

The agent does not move schedules, reorder queues or give clinical advice

Moving a block of hours between specialties, changing a clinician's roster and altering the order of a regulated referral queue are decisions with clinical and contractual consequences. The agent is not given that tool — and what was not handed to it does not exist in its world.

Clinical guidance is out of scope too: the agent does not assess symptoms, does not suggest treatment and does not have an opinion on urgency. A patient who describes a symptom in the channel is handed to a person, with the conversation history attached.

The waiting list is measured, not ordered

The panel shows how long each specialty's queue is and how long it is taking, because without that you cannot read an empty slot. Who goes ahead of whom is a different matter: it is a clinical criterion and, in a regulated referral queue, a rule set outside the hospital.

When a slot is freed by a cancellation, the agent offers it in the order the hospital configured — never in an order it invented, and never to someone who was not in that specialty's queue.

No identified patient in the aggregate panel

The document works with counts of slots by specialty, by shift and by lead-time band. Name, ID, phone number and any clinical data stay out — the aggregate does not need them to answer the questions it answers.

The individual case still exists, in the conversation and in the schedule, with an audit trail: what was queried, what was decided and what was written are recorded on every run.

See the platform's security controls

Questions

Questions from the people who run the outpatient clinic

Where does the number of slots offered come from?

From the schedule published in the hospital's own system, read through the API. The panel does not rebuild the roster or estimate capacity: it counts what the HIS says was offered that day, for that specialty, at that site. If the roster changed at eleven at night, the next morning's panel already reads the new schedule.

When the call fails or returns a partial day, the document flags the gap instead of topping it up with an average.

Why don't utilisation, no-shows and cancellations add up to 100%?

Because they measure different moments of the day and sit on different bases. Utilisation is calculated over the slots offered, at day open. Cancellation is calculated over the bookings that existed at that opening. The no-show rate is calculated over the bookings still standing at appointment time, with cancellations already taken out.

A canceled slot counts as open again, so it shows up both in the cancellation math and in the list of empty slots at close of day. Adding the two columns counts the same slot twice. The panel closes the math by subtraction — offered minus completed — and only then breaks the remainder down by cause, with no overlap.

Can the agent move the schedule on its own when it sees slots to spare?

No. It is not given that tool. The agent books, reschedules and cancels individual slots in the official schedule, always at a patient's request and always through the hospital system's API. Moving a block of schedule between specialties, changing a clinician's roster and reordering a regulated referral queue are human decisions, with contractual and clinical consequences.

What the panel does is size the opportunity: how many slots, in which clinics, against which queue. The decision comes out of the capacity meeting, with an owner and a review date.

Can we compare two sites in the same panel?

You can, as long as the comparison respects the same care taken with days of the week: a site with a different schedule profile is not compared head to head. The document accepts a breakdown by site and shows each one against its own historical median, rather than ranking the two in a single list that rewards whoever has the easier schedule.

When a head-to-head comparison does make sense — same specialty, same shift, same size — the panel puts the two rows side by side and states explicitly what is being matched.

Does this replace the schedule report our HIS already produces?

It does not replace the source: the HIS remains the system of record and every number comes from it. What changes is what reaches the coordination team. The system's report is a listing somebody has to open, filter and interpret. The Squad's document arrives already read: with the median of the same weekday beside each figure, the queue-and-utilisation cross-reading already done, the data gap declared and a note on what needs a human decision.

And it arrives on its own, by email, to a closed list of recipients, every day at the same time — without anyone asking.

Bring one week of your schedule and we will map the funnel

With a week of outpatient schedule we can show where your capacity is leaking today — how much is slots nobody booked, how much is cancellations nobody retook and how much is no-shows. From there, which panel and which routine make sense for your clinic.