<?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: Nagesh Gunji</title>
    <description>The latest articles on DEV Community by Nagesh Gunji (@nagesh_gunji_8795e0ff18d8).</description>
    <link>https://dev.to/nagesh_gunji_8795e0ff18d8</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%2F4022435%2F33d7b8b8-86ea-4ccd-9929-f4c26418b432.png</url>
      <title>DEV Community: Nagesh Gunji</title>
      <link>https://dev.to/nagesh_gunji_8795e0ff18d8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nagesh_gunji_8795e0ff18d8"/>
    <language>en</language>
    <item>
      <title>How to Build a Cost-Saving Semantic Cache AI Assistant</title>
      <dc:creator>Nagesh Gunji</dc:creator>
      <pubDate>Tue, 03 Nov 2026 11:57:18 +0000</pubDate>
      <link>https://dev.to/nagesh_gunji_8795e0ff18d8/how-to-build-a-cost-saving-semantic-cache-ai-assistant-26i9</link>
      <guid>https://dev.to/nagesh_gunji_8795e0ff18d8/how-to-build-a-cost-saving-semantic-cache-ai-assistant-26i9</guid>
      <description>&lt;p&gt;Building AI assistants that call LLM APIs directly on every single user prompt gets expensive fast. Duplicate questions, repeated queries, and baseline RAG retrieval can quickly drain your API budget during testing and early production.&lt;/p&gt;

&lt;p&gt;To solve this, I built an architecture that combines &lt;strong&gt;in-memory semantic query caching&lt;/strong&gt; with &lt;strong&gt;Voyage AI embeddings&lt;/strong&gt;, &lt;strong&gt;local Ollama runtimes ($0 token costs)&lt;/strong&gt;, and &lt;strong&gt;Prisma 7 pgvector&lt;/strong&gt; on Next.js 16.&lt;/p&gt;

&lt;p&gt;Here is a breakdown of how the cost-saving stack is structured.&lt;/p&gt;




&lt;h3&gt;
  
  
  🛠️ Core Tech Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Framework:&lt;/strong&gt; Next.js 16 (App Router + Server Actions with React 19 support)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings &amp;amp; AI:&lt;/strong&gt; Pre-configured for &lt;strong&gt;Voyage AI embeddings&lt;/strong&gt; (high-accuracy production vector search) and local &lt;strong&gt;Ollama&lt;/strong&gt; runtimes ($0 token testing offline)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database &amp;amp; Vector Engine:&lt;/strong&gt; PostgreSQL + Prisma 7 with native 1024-dimension &lt;code&gt;pgvector&lt;/code&gt; support&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance Layer:&lt;/strong&gt; Sub-millisecond in-memory semantic query cache to skip redundant LLM processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monetization Layer:&lt;/strong&gt; Pre-configured Paddle billing modal&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ⚡ How the Cost-Saving Cache Works
&lt;/h3&gt;

&lt;p&gt;Instead of sending every query straight to an expensive cloud LLM, the system checks vector similarity first:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Generate Vector:&lt;/strong&gt; Convert incoming prompt to an embedding using Voyage AI (or local Ollama).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Similarity Lookup:&lt;/strong&gt; Perform a vector similarity search in PostgreSQL via Prisma 7 &lt;code&gt;pgvector&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Return or Fetch:&lt;/strong&gt; If a high-confidence match exists in the semantic cache, return the cached answer in sub-milliseconds. If not, route to the LLM and store the new result.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// lib/embeddings.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;VoyageAIClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;voyageai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;voyage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;VoyageAIClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;VOYAGE_API_KEY&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;generateVoyageEmbedding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;voyage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;embed&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;voyage-3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;embedding&lt;/span&gt; &lt;span class="o"&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;h3&gt;
  
  
  📐 Database &amp;amp; Schema Setup
&lt;/h3&gt;

&lt;p&gt;Using Prisma 7's native &lt;code&gt;pgvector&lt;/code&gt; extension allows storing and querying vector embeddings directly inside PostgreSQL without paying for third-party vector SaaS providers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// schema.prisma snippet
datasource db {
  provider   = "postgresql"
  url        = env("DATABASE_URL")
  extensions = [pgvector(map: "vector")]
}

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["postgresqlExtensions"]
}

model DocumentEmbedding {
  id        String                 @id @default(cuid())
  content   String
  embedding Unsupported("vector(1024)")
  createdAt DateTime               @default(now())
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🎬 6.5-Minute Video Walkthrough
&lt;/h3&gt;

&lt;p&gt;I recorded a full technical walkthrough demonstrating the code structure, terminal build (&lt;code&gt;npm run build&lt;/code&gt;), schema migrations, Voyage AI integration, and live RAG retrieval speed:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/S8P0tD0uDNA" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;




&lt;h3&gt;
  
  
  🚀 Get the Full Production Codebase (&lt;code&gt;.zip&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;If you're building an AI micro-SaaS and want to skip 40+ hours of baseline setup, you can download the complete &lt;strong&gt;Aether OS Pro&lt;/strong&gt; codebase.&lt;/p&gt;

&lt;p&gt;It includes full setup instructions (&lt;code&gt;README.md&lt;/code&gt;), pre-configured &lt;code&gt;.env.example&lt;/code&gt;, zero-error terminal builds, and instant local deployment.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://kreato.co.in/aether/23aa48bb-f963-4554-b6b8-1412ccd9c151" rel="noopener noreferrer"&gt;Download Aether OS Pro (.zip) via Instant UPI Checkout&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🏷️ Dev.to Tags to Add:
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;#nextjs&lt;/code&gt; &lt;code&gt;#ai&lt;/code&gt; &lt;code&gt;#prisma&lt;/code&gt; &lt;code&gt;#webdev&lt;/code&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>I got tired of searching for visa and cost-of-living data, so I built NomadMatrix</title>
      <dc:creator>Nagesh Gunji</dc:creator>
      <pubDate>Fri, 17 Jul 2026 06:12:51 +0000</pubDate>
      <link>https://dev.to/nagesh_gunji_8795e0ff18d8/i-got-tired-of-searching-for-visa-and-cost-of-living-data-so-i-built-nomadmatrix-537k</link>
      <guid>https://dev.to/nagesh_gunji_8795e0ff18d8/i-got-tired-of-searching-for-visa-and-cost-of-living-data-so-i-built-nomadmatrix-537k</guid>
      <description>&lt;p&gt;Introducing NomadMatrix&lt;br&gt;
NomadMatrix is a live-data dashboard designed to act as your "control center" for choosing your next destination. I’ve seeded live data for 70+ cities, aggregating the details that actually matter when you're planning a move.&lt;/p&gt;

&lt;p&gt;Key Features&lt;br&gt;
Real-time Insights: Access to visa availability and official links.&lt;/p&gt;

&lt;p&gt;Comprehensive Data: Live cost-of-living, safety metrics, job links, and coworking space data.&lt;/p&gt;

&lt;p&gt;Centralized Workflow: No more tab-switching—all your research in one place.&lt;/p&gt;

&lt;p&gt;The Tech Stack&lt;br&gt;
Next.js: Used for a fast, SEO-friendly frontend that handles dynamic routing for 70+ cities efficiently.&lt;/p&gt;

&lt;p&gt;Gemini: I integrated Gemini to help normalize and parse data from various sources.&lt;/p&gt;

&lt;p&gt;Tailwind CSS: Allowed me to build a clean, responsive, and mobile-first UI quickly.&lt;/p&gt;

&lt;p&gt;Challenges &amp;amp; Learnings&lt;br&gt;
Building this taught me a lot about the realities of data aggregation. The biggest hurdle was the sheer fragmentation of information—finding consistent, accurate, and up-to-date data for 70+ cities across different regions was a manual nightmare. I often found myself digging through endless browser search results, only to find outdated or conflicting information.&lt;/p&gt;

&lt;p&gt;I ended up solving this by building a refined, iterative prompt strategy using Gemini. Instead of relying on manual search, I developed specific system prompts that act as a "data cleaner," taking raw, disparate search results and parsing them into a standardized format. This allowed me to automate the extraction of real-time visa requirements and cost-of-living data, turning hours of manual browsing into a structured pipeline.&lt;/p&gt;

&lt;p&gt;What’s Next?&lt;br&gt;
I’m currently focused on refining the data pipeline to ensure even higher accuracy as the city list grows. Looking ahead, I am working on building a real-time cost calculator. My goal is to allow users to input their specific lifestyle preferences—like housing, coworking needs, and local transit—and get an instantly calculated, customized budget estimate for any of the cities on the platform.&lt;/p&gt;

&lt;p&gt;I’d love to get some feedback from the community! If you are a fellow developer or a digital nomad, please check it out: &lt;a href="https://nomadmatrix.vercel.app/" rel="noopener noreferrer"&gt;https://nomadmatrix.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What’s the one piece of data you find hardest to track down when planning a move? Let me know in the comments!&lt;/p&gt;

&lt;h1&gt;
  
  
  showdev #nomad #webdev #data
&lt;/h1&gt;

</description>
      <category>showdev</category>
      <category>webdev</category>
      <category>data</category>
      <category>nomad</category>
    </item>
    <item>
      <title>AI-Cost-Explorer-Stop Guessing Your AI API Costs</title>
      <dc:creator>Nagesh Gunji</dc:creator>
      <pubDate>Thu, 09 Jul 2026 08:45:41 +0000</pubDate>
      <link>https://dev.to/nagesh_gunji_8795e0ff18d8/ai-cost-explorer-stop-guessing-your-ai-api-costs-585l</link>
      <guid>https://dev.to/nagesh_gunji_8795e0ff18d8/ai-cost-explorer-stop-guessing-your-ai-api-costs-585l</guid>
      <description>&lt;p&gt;The Problem: "Invisible" AI Costs&lt;br&gt;
Ever received an unexpected, massive bill from an AI API provider? You aren't alone. As developers, we love integrating LLMs into our projects, but the "black box" nature of token consumption makes it nearly impossible to predict costs before they hit our credit cards.&lt;/p&gt;

&lt;p&gt;The Solution: AI Cost Explorer&lt;br&gt;
I built AI Cost Explorer to solve this. It is a local-first, privacy-focused dashboard that lets you track, visualize, and optimize your LLM token usage and costs in real-time.&lt;/p&gt;

&lt;p&gt;Key Features&lt;br&gt;
Real-time Cost Ticker: See exactly how much your app is spending down to the cent, in real-time.&lt;/p&gt;

&lt;p&gt;Intelligent Semantic Caching: Stop paying for the same answer twice. Our cache stores intent, delivering instant, free responses for repetitive queries.&lt;/p&gt;

&lt;p&gt;Local AI Orchestration: Seamlessly manage local models (like Llama 3 via Ollama) alongside cloud providers to ensure you only pay when absolutely necessary.&lt;/p&gt;

&lt;p&gt;Built for Developers&lt;br&gt;
I built this because I needed a tool that was:&lt;/p&gt;

&lt;p&gt;Privacy-First: Your code and project data never leave your local environment.&lt;/p&gt;

&lt;p&gt;Performance-Driven: Zero latency, with an interface designed to give you the data you need without the "marketing fluff."&lt;br&gt;
Check out this Link &lt;a href="https://ai-cost-explorer.vercel.app/" rel="noopener noreferrer"&gt;https://ai-cost-explorer.vercel.app/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>monitoring</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
