<?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: Neelam Geethika Reddy</title>
    <description>The latest articles on DEV Community by Neelam Geethika Reddy (@ngeethika15).</description>
    <link>https://dev.to/ngeethika15</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%2F4232048%2F9d82e495-159f-4c77-88f6-c1caaf6e9384.png</url>
      <title>DEV Community: Neelam Geethika Reddy</title>
      <link>https://dev.to/ngeethika15</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ngeethika15"/>
    <language>en</language>
    <item>
      <title>How I Built TrialSleuth AI: Simulating Clinical Trial Safety Before Exposing Human Participants</title>
      <dc:creator>Neelam Geethika Reddy</dc:creator>
      <pubDate>Sat, 07 Nov 2026 12:23:44 +0000</pubDate>
      <link>https://dev.to/ngeethika15/how-i-built-trialsleuth-ai-simulating-clinical-trial-safety-before-exposing-human-participants-4e05</link>
      <guid>https://dev.to/ngeethika15/how-i-built-trialsleuth-ai-simulating-clinical-trial-safety-before-exposing-human-participants-4e05</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; TrialSleuth AI reviews a new drug candidate &lt;em&gt;before&lt;/em&gt; its first human trial. It remembers how the human body handles drugs, past trial outcomes, and safety bounds using &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt; agent memory. Every new lab result taught to the agent makes future reviews smarter and keeps human trial participants safe.&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://trialsleuthai.streamlit.app/" rel="noopener noreferrer"&gt;trialsleuthai.streamlit.app&lt;/a&gt; · &lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/Sohapatel-26/trialsleuth-production" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The problem, in plain words
&lt;/h2&gt;

&lt;p&gt;Before a new medicine reaches the public, it is tested on volunteers in clinical trials. Labs and animal studies come first, but trial participants can still suffer preventable adverse events.&lt;/p&gt;

&lt;p&gt;The sad part? Many of those safety risks were &lt;strong&gt;already seen before&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A similar drug compound had already caused drug-induced liver injury.&lt;/li&gt;
&lt;li&gt;A specific chemical structure was known to block hERG channels and alter heart rhythm.&lt;/li&gt;
&lt;li&gt;A common co-administered drug was known to raise exposure levels dangerously high.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The trial data existed, but it was buried across hundreds of dense medical pages, amendment logs, and expert heads. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What if an AI could remember all of that, stress-testing every new trial protocol before anyone takes the first dose?&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why standard LLMs risk patient safety
&lt;/h2&gt;

&lt;p&gt;A regular stateless AI chatbot has no long-term memory. It evaluates context turn-by-turn, suffering from context decay across 100+ page protocol documents. When evaluating complex criteria, it generates generic advice like &lt;em&gt;"monitor the liver"&lt;/em&gt; without retaining exact numerical bounds or historical drug contraindications.&lt;/p&gt;

&lt;p&gt;A clinical safety auditor works differently: they remember &lt;strong&gt;what happened in past trials, exact lab cutoffs, and what changes fixed the issue.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;That is exactly what persistent agent memory unlocks for AI agents. (Vectorize has a detailed overview: &lt;a href="https://vectorize.io/what-is-agent-memory" rel="noopener noreferrer"&gt;What is agent memory?&lt;/a&gt;)&lt;/p&gt;




&lt;h2&gt;
  
  
  How TrialSleuth AI works
&lt;/h2&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%2Foodsf169ubcutpx1he3h.png" 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%2Foodsf169ubcutpx1he3h.png" alt="TrialSleuth AI Interface: Pre-trial drug safety review using Hindsight Memory" width="799" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 1: TrialSleuth AI auditing candidate HLV-772 against recalled human body knowledge (HB-03 Liver) and earlier safety reviews stored in Hindsight memory.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;TrialSleuth AI acts as a pre-flight safety audit layer across four core steps:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;1. Submit&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The team inputs drug details: active composition, dosing strategy, patient eligibility, trial design, allowed medications, and preliminary lab data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;2. Remember&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Hindsight recalls matching facts about human physiology (e.g., &lt;code&gt;HB-03&lt;/code&gt;), past drug outcomes (&lt;code&gt;PC-102&lt;/code&gt;), and earlier reviews.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;3. Review&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The model writes a safety report: risks categorized by body system, required protocol changes, and mandatory pre-dosing tests—citing every memory ID used.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4. Learn&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;When a new lab result comes in, it is saved once to memory, making every subsequent review smarter.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One non-negotiable design rule: &lt;strong&gt;the agent never declares a drug "safe".&lt;/strong&gt; Its role is to highlight hidden risks early so human safety experts can fix the trial protocol before participants are exposed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Enforcing safety bounds with Hindsight memory
&lt;/h2&gt;

&lt;p&gt;I integrated &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt;, an open-source memory system for AI agents by Vectorize. It provides four fundamental operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create a memory bank:&lt;/strong&gt; A dedicated storage unit for trial safety protocols.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retain:&lt;/strong&gt; Persist critical facts, such as past drug toxicity data or lab cutoffs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recall:&lt;/strong&gt; Fetch relevant safety constraints dynamically during a drug review.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reflect:&lt;/strong&gt; Synthesize lessons learned across historical records.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is a simplified Python implementation from our codebase:&lt;/p&gt;

&lt;p&gt;Here is a simplified Python implementation from our codebase:&lt;/p&gt;

&lt;p&gt;Here is a simplified Python implementation from our codebase:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;hindsight_client&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Hindsight&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Hindsight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HINDSIGHT_URL&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HINDSIGHT_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# 1. Retain a past trial safety outcome and the fix that worked
&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;retain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;bank_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;drug-safety-memory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Past drug outcome PC-102: KRS-110 caused grade-3 liver injury at 800mg. Change that worked: cap dose and ban CYP3A4 inhibitors.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;tags&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;past-drug&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;liver-toxicity&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;timestamp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2025-06-03&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# 2. Recall safety rules relevant to a new drug candidate before trial setup
&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;bank_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;drug-safety-memory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Safety risks for HLV-772, an oral KRAS inhibitor evaluated in patients with liver impairment...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# 3. Reflect across memory banks to extract safety takeaways
&lt;/span&gt;&lt;span class="n"&gt;lessons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reflect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;bank_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;drug-safety-memory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What critical safety precautions must be enforced for lipophilic basic amine compounds?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Tech Stack:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🧠 &lt;strong&gt;Memory Engine:&lt;/strong&gt; Hindsight Cloud (Vectorize)&lt;/li&gt;
&lt;li&gt;💬 &lt;strong&gt;Language Model:&lt;/strong&gt; Groq (&lt;code&gt;openai/gpt-oss-120b&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;🖥️ &lt;strong&gt;Interface:&lt;/strong&gt; Streamlit&lt;/li&gt;
&lt;li&gt;🐍 &lt;strong&gt;Language:&lt;/strong&gt; Python&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Impact &amp;amp; Results: Memory ON vs. Memory OFF
&lt;/h2&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%2Fygql8vuxhm7nbhkyp7hx.png" 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%2Fygql8vuxhm7nbhkyp7hx.png" alt="TrialSleuth AI Safety Report with Hindsight Memory Citations" width="799" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 2: TrialSleuth AI generating an explicit safety report flagging liver injury risks and citing recalled memory IDs (HB-03, HB-02, PC-101).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Our demonstration evaluates a hypothetical cancer drug candidate, &lt;strong&gt;HLV-772&lt;/strong&gt;. Its initial protocol hides significant risks: enrolling patients with moderate liver impairment, simultaneous cohort dosing, and no restrictions on concomitant medications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;With Memory OFF:&lt;/strong&gt; The LLM output was generic, recommending vague monitoring without citing specific risk thresholds or prior trial data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;With Memory ON:&lt;/strong&gt; The agent flagged a &lt;strong&gt;High Risk&lt;/strong&gt; level for liver toxicity, backing it up with recalled memory IDs:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;HB-02&lt;/code&gt;: Patients with Child-Pugh B liver impairment experience 2–3× higher drug exposure.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PC-102&lt;/code&gt;: A past sister compound caused grade-3 liver injury when combined with strong CYP3A4 inhibitors.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then, we &lt;strong&gt;taught the agent one new result&lt;/strong&gt;: animal study data showing a sister compound (&lt;code&gt;PC-702&lt;/code&gt;) caused hERG channel blocking and QT prolongation. When re-running the evaluation, a new &lt;strong&gt;Heart&lt;/strong&gt; risk category appeared automatically, citing &lt;code&gt;PC-702&lt;/code&gt; and mandating baseline ECG monitoring before human dosing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Focused recall beats prompt dumping:&lt;/strong&gt; Recalling only high-relevance safety memories prevents context dilution and keeps LLM reasoning sharp.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Citation builds trust:&lt;/strong&gt; Displaying recalled memory IDs (&lt;code&gt;HB-03&lt;/code&gt;, &lt;code&gt;PC-102&lt;/code&gt;) alongside safety recommendations allows clinical teams to verify the reasoning behind every warning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI as a pre-trial sandbox:&lt;/strong&gt; Simulating trial risks in software provides a vital layer of protection before human participants are ever dosed.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Links &amp;amp; Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;Live App:&lt;/strong&gt; &lt;a href="https://trialsleuthai.streamlit.app/" rel="noopener noreferrer"&gt;trialsleuthai.streamlit.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/Sohapatel-26/trialsleuth-production" rel="noopener noreferrer"&gt;github.com/Sohapatel-26/trialsleuth-production&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🧠 &lt;strong&gt;Hindsight on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;github.com/vectorize-io/hindsight&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📚 &lt;strong&gt;Hindsight Documentation:&lt;/strong&gt; &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;hindsight.vectorize.io&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📖 &lt;strong&gt;What is Agent Memory?&lt;/strong&gt; &lt;a href="https://vectorize.io/what-is-agent-memory" rel="noopener noreferrer"&gt;vectorize.io/what-is-agent-memory&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>streamlit</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
