<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: vthanishka</title>
    <description>The latest articles on DEV Community by vthanishka (@vthanishka).</description>
    <link>https://dev.to/vthanishka</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4150350%2Ff00d50d4-12fa-496f-8fb9-a081b9a24ba5.png</url>
      <title>DEV Community: vthanishka</title>
      <link>https://dev.to/vthanishka</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vthanishka"/>
    <language>en</language>
    <item>
      <title>From Recall to Outcome: Closing the Learning Loop in Clinic Desk</title>
      <dc:creator>vthanishka</dc:creator>
      <pubDate>Tue, 29 Sep 2026 16:26:14 +0000</pubDate>
      <link>https://dev.to/vthanishka/from-recall-to-outcome-closing-the-learning-loop-in-clinic-desk-1bap</link>
      <guid>https://dev.to/vthanishka/from-recall-to-outcome-closing-the-learning-loop-in-clinic-desk-1bap</guid>
      <description>&lt;p&gt;A system that only recalls old information is useful. A system that can also learn from what happened next&lt;br&gt;
is more interesting. That became the central loop behind Clinic Desk.&lt;/p&gt;

&lt;p&gt;The workflow&lt;br&gt;
Clinic Desk starts with a current consultation. The clinician sees the patient, the reason for the visit, and a&lt;br&gt;
memory panel powered by Hindsight. When the clinician prepares a brief, the application recalls relevant&lt;br&gt;
patient and clinic context before generating the response. This creates a clear path from current input to&lt;br&gt;
remembered context to generated output.&lt;br&gt;
Here is the core of the recall step. Patient recall is always scoped to one patient with strict tag matching,&lt;br&gt;
and it runs two queries in parallel:&lt;br&gt;
const scope = { tags: [patientTag(patient.id)], tagsMatch: "any_strict" as const };&lt;br&gt;
const [byComplaint, safety] = await Promise.all([&lt;br&gt;
hs.recall(PATIENT_BANK,&lt;br&gt;
&lt;code&gt;${patient.name}: ${complaint}. Previous visits, treatments tried, and results.&lt;/code&gt;,&lt;br&gt;
{ ...scope, budget: "mid" }),&lt;br&gt;
hs.recall(PATIENT_BANK,&lt;br&gt;
&lt;code&gt;${patient.name} allergies, drug reactions, current medications&lt;/code&gt;,&lt;br&gt;
{ ...scope, budget: "low" }),&lt;br&gt;
]);&lt;br&gt;
One query follows today's complaint. The other always pulls allergies and current medicines, because&lt;br&gt;
safety facts must surface even when they have nothing to do with the reason for the visit. The any_strict&lt;br&gt;
match means an untagged memory, or another patient's memory, can never appear in this recall.&lt;br&gt;
Why recall alone is incomplete&lt;br&gt;
Suppose an assistant recalls that a certain approach was tried previously. That information is only part of&lt;br&gt;
the story. The system also needs to know what happened after the action. Did the case improve? Was&lt;br&gt;
there no change? Did the situation get worse? Recording the outcome gives the memory system a more&lt;br&gt;
complete picture of experience.&lt;br&gt;
The retain step&lt;/p&gt;

&lt;p&gt;Clinic Desk therefore includes an outcome step after the consultation. The clinician marks the result as&lt;br&gt;
resolved, improved, no change or worse, and saves it so the experience becomes part of persistent&lt;br&gt;
memory. It is written into the patient's own chart and, with the name removed, into clinic memory. This is the&lt;br&gt;
retain side of the Hindsight story, and it is the part that turns memory from a read-only feature into a&lt;br&gt;
learning loop.&lt;br&gt;
The loop&lt;br&gt;
The architecture is easiest to explain as five steps: recall relevant experience, reason over that context, act&lt;br&gt;
in the workflow, record the outcome, and retain the new information. On a future visit, the system can recall&lt;br&gt;
what was retained. The important point is that the output of one interaction becomes input to another.&lt;br&gt;
Before and after&lt;br&gt;
The clearest way to see the value is one real consultation. A returning patient, 58, comes in with a dry&lt;br&gt;
cough that has lasted more than three months and asks for a stronger antibiotic.&lt;br&gt;
Without memory, the assistant only sees today's complaint. The brief says: likely viral or post-viral cough,&lt;br&gt;
consider antibiotics if there are signs of infection, cough syrup and steam. It sounds reasonable, and it is&lt;br&gt;
wrong for this patient.&lt;br&gt;
With Hindsight memory, the same complaint produces a very different brief. A penicillin allergy is on record,&lt;br&gt;
so amoxicillin is ruled out. The cough started about five weeks after lisinopril was prescribed for blood&lt;br&gt;
pressure. Azithromycin was already tried and made no difference, and a chest X-ray was normal. Across&lt;br&gt;
the clinic, several similar patients on ACE inhibitors resolved within weeks after switching to an ARB.&lt;br&gt;
Same model, same complaint, same prompt structure. The only thing that changed was what the agent&lt;br&gt;
remembered.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi4h014fjffjb0iah67yx.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi4h014fjffjb0iah67yx.jpeg" alt=" " width="800" height="381"&gt;&lt;/a&gt;&lt;br&gt;
Making learning visible&lt;br&gt;
We wanted the interface to expose this lifecycle. The Memory screen shows the stored context. The&lt;br&gt;
consultation screen shows what was recalled for the current brief. The Insights screen gives the clinic a&lt;br&gt;
broader view of accumulated memory and outcomes. These screens are different views of the same&lt;br&gt;
memory lifecycle.&lt;br&gt;
Evidence matters&lt;br&gt;
When memory contributes to a generated brief, provenance becomes important. Clinic Desk uses citations&lt;br&gt;
so that the clinician can inspect supporting memory rather than accepting the generated wording on trust.&lt;br&gt;
This was especially useful while testing the application because we could see whether the retrieved context&lt;br&gt;
was actually reflected in the output.&lt;br&gt;
Honest limitations&lt;br&gt;
Clinic Desk is decision support, not a doctor. It never gives a final diagnosis and never suggests doses. The&lt;br&gt;
data in the project is synthetic, and memory is only as good as what gets recorded: if a clinician skips the&lt;br&gt;
outcome step, the system has nothing new to learn from. Extraction also takes a moment after retain, so a&lt;br&gt;
memory saved seconds ago may not be recallable instantly.&lt;br&gt;
Engineering lessons&lt;br&gt;
The biggest lesson was that learning needs a real event boundary. We needed a moment when the human&lt;br&gt;
says, in effect, this is what happened. That makes retention meaningful and auditable. Another lesson was&lt;br&gt;
to keep the memory scopes explicit so that patient continuity and clinic learning do not blur together.&lt;/p&gt;

&lt;p&gt;Closing&lt;br&gt;
Clinic Desk is built around the idea that an AI workflow should not forget immediately after producing an&lt;br&gt;
answer. Hindsight gives us the primitives to recall relevant context and retain new experience. The&lt;br&gt;
application connects those primitives into a visible workflow where the result of one interaction can shape&lt;br&gt;
the context of a later one.&lt;/p&gt;

&lt;p&gt;Links&lt;br&gt;
Hindsight GitHub: &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;https://github.com/vectorize-io/hindsight&lt;/a&gt;&lt;br&gt;
Hindsight docs: &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;https://hindsight.vectorize.io/&lt;/a&gt;&lt;br&gt;
What is agent memory (Vectorize): &lt;a href="https://vectorize.io/what-is-agent-memory" rel="noopener noreferrer"&gt;https://vectorize.io/what-is-agent-memory&lt;/a&gt;&lt;br&gt;
Project repo: &lt;a href="https://github.com/Abhinav1480/clinic_desk" rel="noopener noreferrer"&gt;https://github.com/Abhinav1480/clinic_desk&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
