<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tech with Otito on Medium]]></title>
        <description><![CDATA[Stories by Tech with Otito on Medium]]></description>
        <link>https://medium.com/@otitodrichukwu?source=rss-3c05c81d43ac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QYbHex7OLru8XY30</url>
            <title>Stories by Tech with Otito on Medium</title>
            <link>https://medium.com/@otitodrichukwu?source=rss-3c05c81d43ac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 12:31:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@otitodrichukwu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How we built ClaimGuard: an AI denial recovery tool on AWS Aurora and Vercel]]></title>
            <link>https://medium.com/@otitodrichukwu/how-we-built-claimguard-an-ai-denial-recovery-tool-on-aws-aurora-and-vercel-4a24d3bc1fab?source=rss-3c05c81d43ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a24d3bc1fab</guid>
            <category><![CDATA[vercel]]></category>
            <category><![CDATA[b2b]]></category>
            <category><![CDATA[health-insurance]]></category>
            <category><![CDATA[medical-practice]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <dc:creator><![CDATA[Tech with Otito]]></dc:creator>
            <pubDate>Thu, 25 Jun 2026 03:54:35 GMT</pubDate>
            <atom:updated>2026-06-25T03:54:35.471Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*liPZzQFshDij8UsgIbD3Eg.png" /></figure><p><strong>A B2B app that reads insurance denials, drafts the appeal, and shows the practice exactly how much money it has just recovered. Built for the #H0Hackathon.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1k27pPkMB19Z0answtLmSA.png" /></figure><p><strong>The problem: money that just sits there</strong></p><p>Small medical practices lose between <strong>$80,000 and $150,000 every year</strong> on insurance claims that get denied and then never appealed. Most of those denials are winnable. The reason they go unfought is simple: doing it by hand takes too long.</p><p>Here is what happens today. An insurer denies a claim and sends the practice a document called an EOB, short for Explanation of Benefits. A biller has to open that PDF, read a short and cryptic denial code, decide what to do (resubmit the claim, appeal it, or write it off), write a letter that the insurer will accept, and send it before a tight deadline passes. Now multiply that by hundreds of claims a month. A small team cannot keep up, so the money quietly ages out.</p><p><strong>Who we built it for:</strong> the one or two person billing team at an independent practice. We wanted to take the whole chain (read, sort, write, track) and turn it into something that runs on its own, so revenue that is lost today gets recovered instead.</p><p><strong>What ClaimGuard does</strong></p><p>It handles a denial from start to finish:</p><p>1. <strong>Take it in.</strong> Drag a denial PDF onto the page, or simply <strong>forward the denial email</strong> to a dedicated inbox. Either way, it runs through the same process.</p><p>2. <strong>Read and sort.</strong> The AI pulls out the patient, the insurer, the billing codes, and the amounts. Then it recommends one of three actions: resubmit, appeal, or write off.</p><p>3. <strong>Write and double check.</strong> When an appeal makes sense, it writes a letter that is ready to send to the insurer. Then a <strong>second AI pass reads that letter, scores it, and rewrites it if it is weak</strong>. You can still edit it yourself.</p><p>4. <strong>Track.</strong> It works out filing deadlines and insurer response windows, and keeps a <em>Needs Action</em> list so nothing slips through.</p><p>5. <strong>Show the money.</strong> The dashboard shows how much you recovered against what the subscription costs.</p><p>Because this is a product a practice pays for, we put the value right on the front page. The dashboard shows a live return multiple a <strong>7x return</strong> on the demo data. That is the whole pitch, proven in the customer’s own numbers.</p><p><strong>The stack</strong></p><p><strong>Frontend:</strong> Next.js 16 (App Router with React Server Components), Tailwind, and shadcn/ui. Hosted on <a href="https://vercel.com/"><strong>Vercel</strong></a>.</p><p><strong>Backend:</strong> FastAPI with <strong>LangGraph</strong> (the AI workflow), SQLAlchemy, and Pydantic.</p><p><strong>AI:</strong> Anthropic Claude, behind a small layer so we can swap the model with one setting.</p><p><strong>Email in: AgentMail</strong>. Forward a denial email and it runs the same workflow.</p><p><strong>Database: Amazon Aurora PostgreSQL Serverless v2</strong>.</p><p><strong>Hosting:</strong> an <strong>AWS EC2</strong> server with automatic HTTPS, sitting in front of Aurora. The live API is at `https://apiclaimguard.otito.site`.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_J7N-xVWCU3Qh9go41G2og.png" /><figcaption>Architecture_diagram</figcaption></figure><p><strong>An agent that checks its own work</strong></p><p>The workflow is a <strong>LangGraph state machine</strong>, not one big prompt:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rq71OqKrmb2wAB1y9QRnNQ.png" /></figure><p>The step we are proudest of is <strong>`critique_appeal`</strong>. After the model writes a letter, a separate reviewer pass (on a faster model) scores it, lists the concrete problems, and, if the draft is not good enough, <strong>rewrites it before anything is saved</strong>. That loop of write, then review, then rewrite is what makes the letter good enough for a biller to send with only small edits. The score and the list of issues are saved to the activity log, so there is a clear record of what the agent did.</p><p>The same `run_pipeline()` entry point powers two front doors: a manual PDF upload, and <strong>AgentMail </strong>email. Forward a denial to a practice’s inbox, and a webhook (verified with Svix) downloads the attachment and runs the exact same workflow. So email gets the same reading, sorting, self-review, and safety checks for free. Email intake is live: each claim that arrives this way is tagged in its timeline as “Received via email”, so the team can see how it came in.</p><p><strong>Why we chose Amazon Aurora PostgreSQL</strong></p><p>Aurora is the single source of truth for every record in the product: practices, patients, insurers, claims, denials, appeals, a running activity log, and sales leads. We did not pick it by default. We picked it because the shape of the data and the shape of the traffic both point at a relational database, and Serverless v2 fits the cost picture.</p><p>Here is the reasoning:</p><p><strong>The data is relational. </strong>A claim leads to a denial, which leads to an appeal. We let the database enforce that chain with foreign keys. A uniqueness rule on <em>(claim_id, denial_code, denial_date)</em> also makes intake safe to repeat: if the same EOB is sent twice, or an email is retried, the denial is never written twice.</p><p><strong>The dashboard is full of joins.</strong> Denial rate by insurer, money at risk by category, average days to resolve, and the return multiple are all queries that combine several tables and group the results. That is exactly what SQL is good at, and it would be painful in a key-value store.</p><p><strong>Serverless v2 matches a clinic’s rhythm.</strong> A small practice works denials in bursts, with long quiet stretches. Aurora Serverless v2 scales its capacity up and down on its own and idles down when nobody is working, so we are not paying for an idle server. If ClaimGuard takes on many practices, it scales up the same way.</p><p><strong>No lock-in.</strong> Aurora speaks standard PostgreSQL, so the exact same code runs on a local Postgres container during development and on Aurora in production. One environment flag picks which. We never change the application code between the two.</p><p><strong>Why not DynamoDB or DSQL?</strong> Our work is relational, with flexible analytical joins and a clear transactional lifecycle. It is not high-volume single-key lookups or writes spread across the globe. Aurora’s relational engine plus serverless pricing was the deliberate match.</p><p>Money is stored as an exact <em>`NUMERIC`</em> value, never a floating point number, so there is no rounding drift across thousands of claims.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kWmbP8AsxgRLHkt6s4WPNw.png" /></figure><p><strong>The hardest part: the free tier version of Aurora is not a normal database</strong></p><p>Our first attempt aimed at Aurora’s free tier “express configuration”, and it behaves very differently from a standard cluster. There is no VPC and no master password. You reach it through a managed internet gateway, and your password is a short lived token that AWS signs for you, freshly, on every connection. Getting it to work meant solving three separate puzzles:</p><p><strong>Name lookup.</strong> The gateway’s address lives in a zone that some networks quietly fail to look up. We look it up through a public DNS server, connect by IP, and keep the hostname so the secure handshake still matches.</p><p><strong>Connection reuse.</strong> The gateway drops idle connections without a clean goodbye, which freezes a normal connection pool. We switched to a mode that opens one fresh connection per request, with a retry for the odd dropped one.</p><p><strong>Speed.</strong> Every request paid for a full secure handshake across regions.</p><p>So we built a second, sturdier path: Aurora Serverless v2 with a normal password inside a private network, behind our EC2 server. The nice part of the design is that <strong>both paths hide behind one environment flag</strong>. Local Postgres, free-tier Aurora, or private-network Aurora, all from the same code.</p><p>A couple of smaller fights worth a mention:</p><p><strong>PDF export that does not crash on real names. </strong>Insurer names like <em>”Blue Cross and Blue Shield”</em> can contain characters the PDF engine treats as code. We clean dynamic text before building a letter, or exports would break on perfectly normal data.</p><p><strong>One workflow, two doors.</strong> Upload and email share the exact same <em>`run_pipeline()`</em> entry point, so every way a denial comes in gets the same reading, sorting, and safety guarantees.</p><p><strong>What we learned</strong></p><p><strong>LangGraph is a clean way to model an AI workflow</strong> as steps you can see. Branching (only write a letter when the denial is worth appealing) and building the graph fresh per request kept the logic readable and easy to test with a fake model, so the test suite runs with no API key.</p><p><strong>Typed outputs beat parsing text.</strong> Asking the model to fill in a typed schema turned “hope the AI returns clean data” into a real contract.</p><p><strong>A small model abstraction paid off right away.</strong> Swapping models with one setting made it easy to balance cost and quality.</p><p><strong>The “easy” free tier was the hard part. </strong>We learned far more about AWS token signing, name lookup, secure handshakes, and connection pooling than we expected. The layer we built to tame all of that is one of the parts we are proudest of.</p><p><strong>Putting the frontend on Vercel</strong></p><p>The Next.js app ships to <strong>Vercel</strong> and talks to the FastAPI server over HTTPS. Server Components fetch data while the page renders, and the parts that run in the browser send updates (uploads, appeal edits) to the same API address, set once in an environment variable. Vercel’s preview builds let us work on the landing page and the dashboard at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtSrEeR-Y6Z-2XKaE-Lt-Q.png" /></figure><p><strong>Try it and watch it</strong></p><p>&gt; 📺 <strong>**MEDIA, Demo video.**</strong> Paste your YouTube link here. Dev.to and Hashnode embed it automatically.</p><p><strong>What is next:</strong> tuning response windows per insurer, sending appeals straight through insurer portals, and spotting the root causes of denials <em>before </em>a claim is even filed.</p><p><em>Built for the </em><strong>#H0Hackathon</strong><em>, Monetizable B2B track, on </em><strong>Amazon Aurora PostgreSQL</strong><em> and </em><strong>Vercel</strong><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a24d3bc1fab" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>