<?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[Adarsh Srivastava — AI Engineering Notes]]></title><description><![CDATA[Adarsh Srivastava — AI Engineering Notes]]></description><link>https://srivastava-adarsh.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 11:36:49 GMT</lastBuildDate><atom:link href="https://srivastava-adarsh.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[pgvector vs a local vector store (Chroma) — what an infra person notices]]></title><description><![CDATA[Standing up pgvector and Chroma from scratch — distance metrics, HNSW vs IVFFlat indexes, and the memory/cost tradeoffs an infrastructure engineer notices.]]></description><link>https://srivastava-adarsh.hashnode.dev/pgvector-vs-chroma-what-an-infra-engineer-notices</link><guid isPermaLink="true">https://srivastava-adarsh.hashnode.dev/pgvector-vs-chroma-what-an-infra-engineer-notices</guid><category><![CDATA[vector database]]></category><category><![CDATA[PostgreSQL]]></category><category><![CDATA[AI]]></category><category><![CDATA[Machine Learning]]></category><category><![CDATA[RAG ]]></category><dc:creator><![CDATA[Adarsh Srivastava]]></dc:creator><pubDate>Tue, 27 Oct 2026 21:20:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a8c9c986c2c370397903bee/9b8a0c12-6482-4a5e-951e-dc170c15e212.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>After 18 years in infrastructure, I spent this week standing up two vector stores from scratch — pgvector (Postgres extension) and Chroma (a purpose-built vector DB) — and loading the same content into both. A few things jumped out that I don't see talked about much from an ops lens:</p>
<ol>
<li>"Vector database" is two different philosophies. Chroma exists only to do vector search. pgvector is a plugin that teaches your existing Postgres to do it. If an enterprise already runs Postgres (most do), pgvector means one fewer system to back up, secure, and monitor — vectors live in the same row as your normal data. That "reuse what you already operate" instinct is very familiar to anyone from ops.</li>
<li>The distance metric is a real decision, not a default. I proved to myself that cosine and L2 can rank the same vectors differently — two vectors pointing the same direction but different lengths were "identical" to cosine and "far apart" to L2. For text embeddings (where meaning lives in direction, not magnitude), cosine is usually the honest choice. With normalized embeddings like MiniLM's, they converge — so metric choice becomes a cost decision.</li>
<li>The index is where my infra brain lit up. Brute-force search is O(n) per query — fine for 5 rows, a problem at millions. The two approximate-nearest-neighbor indexes trade a little recall for big speed:</li>
</ol>
<ul>
<li>IVFFlat — clusters the space, searches only the nearest clusters. Cheap memory, but goes stale as data grows → needs rebuilds.</li>
<li>HNSW — a navigable graph you "walk" toward the query. Faster queries, graceful inserts — but the link graph lives in RAM, so at tens of millions of vectors it becomes a real cost line item.</li>
</ul>
<p>The architect's call: default to HNSW for query performance and streaming inserts; reach for IVFFlat when memory/cost at scale dominates or the corpus is static. Same recall-vs-speed-vs-cost tradeoff I've made a hundred times in other systems — just a new runtime.</p>
<p>The through-line: a vector store is a distributed system with the same old tradeoffs — memory, cost, freshness, latency. The vocabulary is new; the engineering judgment isn't.</p>
<p>Hand-built and measured myself (AI-assist off while I learn). Code in my public ai-fundamentals-lab.(<a href="https://github.com/srivastava-adarsh/ai-fundamentals-lab">https://github.com/srivastava-adarsh/ai-fundamentals-lab</a>)</p>
]]></content:encoded></item><item><title><![CDATA[18 Years in Infrastructure — Why I'm Learning AI Engineering From the Ground Up]]></title><description><![CDATA[I've spent about eighteen years working in infrastructure and cloud — networks, systems, automation, the kind of work that keeps things running and scales…]]></description><link>https://srivastava-adarsh.hashnode.dev/18-years-in-infrastructure-why-i-m-learning-ai-engineering-from-the-ground-up</link><guid isPermaLink="true">https://srivastava-adarsh.hashnode.dev/18-years-in-infrastructure-why-i-m-learning-ai-engineering-from-the-ground-up</guid><dc:creator><![CDATA[Adarsh Srivastava]]></dc:creator><pubDate>Tue, 01 Sep 2026 20:02:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a8c9c986c2c370397903bee/85d0e590-7e18-46da-9a3e-ffe5a52f0039.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I've spent about eighteen years working in infrastructure and cloud — networks, systems, automation, the kind of work that keeps things running and scales when they need to. I'm comfortable reasoning about distributed systems, failure modes, and trade-offs at an architectural level.</p>
<p>But here's an honest admission: when it comes to AI systems, I've mostly been a <em>user</em>. I can wire things together and get results. What I couldn't always do was explain, from first principles, <em>why</em> they work — or defend the design decisions under hard questioning.</p>
<p>I decided that wasn't good enough. So I'm changing it, in public.</p>
<h2>Why now</h2>
<p>AI isn't a side technology anymore; it's becoming part of how everything gets built. As someone who has always understood the systems I work with at a deep level, being a surface-level AI user started to feel like a gap I didn't want to carry.</p>
<p>I don't want to just <em>use</em> retrieval-augmented generation, agents, and embeddings. I want to understand them well enough to design them, reason about their trade-offs, and explain them to a room of skeptical engineers. That's a different bar — and it's the one I'm aiming for.</p>
<h2>The approach: learn by building, in public</h2>
<p>A few rules I've set for myself:</p>
<ul>
<li><p><strong>Build from primitives.</strong> Before reaching for a framework, I write the basic version by hand so I actually understand what the framework is doing for me.</p>
</li>
<li><p><strong>AI-assist off while learning.</strong> It's tempting to let AI generate the code. But the whole point is to understand it, so during learning I type it myself — and debug my own mistakes.</p>
</li>
<li><p><strong>Document everything.</strong> Every step goes into a public repo and a learning log. If I can't explain it, I don't really know it.</p>
</li>
<li><p><strong>Low drama, steady pace.</strong> About an hour a day. Consistency over intensity.</p>
</li>
</ul>
<p>Everything lives here: <a href="https://github.com/srivastava-adarsh/ai-fundamentals-lab">github.com/srivastava-adarsh/ai-fundamentals-lab</a></p>
<h2>Week 1: back to fundamentals</h2>
<p>I started where it makes sense for someone rebuilding hands-on muscle — Python fundamentals, framed around things I'd actually use for AI work.</p>
<p>In the first week I:</p>
<ul>
<li><p>Rewrote an operations shell script (a disk-usage checker) in Python — learning variables, running shell commands from code, parsing output, and handling real-world edge cases where the data isn't as clean as you'd like.</p>
</li>
<li><p>Worked through lists and dictionaries, and built the exact data structure that every LLM API uses to represent a conversation (a list of <code>{"role": ..., "content": ...}</code> messages).</p>
</li>
<li><p>Refactored my code into reusable functions — separating <em>computing</em> a result from <em>displaying</em> it.</p>
</li>
<li><p>Handled files and JSON: the load → modify → save cycle that underpins config and API data.</p>
</li>
</ul>
<p>Along the way I hit every classic beginner bug — indentation that changes your logic, booleans that must be capitalized, a stray shell-style <code>$</code> where a <code>%</code> belonged. Debugging those myself was the point.</p>
<h2>What's next</h2>
<p>From here the plan moves outward:</p>
<ul>
<li><p>Calling APIs from Python</p>
</li>
<li><p>Building a small wrapper to talk to a language model programmatically</p>
</li>
<li><p>Retrieval and embeddings — understanding semantic search by building it</p>
</li>
<li><p>Agents and tool use</p>
</li>
<li><p>Evaluation, observability, cost, and safety — the things that separate a demo from a production system</p>
</li>
</ul>
<p>I'll write these up as I go — including what breaks, because that's usually where the learning is.</p>
<h2>Why write it down</h2>
<p>Two reasons. First, explaining something forces me to actually understand it. Second, I think there's value in showing the <em>unglamorous middle</em> of learning — not a polished expert, but an experienced engineer deliberately rebuilding a skill in the open.</p>
<p>If you're on a similar path — experienced in one area, deliberately going deep in another — I'd genuinely like to hear how you're approaching it.</p>
<p>More soon.</p>
]]></content:encoded></item></channel></rss>