<?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: Vedant</title>
    <description>The latest articles on DEV Community by Vedant (@vedant0707).</description>
    <link>https://dev.to/vedant0707</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%2F3913653%2F9ac7bcc3-c044-4845-8f9e-174e0c198533.png</url>
      <title>DEV Community: Vedant</title>
      <link>https://dev.to/vedant0707</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vedant0707"/>
    <language>en</language>
    <item>
      <title>How We Built Clinic Desk Around Persistent Agent Memory</title>
      <dc:creator>Vedant</dc:creator>
      <pubDate>Tue, 29 Sep 2026 16:09:15 +0000</pubDate>
      <link>https://dev.to/vedant0707/how-we-built-clinic-desk-around-persistent-agent-memory-50a2</link>
      <guid>https://dev.to/vedant0707/how-we-built-clinic-desk-around-persistent-agent-memory-50a2</guid>
      <description>&lt;p&gt;Most AI assistants are good at answering the question in front of them. The harder problem is making the&lt;br&gt;
next question benefit from what happened before. That was the design problem behind Clinic Desk.&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%2Fvtmn7ijwiw2dq31859gc.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%2Fvtmn7ijwiw2dq31859gc.jpeg" alt=" " width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What we built&lt;br&gt;
Clinic Desk is a clinical intelligence workspace for a fictional family clinic. The interface combines a patient&lt;br&gt;
queue, a consultation workspace, persistent memory, evidence-backed briefs, outcome recording, and an&lt;br&gt;
insights view. The important part is not the number of screens. It is the memory loop connecting them.&lt;br&gt;
Why memory had to be central&lt;br&gt;
A consultation starts with a current reason for visit, but a returning patient may have history that changes&lt;br&gt;
how the current situation should be interpreted. At the same time, a clinic accumulates experience across&lt;br&gt;
many cases. We therefore separated two memory scopes: patient memory and anonymised clinic memory.&lt;br&gt;
Patient memory keeps continuity for the same person; clinic memory captures reusable experience without&lt;br&gt;
carrying patient-specific details into another case.&lt;br&gt;
The recall step&lt;br&gt;
When a clinician prepares a brief, Clinic Desk does not simply send the current complaint to the reasoning&lt;br&gt;
model. The server first retrieves relevant memories from Hindsight. The recalled context can include&lt;br&gt;
patient-specific facts as well as relevant clinic experience. This is the point where Hindsight becomes part&lt;br&gt;
of the reasoning workflow rather than a storage box hidden behind the application.&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;/p&gt;

&lt;p&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;
From recall to reasoning&lt;br&gt;
The application then combines the retrieved context with the current visit and sends that grounded context&lt;br&gt;
through the reasoning layer. The UI makes this visible: the clinician can see the brief, inspect supporting&lt;br&gt;
citations, and understand which remembered items contributed to the answer. This was an important UX&lt;br&gt;
decision because persistent memory is more useful when the user can see why it was used.&lt;br&gt;
Comparison mode&lt;br&gt;
We also added a comparison mode so the interface can contrast a memoryless response with a response&lt;br&gt;
that includes recalled context. That creates a simple before-and-after experiment inside the product.&lt;br&gt;
Instead of saying memory matters, the interface lets the user observe the behavioural difference for the&lt;br&gt;
same consultation.&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;The other half: retain&lt;br&gt;
Recall is only half of a learning system. After a consultation, the clinician records what happened. Clinic&lt;br&gt;
Desk retains that outcome so it becomes part of the memory available to future relevant interactions. The&lt;br&gt;
loop is therefore: recall, reason, act, record the outcome, retain, and recall again.&lt;br&gt;
A practical engineering lesson&lt;br&gt;
One of the biggest lessons from building Clinic Desk was that memory needs boundaries. We had to make&lt;br&gt;
the distinction between patient memory and clinic memory explicit in the data model and in the interface.&lt;br&gt;
That made both the product story and the safety model easier to understand.&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;
What we learned&lt;/p&gt;

&lt;p&gt;First, persistent memory should change behaviour, not just add another database table. Second, evidence&lt;br&gt;
links matter when a generated brief depends on retrieved context. Third, outcome capture is what lets a&lt;br&gt;
memory system improve over time. Finally, a memory feature is easiest to evaluate when the UI makes the&lt;br&gt;
recall and learning steps visible.&lt;br&gt;
Closing&lt;br&gt;
Clinic Desk is our attempt to treat memory as a first-class part of an AI workflow. With Hindsight, the system&lt;br&gt;
can recall relevant experience, use it during reasoning, capture outcomes, and make those outcomes&lt;br&gt;
available to future interactions. That turns a one-shot assistant into a workflow that accumulates useful&lt;br&gt;
context over time.&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>agents</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
