<?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: Kontham Charitha Reddy</title>
    <description>The latest articles on DEV Community by Kontham Charitha Reddy (@kontham_charithareddy_7c).</description>
    <link>https://dev.to/kontham_charithareddy_7c</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%2F4150014%2Fc0872a57-0cfa-4cd6-8a46-7069a98401b2.png</url>
      <title>DEV Community: Kontham Charitha Reddy</title>
      <link>https://dev.to/kontham_charithareddy_7c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kontham_charithareddy_7c"/>
    <language>en</language>
    <item>
      <title>"One Memory Bank Per Child: Isolation and Consent in Health-Tech AI"</title>
      <dc:creator>Kontham Charitha Reddy</dc:creator>
      <pubDate>Tue, 29 Sep 2026 15:12:44 +0000</pubDate>
      <link>https://dev.to/kontham_charithareddy_7c/one-memory-bank-per-child-isolation-and-consent-in-health-tech-ai-cd</link>
      <guid>https://dev.to/kontham_charithareddy_7c/one-memory-bank-per-child-isolation-and-consent-in-health-tech-ai-cd</guid>
      <description>&lt;p&gt;When your data is a child's behavioral history, "the retrieval filter had a bug" is not an acceptable failure mode.&lt;/p&gt;

&lt;p&gt;For a multi-patient AI system, a strong pattern is to give every child a dedicated memory bank instead of one shared index with metadata filters. Here is why, and what to tighten for production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hard partitioning vs. filters
&lt;/h2&gt;

&lt;p&gt;With a shared index, isolation depends on every query remembering to apply the right filter. With one bank per child, a query physically can't reach another child's records.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use opaque IDs
&lt;/h2&gt;

&lt;p&gt;Readable bank names like &lt;code&gt;child_liam&lt;/code&gt; are fine in a demo. In production, use an opaque identifier so names never appear in URLs or logs:&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;uuid&lt;/span&gt;

&lt;span class="n"&gt;bank_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;child_&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uuid4&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nb"&gt;hex&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Enforce access at the API layer
&lt;/h2&gt;

&lt;p&gt;Isolation of storage doesn't replace authorization. Check that the caller is allowed to see this child before any recall:&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;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Depends&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;HTTPException&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;authorize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;child_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;Depends&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;get_current_user&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;child_id&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;allowed_children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;403&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Not permitted&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;child_id&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add role-scoped access (a parent and a therapist don't need identical views) and an audit log of who recalled what, and when.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>security</category>
      <category>fastapi</category>
    </item>
  </channel>
</rss>
