<?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"><channel><title><![CDATA[Software Engineering]]></title><description><![CDATA[Software Engineering]]></description><link>https://generative-ai-project.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 10:26:10 GMT</lastBuildDate><atom:link href="https://generative-ai-project.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Building my first Redis-powered feature]]></title><description><![CDATA[When I started doing backend development, I was building the authentication module for a project. The flow was straightforward: the frontend sent a JWT token, the backend verified and decoded it, extracted the user id, and then queried the database t...]]></description><link>https://generative-ai-project.hashnode.dev/building-my-first-redis-powered-feature</link><guid isPermaLink="true">https://generative-ai-project.hashnode.dev/building-my-first-redis-powered-feature</guid><category><![CDATA[Redis]]></category><category><![CDATA[backend]]></category><category><![CDATA[backend developments]]></category><category><![CDATA[software development]]></category><category><![CDATA[caching]]></category><category><![CDATA[Databases]]></category><dc:creator><![CDATA[Viraj]]></dc:creator><pubDate>Fri, 16 Jan 2026 18:33:00 GMT</pubDate><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768588235545/35510988-3693-4071-8702-a4215c97e060.jpeg" alt class="image--center mx-auto" /></p>
<p>When I started doing backend development, I was building the authentication module for a project. The flow was straightforward: the frontend sent a JWT token, the backend verified and decoded it, extracted the user id, and then queried the database to confirm the user existed.</p>
<p>I ended up building three auth APIs: one for signup, one for login, and one for Google OAuth (login/signup). This post is about the login side—and more specifically, what I learned after it “worked.”</p>
<p>A couple of days in, I noticed a pattern: every time I hit a protected API, the backend repeated the same routine. JWT comes in → verify/decode → extract user id → query the database → respond. And it wasn’t a one-time thing. It happened on every request that required authentication.</p>
<p>That’s when I paused and asked myself: can this be faster? Instead of going to the database every time and searching through thousands of users, can I keep the frequently needed data somewhere quicker?</p>
<p>Coming from a frontend background, my first instinct was almost funny in hindsight: “What if I store the user in localStorage?” Then it clicked—there’s no localStorage on a server. That’s a browser feature, not something your backend can rely on.</p>
<p>While exploring better options, I came across Redis and the idea of in-memory caching. The promise was simple: keep hot data in RAM, fetch it in microseconds, and avoid unnecessary database queries. I dug into the docs and implemented it step by step.</p>
<p>Here’s what I changed: on login (and on subsequent authenticated requests), after verifying and decoding the JWT, I’d take the user id and check Redis first. If Redis had the user (or the minimal data I needed), I could skip the database call. If Redis didn’t have it, only then I’d query the main database—and immediately store the result in Redis with a TTL, so future requests could be served faster.</p>
<p>After doing this, I could clearly see the difference. The system stopped hitting the database for the same repeated lookups, and overall latency dropped noticeably (in my case, roughly half for those paths).</p>
<p>The bigger lesson for me wasn’t just “Redis is fast”—it was understanding why the bottleneck existed and how caching fits into backend thinking: reduce repeated expensive operations, and use the database for what it should do best, not for the same lookups again and again.</p>
]]></content:encoded></item><item><title><![CDATA[Retrieval-Augmented Generation (RAG) Explained: A Complete Guide]]></title><description><![CDATA[What is RAG?
RAG stands for Retrieval-Augmented Generation. It's an AI architecture that combines information retrieval systems with generative AI models to produce more accurate, up-to-date, and contextually relevant responses.
Simple Analogy: Think...]]></description><link>https://generative-ai-project.hashnode.dev/retrieval-augmented-generation-rag</link><guid isPermaLink="true">https://generative-ai-project.hashnode.dev/retrieval-augmented-generation-rag</guid><category><![CDATA[genai]]></category><category><![CDATA[#ChaiaurCode #HiteshChoudhary #PiyushGarg #GenAICohort #GenAI #LLM #PersonaPrompting #GeminiAI #ReactJS #NextJS #Python #AIChatbot #Hashnode #PromptEngineering #Vercel #HindiEnglishBlog #DevJourney]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Retrieval-Augmented Generation]]></category><category><![CDATA[AI]]></category><category><![CDATA[development]]></category><dc:creator><![CDATA[Viraj]]></dc:creator><pubDate>Tue, 14 Oct 2025 08:00:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/lFtttcsx5Vk/upload/63447fe560663764f5d3e4cf5c2c847b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-rag">What is RAG?</h2>
<p>RAG stands for Retrieval-Augmented Generation. It's an AI architecture that combines information retrieval systems with generative AI models to produce more accurate, up-to-date, and contextually relevant responses.</p>
<p><strong>Simple Analogy:</strong> Think of RAG like a student taking an open-book exam. Instead of memorizing everything (like traditional AI), the student can reference textbooks (external knowledge) to give accurate answers. This reduces the chance of making up incorrect information.</p>
<h2 id="heading-the-two-core-phases-of-rag">The Two Core Phases of RAG</h2>
<h2 id="heading-phase-1-ingestionindexing-the-knowledge-storage-phase">Phase 1: Ingestion/Indexing (The Knowledge Storage Phase)</h2>
<p>This is where we prepare and store data in a vector database for quick retrieval.</p>
<p><strong>The Process:</strong></p>
<ol>
<li><p><strong>Document Upload</strong> - You have a PDF (could be 100, 1000, or 10,000 pages)</p>
</li>
<li><p><strong>Chunking</strong> - Breaking the document into smaller, digestible pieces</p>
</li>
<li><p><strong>Vector Embeddings</strong> - Converting these chunks into mathematical representations</p>
</li>
<li><p><strong>Storage</strong> - Saving these embeddings in a vector database</p>
</li>
</ol>
<p><strong>Why Chunking?</strong></p>
<ul>
<li><p>LLM APIs have rate limits and token constraints</p>
</li>
<li><p>Processing everything at once would overload servers</p>
</li>
<li><p>Smaller chunks enable precise retrieval</p>
</li>
</ul>
<p><strong>Analogy:</strong> Imagine organizing a massive library. Instead of memorizing every book, you create an index card system where each card contains a summary and location. When someone asks a question, you quickly find the relevant cards instead of reading every book.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760261175895/3430a407-1c1b-44dc-9031-7ef059d96f55.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-phase-2-retrievalgeneration">Phase 2: Retrieval/Generation</h2>
<p>In the retrieval phase, the process unfolds in several key steps:</p>
<ol>
<li><p><strong>User Query</strong> - The user submits a prompt or question through the interface</p>
</li>
<li><p><strong>Query Embedding</strong> - The prompt is converted into a vector embedding using the same embedding model used during the indexing phase (this consistency is crucial for accurate matching)</p>
</li>
<li><p><strong>Similarity Search</strong> - The query embedding is compared against all stored embeddings in the vector database. The database uses similarity metrics (like cosine similarity or Euclidean distance) to find the most relevant chunks</p>
</li>
<li><p><strong>Context Retrieval</strong> - The vector database returns the top-k most similar chunks (typically 3-5 chunks, though this is configurable based on your needs)</p>
</li>
<li><p><strong>Prompt Augmentation</strong> - The retrieved context is combined with the user's original query to create an enriched prompt. This gives the LLM relevant background information</p>
</li>
<li><p><strong>LLM Generation</strong> - The augmented prompt is sent to an LLM (ChatGPT, Claude, Gemini, Llama, or any other model). The LLM generates a response grounded in the retrieved context</p>
</li>
<li><p><strong>Response Delivery</strong> - The final output is returned to the user</p>
</li>
</ol>
<p><strong>The Result:</strong> Users receive responses that are contextually accurate, grounded in your specific data source, and significantly less prone to hallucinations.</p>
<hr />
<p>In the upcoming article I will explain how a production level RAG works, until then see ya :)</p>
]]></content:encoded></item></channel></rss>