<?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: Yash Sharma 5273</title>
    <description>The latest articles on DEV Community by Yash Sharma 5273 (@5273yash).</description>
    <link>https://dev.to/5273yash</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%2F927446%2Fc11d5f0b-44ee-493b-a873-c6f9d850e529.jpg</url>
      <title>DEV Community: Yash Sharma 5273</title>
      <link>https://dev.to/5273yash</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/5273yash"/>
    <language>en</language>
    <item>
      <title>Building Aegis: an AI vault for your digital legacy, on Amazon Aurora and Vercel</title>
      <dc:creator>Yash Sharma 5273</dc:creator>
      <pubDate>Mon, 29 Jun 2026 19:35:12 +0000</pubDate>
      <link>https://dev.to/5273yash/building-aegis-an-ai-vault-for-your-digital-legacy-on-amazon-aurora-and-vercel-l7j</link>
      <guid>https://dev.to/5273yash/building-aegis-an-ai-vault-for-your-digital-legacy-on-amazon-aurora-and-vercel-l7j</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Note: I created this content for the purposes of entering this hackathon. #H0Hackathon&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When someone passes away or is incapacitated, their family is usually locked out of the things that matter most: insurance policies, account details, and the simple knowledge of where everything is and what to do next. That information lives in one person's head, inbox, or a drawer nobody can find.&lt;/p&gt;

&lt;p&gt;We built &lt;strong&gt;Aegis&lt;/strong&gt; to fix that. It is a private vault with an AI agent that knows your documents and can guide your loved ones through them, on the web or right inside a chat app. This post is about how we built it, and specifically why we chose &lt;strong&gt;Amazon Aurora&lt;/strong&gt; as the database and &lt;strong&gt;Vercel&lt;/strong&gt; as the platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Aegis does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keeps your important context in one vault: uploaded files, rich markdown notes, structured contacts, and shielded credentials.&lt;/li&gt;
&lt;li&gt;Answers questions in plain language. The agent searches the vault, reads the relevant document, and cites its source.&lt;/li&gt;
&lt;li&gt;Surfaces what is time sensitive, like renewals and premiums, derived from your documents.&lt;/li&gt;
&lt;li&gt;Gives beneficiaries scoped access through a secure grant link, without exposing the owner's raw logins.&lt;/li&gt;
&lt;li&gt;Works on the web and inside Telegram, using the same agent.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Amazon Aurora
&lt;/h2&gt;

&lt;p&gt;A vault is deeply relational. We are not storing one blob of text, we are modeling documents, their text chunks, contacts, reminders, and the agent's own conversation memory, and we need them to relate to each other cleanly. So the data model came first, and it is deliberate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;documents&lt;/code&gt; and &lt;code&gt;document_chunks&lt;/code&gt; for uploaded files and their searchable text&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;notes&lt;/code&gt; for markdown context written directly in the app&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;contacts&lt;/code&gt; for structured people and organizations the agent can return&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reminders&lt;/code&gt; derived from document content&lt;/li&gt;
&lt;li&gt;agent memory, persisted so conversations continue across sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We chose &lt;strong&gt;Aurora PostgreSQL Serverless v2&lt;/strong&gt; for three reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;It is standard Postgres.&lt;/strong&gt; That let us keep everything portable. Our retrieval is hand-written SQL, not a proprietary query layer, so there is no lock-in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Serverless scaling.&lt;/strong&gt; A personal vault is quiet most of the time and then bursts when someone actually needs it. Serverless v2 scales capacity automatically and stays warm enough for a live demo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managed durability.&lt;/strong&gt; This is people's most sensitive information. Aurora's managed replication and backups matter.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Full-text search without extensions
&lt;/h3&gt;

&lt;p&gt;We deliberately avoided pgvector and any external search service. Instead we wrote a &lt;strong&gt;BM25 ranking in plain SQL&lt;/strong&gt; over the chunked documents. The agent calls a &lt;code&gt;searchVault&lt;/code&gt; tool that returns the best matching snippets with their source document title, and only then reads the full document if it needs to.&lt;/p&gt;

&lt;p&gt;The payoff: the entire retrieval pipeline runs on standard Postgres unchanged. Aurora was a drop-in choice, not a migration, and we never had to bolt on a separate vector database to make search work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Vercel, with the agent in-process
&lt;/h2&gt;

&lt;p&gt;Aegis is a single &lt;strong&gt;Next.js&lt;/strong&gt; app deployed entirely on Vercel. The interesting part is the agent.&lt;/p&gt;

&lt;p&gt;Instead of running a separate always-on agent server, we run a &lt;strong&gt;Mastra agent in-process&lt;/strong&gt; inside a Vercel serverless function, using the AI SDK. The &lt;code&gt;/api/agent/stream&lt;/code&gt; route invokes the agent and forwards its native streaming chunks to the browser as NDJSON, so responses feel live. The same agent is reused for every audience:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Owners chatting on the web&lt;/li&gt;
&lt;li&gt;Beneficiaries who opened a grant link, authorized by a grant token enforced in middleware&lt;/li&gt;
&lt;li&gt;Messages arriving over Telegram and WhatsApp webhooks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One agent, one retrieval path, three surfaces. There is no glue server to operate, which keeps the whole thing genuinely shippable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Clients (Web, Telegram, WhatsApp)
        |
Vercel (Next.js, serverless)
  - Middleware: Better Auth session + beneficiary grant token
  - API routes: /api/agent/stream, webhooks, auth
  - Mastra agent in-process (AI SDK)
    tools: searchVault, readDocument, getDocumentLink, getReminders, getContacts
  - BM25 retrieval (plain SQL)
        |
  Anthropic Claude API (model)
        |
AWS
  - Amazon Aurora (PostgreSQL Serverless v2): system of record + agent memory
  - S3: original files, short-lived presigned links
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What we learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A deliberate data model beats a clever index.&lt;/strong&gt; Modeling everything as retrievable context made the agent simpler and the answers better.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You can run a real, streaming agent fully on Vercel&lt;/strong&gt; with no dedicated backend, as long as you design around the serverless function limits from the start.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Portability is a feature.&lt;/strong&gt; Keeping retrieval in plain SQL meant Aurora slotted in cleanly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Aegis runs on Amazon Aurora and Vercel today. If you have ever wondered what would happen to your accounts and documents if you were not around to explain them, that is exactly the problem we are solving.&lt;/p&gt;

&lt;p&gt;I created this content for the purposes of entering this hackathon. #H0Hackathon&lt;/p&gt;

</description>
      <category>aws</category>
      <category>vercel</category>
      <category>nextjs</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
