<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Tushar Khanka]]></title><description><![CDATA[Clouds. Careers. Containers. Explained without the buzzwords]]></description><link>https://www.tusharkhanka.com</link><image><url>https://substackcdn.com/image/fetch/$s_!RfFI!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bec2e2b-8b28-46b7-b6e0-c46ea4e7691a_1280x1280.png</url><title>Tushar Khanka</title><link>https://www.tusharkhanka.com</link></image><generator>Substack</generator><lastBuildDate>Mon, 13 Apr 2026 08:45:15 GMT</lastBuildDate><atom:link href="https://www.tusharkhanka.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Tushar Khanka]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[tusharkhanka@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[tusharkhanka@substack.com]]></itunes:email><itunes:name><![CDATA[Tushar Khanka]]></itunes:name></itunes:owner><itunes:author><![CDATA[Tushar Khanka]]></itunes:author><googleplay:owner><![CDATA[tusharkhanka@substack.com]]></googleplay:owner><googleplay:email><![CDATA[tusharkhanka@substack.com]]></googleplay:email><googleplay:author><![CDATA[Tushar Khanka]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[From S3 to PGVector: A Lesson in Operational Simplicity]]></title><description><![CDATA[This week was one of those weeks.]]></description><link>https://www.tusharkhanka.com/p/from-s3-to-pgvector-a-lesson-in-operational</link><guid isPermaLink="false">https://www.tusharkhanka.com/p/from-s3-to-pgvector-a-lesson-in-operational</guid><dc:creator><![CDATA[Tushar Khanka]]></dc:creator><pubDate>Fri, 27 Feb 2026 19:00:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RfFI!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bec2e2b-8b28-46b7-b6e0-c46ea4e7691a_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This week was one of those weeks.</p><p>I moved our search stack across a hard path: <strong>S3 vectors &#8594; Pinecone &#8594; PGVector</strong>, across two services, without breaking the core user experience.</p><p>From the outside, this sounds like a backend detail. From the inside, this is the difference between &#8220;search kind of works&#8221; and &#8220;search is reliable enough to trust.&#8221;Why I Made This Move</p><p>As we scaled, I had to ask a simple founder question: <strong>Are we adding complexity because it helps users, or because it&#8217;s the default architecture everyone copies?</strong></p><p>We already run Postgres at the center of our system. User data, media metadata, jobs, auth , all there.</p><p>Keeping vectors far away in another runtime sounded flexible, but in reality it created friction:</p><ul><li><p>More moving parts</p></li><li><p>Harder debugging</p></li><li><p>Identity mismatches between metadata and vectors</p></li><li><p>Too many places where failures could hide</p></li></ul><p>PGVector wasn&#8217;t just a cost or tooling choice. It was a <strong>coherence</strong> choice.</p><p>When your vectors live near your source-of-truth data, the system gets easier to reason about.What Broke (and What It Taught Me)</p><p>The hard part wasn&#8217;t ANN math. The hard part was <strong>identity discipline</strong>.</p><p>We had multiple ID forms floating around:</p><ul><li><p>S3 object keys</p></li><li><p>Generated vector IDs</p></li><li><p>Canonical media IDs in Postgres</p></li></ul><p>Those are not interchangeable.</p><p>In old flows, some embeddings were being written with IDs that looked valid but didn&#8217;t match relational truth. Once we enforced foreign keys in PGVector tables, those bad writes started failing loudly.</p><p>It hurt for a day. It saved us months of silent corruption.</p><p>That&#8217;s a founder lesson I keep relearning:Systems don&#8217;t fail because of one big wrong decision. They fail because of small naming mismatches no one thought were important.Why PGVector Won for Us (Right Now)</p><p>Not because it&#8217;s trendy. Because it matches our product reality.</p><ul><li><p>We need strong ownership boundaries per user.</p></li><li><p>We need deterministic joins between vectors and metadata.</p></li><li><p>We need one operational surface we can monitor deeply.</p></li><li><p>We need to debug incidents quickly, not guess across multiple platforms.</p></li></ul><p>PGVector gave us that.</p><p>Does this mean external vector systems are bad? No. It means for our current stage, <strong>operational simplicity beats architectural novelty</strong>.The Migration Principle I Care About Most</p><p>I didn&#8217;t want a one-way rewrite.</p><p>So I kept a provider abstraction in place:</p><ul><li><p>postgres for current primary</p></li><li><p>s3 as switchable path</p></li></ul><p>Why? Because founders don&#8217;t optimize for being &#8220;right forever.&#8221; We optimize for being <strong>adaptable without rewrites</strong>.</p><p>The goal is not &#8220;never change infra again.&#8221; The goal is: changing infra should not require rebuilding your company.What Changed Culturally in Our Engineering Process</p><p>This migration also reinforced a process shift for me:</p><ul><li><p>No more &#8220;it passed locally, ship it.&#8221;</p></li><li><p>Every critical path gets deterministic smoke checks.</p></li><li><p>Every bug class gets explicit logs.</p></li><li><p>Every production-like failure gets turned into a codified test scenario.</p></li></ul><p>And maybe most importantly: we now treat &#8220;debuggability&#8221; as a feature, not an afterthought.What I&#8217;m Proud Of</p><p>Not that we switched a vector backend. I&#8217;m proud that we did it while preserving product flow, learning from failures quickly, and making the system more understandable for the team after me.</p><p>Startups often celebrate speed. I still value speed. But I&#8217;m increasingly convinced that <strong>clarity is compounding</strong>.</p><p>Clear systems. Clear IDs. Clear ownership. Clear logs.</p><p>That&#8217;s what scales.</p>]]></content:encoded></item><item><title><![CDATA[A First Step Toward AI Search (and What Comes After)]]></title><description><![CDATA[I&#8217;ve been thinking a lot about what &#8220;search&#8221; really means in the age of AI. Oh yes! after seeing the high of setting up my first vector database.]]></description><link>https://www.tusharkhanka.com/p/a-first-step-toward-ai-search-and</link><guid isPermaLink="false">https://www.tusharkhanka.com/p/a-first-step-toward-ai-search-and</guid><dc:creator><![CDATA[Tushar Khanka]]></dc:creator><pubDate>Tue, 27 Jan 2026 08:17:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!svdl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Not keyword search. Not filters. But the kind of search where you ask a system a question and expect it to <em>understand </em>what you&#8217;re really after, and just as importantly, what context it might be missing.<br><br>This feels like the first real step toward how AI systems will reason going forward.</p><div><hr></div><h3><strong>Vector Search: When Meaning Is Close</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-DJX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-DJX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png 424w, https://substackcdn.com/image/fetch/$s_!-DJX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png 848w, https://substackcdn.com/image/fetch/$s_!-DJX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png 1272w, https://substackcdn.com/image/fetch/$s_!-DJX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-DJX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png" width="1456" height="320" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:150196,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.tusharkhanka.com/i/185936126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-DJX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png 424w, https://substackcdn.com/image/fetch/$s_!-DJX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png 848w, https://substackcdn.com/image/fetch/$s_!-DJX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png 1272w, https://substackcdn.com/image/fetch/$s_!-DJX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4ba2da-f78f-43b4-9809-42e69c491465_2036x448.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>Vector search is where most GenAI journeys start, and for good reason.</p><p>It works by turning text into numbers and placing similar meanings close together in a mathematical space. When you search, the system retrieves things that <em>feel</em> similar in intent or language.</p><p>This is great for semantic matching.</p><p>Ask for &#8220;electric toothbrush&#8221; and you&#8217;ll get&#8230; electric toothbrushes.</p><p>But there&#8217;s a quiet limitation here.</p><p>Vector search struggles when two things are <em>related</em> but not <em>similar</em>.</p><p>A login event and a financial transaction don&#8217;t live near each other in vector space,  even if both are part of the same fraud story.</p><p>Similarity isn&#8217;t the same as relevance.</p><div><hr></div><h3><strong>Knowledge Graphs: When Meaning Is Connected</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RTv7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RTv7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png 424w, https://substackcdn.com/image/fetch/$s_!RTv7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png 848w, https://substackcdn.com/image/fetch/$s_!RTv7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png 1272w, https://substackcdn.com/image/fetch/$s_!RTv7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RTv7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png" width="1456" height="360" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:360,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:187907,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.tusharkhanka.com/i/185936126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RTv7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png 424w, https://substackcdn.com/image/fetch/$s_!RTv7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png 848w, https://substackcdn.com/image/fetch/$s_!RTv7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png 1272w, https://substackcdn.com/image/fetch/$s_!RTv7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d0d934e-5f09-47d0-9c32-a1fde1ec3fa6_2036x504.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This is where graphs enter the picture.</p><p>A knowledge graph doesn&#8217;t care if two things sound alike. It cares about how they&#8217;re connected. Entities are nodes. Relationships are edges. Meaning emerges from how many &#8220;hops&#8221; it takes to get from one thing to another.</p><p>Graphs shine when:</p><ul><li><p>relationships matter more than wording</p></li><li><p>context lives across systems</p></li><li><p>the question is &#8220;how is this connected?&#8221; rather than &#8220;what is this similar to?&#8221;</p></li></ul><p>Think social networks, supply chains, audits, investigations, anywhere cause, sequence, or dependency matters.</p><div><hr></div><h3><strong>Scoring Isn&#8217;t a Single Step Anymore</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qOV4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qOV4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png 424w, https://substackcdn.com/image/fetch/$s_!qOV4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png 848w, https://substackcdn.com/image/fetch/$s_!qOV4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png 1272w, https://substackcdn.com/image/fetch/$s_!qOV4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qOV4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png" width="1456" height="391" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:391,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114928,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.tusharkhanka.com/i/185936126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qOV4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png 424w, https://substackcdn.com/image/fetch/$s_!qOV4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png 848w, https://substackcdn.com/image/fetch/$s_!qOV4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png 1272w, https://substackcdn.com/image/fetch/$s_!qOV4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0696a66e-6597-4ff3-afe4-fddcd750749e_2028x544.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The most important insight for me wasn&#8217;t vector vs graph.</p><p>It was how <strong>scoring</strong> actually happens in real AI systems.</p><p>Modern search is almost always hybrid.</p><h4><strong>Pattern 1: Vector first, graph later</strong></h4><p>You start with similarity. Grab the top results. Then expand through relationships.</p><p>This is how you recommend a lubrication gel <em>after</em> someone adds fissure meds to their cart.</p><p>Not because they&#8217;re similar, but because they belong to the same world.</p><h4><strong>Pattern 2: Graph first, vector later</strong></h4><p>You start wide. Pull a large set of related entities. Then rank them by similarity.</p><p>This is how &#8220;friends of friends&#8221; becomes &#8220;friends of friends you&#8217;ll actually get along with.&#8221;</p><p>In both cases, scoring isn&#8217;t just distance in vector space.</p><p>It&#8217;s distance <strong>plus</strong> structure.</p><div><hr></div><h3><strong>Why GraphRAG Matters</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7o-5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7o-5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png 424w, https://substackcdn.com/image/fetch/$s_!7o-5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png 848w, https://substackcdn.com/image/fetch/$s_!7o-5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png 1272w, https://substackcdn.com/image/fetch/$s_!7o-5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7o-5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png" width="1456" height="415" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:415,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:129501,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.tusharkhanka.com/i/185936126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7o-5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png 424w, https://substackcdn.com/image/fetch/$s_!7o-5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png 848w, https://substackcdn.com/image/fetch/$s_!7o-5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png 1272w, https://substackcdn.com/image/fetch/$s_!7o-5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2365b17d-9c3a-4c86-9373-5f4ded72837a_2020x576.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The most convincing example was GraphRAG.</p><p>A system asked:</p><p><em>&#8220;What are the sales prospects for Company X in India?&#8221;</em></p><p>Vector-only retrieval found positive articles. The model answered optimistically and confidently wrong.</p><p>GraphRAG did something subtle:</p><ul><li><p>It found the company via vectors</p></li><li><p>Then followed relationships the text never made explicit</p></li><li><p>A logistics partner</p></li><li><p>A canal</p></li><li><p>A blockage</p></li></ul><p>Suddenly, the answer changed. Not because of new text, but because of <strong>missing context now made visible</strong>.</p><p>This is the difference between sounding smart and being correct.</p><div><hr></div><h3><strong>Where This Leaves Me</strong></h3><p>I&#8217;m starting to see AI search less as &#8220;better retrieval&#8221; and more as <strong>progressive understanding</strong>.</p><ul><li><p>Vectors help you <em>enter</em> the problem space</p></li><li><p>Graphs help you <em>navigate</em> it</p></li><li><p>The model synthesises only after both have done their job</p></li></ul><p>This feels like the natural evolution of search:</p><p>from matching words</p><p>to matching meaning</p><p>to understanding systems.</p><p>This is just the beginning. The real work lies ahead in how we design these layers, how we control scoring, and how we prevent confidence without grounding.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!svdl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!svdl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png 424w, https://substackcdn.com/image/fetch/$s_!svdl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png 848w, https://substackcdn.com/image/fetch/$s_!svdl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png 1272w, https://substackcdn.com/image/fetch/$s_!svdl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!svdl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png" width="1456" height="374" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:374,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:73135,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.tusharkhanka.com/i/185936126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!svdl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png 424w, https://substackcdn.com/image/fetch/$s_!svdl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png 848w, https://substackcdn.com/image/fetch/$s_!svdl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png 1272w, https://substackcdn.com/image/fetch/$s_!svdl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbca1c801-08fa-41fd-a215-a0b071ecec87_2022x520.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>That&#8217;s a journey that interests me next.</p><p></p><div><hr></div><p><br><strong>A small note on where I&#8217;m learning this from</strong></p><p>A lot of my current thinking around AI search especially the<br> &#8220;retrieve &#8594; expand context &#8594; re-rank &#8594; answer&#8221; <br>shape  is being influenced by the <strong>RAG-Anything</strong> work from HKUDS. Their framework diagram helped me see the pipeline as a <em>system</em>, not a single retrieval trick.</p><p>Framework diagram</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ScxM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ScxM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic 424w, https://substackcdn.com/image/fetch/$s_!ScxM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic 848w, https://substackcdn.com/image/fetch/$s_!ScxM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic 1272w, https://substackcdn.com/image/fetch/$s_!ScxM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ScxM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic" width="1456" height="633" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:633,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:242275,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.tusharkhanka.com/i/185936126?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ScxM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic 424w, https://substackcdn.com/image/fetch/$s_!ScxM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic 848w, https://substackcdn.com/image/fetch/$s_!ScxM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic 1272w, https://substackcdn.com/image/fetch/$s_!ScxM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e2a4ac-5371-4787-b80b-2b0119a78104_2498x1086.heic 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Repository:  https://github.com/HKUDS/RAG-Anything.git<br></p><p><strong>Thanks:</strong></p><p>Thank you to the HKUDS team and contributors,  open diagrams and open repos like this make it easier for builders like me to learn in public, iterate fast, and stay honest about what we&#8217;re actually standing on.<br></p><div><hr></div>]]></content:encoded></item><item><title><![CDATA[Two GitHub Profiles, One Laptop: The Pragmatic Guide ]]></title><description><![CDATA[Two accounts, one laptop, zero context-switching headaches.]]></description><link>https://www.tusharkhanka.com/p/two-github-profiles-one-laptop-the</link><guid isPermaLink="false">https://www.tusharkhanka.com/p/two-github-profiles-one-laptop-the</guid><dc:creator><![CDATA[Tushar Khanka]]></dc:creator><pubDate>Thu, 11 Sep 2025 15:52:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/7f1325ae-caf9-4495-ad55-72291d41afc7_800x1000.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This post is about how I fixed that mess &#8212; not by chasing fancy abstractions, but by making Git and SSH play nicely together with some pragmatic plumbing. </p><div><hr></div><h2><strong>The Problem</strong></h2><p>On paper, it sounds simple:</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.tusharkhanka.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p>Company GitHub account &#8594; already set up with an SSH key (~/.ssh/id_rsa), global Git config uses tushar@work.com.</p></li><li><p>Personal GitHub account &#8594; I want a new SSH key, repos under a dedicated folder (~/tushar/), and commits showing my personal email.</p></li></ul><p>In reality, Git doesn&#8217;t make it that easy:</p><ul><li><p><strong>Identity bleed:</strong> Git&#8217;s user.name and user.email are global by default. If you don&#8217;t override them, your work email leaks into personal repos.</p></li><li><p><strong>SSH collisions:</strong> By default, GitHub only has one hostname: github.com. Which key it uses depends on your SSH config. Without care, everything routes through your company identity.</p></li><li><p><strong>Muscle memory:</strong> You don&#8217;t want to remember special clone commands. You want git clone to just work.</p></li></ul><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Sg5s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Sg5s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic 424w, https://substackcdn.com/image/fetch/$s_!Sg5s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic 848w, https://substackcdn.com/image/fetch/$s_!Sg5s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic 1272w, https://substackcdn.com/image/fetch/$s_!Sg5s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Sg5s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic" width="1456" height="528" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:528,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:167463,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://tusharkhanka.substack.com/i/173364277?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Sg5s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic 424w, https://substackcdn.com/image/fetch/$s_!Sg5s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic 848w, https://substackcdn.com/image/fetch/$s_!Sg5s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic 1272w, https://substackcdn.com/image/fetch/$s_!Sg5s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6439412b-974e-4d38-a617-662dcd287adf_2436x884.heic 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div><hr></div><h2><strong>Implementation</strong></h2><p>I didn&#8217;t want a brittle workflow where I manually swap configs or run custom scripts. The goal was <em>event-driven identity switching</em> &#8212; Git should know which account to use simply based on <em>where I&#8217;m working</em>. </p><p>Here&#8217;s how I wired it up:</p><h3><strong>1. Two SSH Keys, Two Hosts</strong></h3><p>I generated a second SSH key for my personal account:</p><pre><code><code>ssh-keygen -t ed25519 -C "me@gmail.com" -f ~/.ssh/id_rsa_personal</code></code></pre><p>Then I taught SSH to treat GitHub as two different hosts:</p><pre><code><code>vi ~/.ssh/config</code></code></pre><pre><code><code># Default: Company
Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa
  IdentitiesOnly yes

# Personal
Host github-personal
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_personal
  IdentitiesOnly yes</code></code></pre><p>Now I can talk to GitHub through github.com (work) or github-personal (personal).</p><div><hr></div><h3><strong>2. Directory-Based Git Config</strong></h3><p>Next problem: user.email. I wanted anything in ~/tushar/ to use my personal identity. Luckily, Git has an <em>underrated feature</em> called includeIf.</p><p>In ~/.gitconfig:</p><pre><code><code>[user]
    name = Work User
    email = work@company.com

[includeIf "gitdir:/Users/tusharkhanka/tushar/**"]
    path = /Users/tusharkhanka/.gitconfig-personal</code></code></pre><p>And then in ~/.gitconfig-personal:</p><pre><code><code>[user]
    name = Tushar Khanka
    email = me@gmail.com

[url "git@github-personal:"]
    insteadOf = git@github.com:</code></code></pre><p>This does two things at once:</p><ul><li><p>Inside ~/tushar/*, Git rewrites my identity to personal.</p></li><li><p>Any git@github.com:... URL in that path is transparently rewritten to git@github-personal:..., so SSH uses the right key.</p></li></ul><div><hr></div><h3><strong>3. Testing Reality</strong></h3><p>Here&#8217;s the catch I stumbled on: includeIf only applies inside a <em>real repo</em>. Running git config user.email in ~/tushar/ will still show your global identity. That confused me for a while.</p><p>But once I cd&#8217;d into a real repo under ~/tushar/* and checked:</p><pre><code><code>git config user.email
git config --show-origin user.email</code></code></pre><p>I finally saw:</p><pre><code><code>me@gmail.com
file:/Users/tusharkhanka/.gitconfig-personal</code></code></pre><p>That was the &#8220;aha&#8221; moment.</p><div><hr></div><h2><strong>Results</strong></h2><p>With this setup:</p><ul><li><p>Work repos under ~/workspace/* &#8594; automatically use my company email + company SSH key.</p></li><li><p>Personal repos under ~/tushar/* &#8594; automatically use my personal email + personal SSH key.</p></li><li><p>Cloning is seamless:</p><ul><li><p>Work: git clone git@github.com:CompanyOrg/repo.git</p></li><li><p>Personal: git clone git@github.com:MyUser/repo.git (rewritten under the hood).</p></li></ul></li></ul><p>No more manual switching, no more accidents where a side project commit shows up with my company identity.</p><div><hr></div><h2><strong>Lessons Learned</strong></h2><ol><li><p><strong>Git&#8217;s config system is powerful but picky.</strong></p><ul><li><p>gitdir:~/tushar/ doesn&#8217;t work, because ~ won&#8217;t expand.</p></li><li><p>You need the absolute path, and often /** to catch subdirectories.</p></li></ul></li><li><p><strong>SSH aliases are your friend.</strong></p><p>GitHub only has github.com, but nothing stops you from inventing github-personal or github-sideprojects to force key separation.</p></li><li><p><strong>Don&#8217;t test in empty directories.</strong></p><p>includeIf only evaluates inside real repos. Test from within a .git directory, otherwise you&#8217;ll chase ghosts.</p></li><li><p><strong>Pragmatism beats clever scripts.</strong></p><p>I first wrote a shell script to rewrite remotes, but the config approach was cleaner, automatic, and future-proof.</p></li></ol><div><hr></div><h2><strong>Conclusion</strong></h2><p>This wasn&#8217;t about elegance; it was about pragmatism. I wanted to prevent identity bleed between work and personal projects without adding cognitive overhead. The end result is boring in the best way: I don&#8217;t think about it anymore.</p><p>Scaling infrastructure often works the same way. You don&#8217;t need a silver bullet; you need guardrails that let you move fast without tripping yourself up. Git&#8217;s includeIf and SSH&#8217;s Host blocks gave me exactly that.</p><p>Now when I hack on a side project over the weekend, I know the commits belong to me, not my employer. That&#8217;s the kind of separation that keeps both sides happy.</p><div><hr></div><h3><strong>TL;DR &#8212; Copy-Paste Setup</strong></h3><p>If you just want the working config, here it is:</p><h3><strong>~/.ssh/config</strong></h3><pre><code><code># Work (default)
Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa
  IdentitiesOnly yes

# Personal
Host github-personal
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_personal
  IdentitiesOnly yes</code></code></pre><div><hr></div><h3><strong>~/.gitconfig</strong></h3><pre><code><code>[user]
    name = Work User
    email = work@company.com

[includeIf "gitdir:/Users/yourusername/tushar/**"]
    path = /Users/yourusername/.gitconfig-personal</code></code></pre><div><hr></div><h3><strong>~/.gitconfig-personal</strong></h3><pre><code><code>[user]
    name = Your Name
    email = your@email.com

[url "git@github-personal:"]
    insteadOf = git@github.com:</code></code></pre><div><hr></div><h3><strong>Usage</strong></h3><ul><li><p>Clone work repos normally:</p></li></ul><pre><code><code>git clone git@github.com:CompanyOrg/repo.git</code></code></pre><ul><li><p>Clone personal repos the same way (Git rewrites it for you):</p></li></ul><pre><code><code>git clone git@github.com:MyUser/repo.git</code></code></pre><div><hr></div><h5><em>Done. Now Git and SSH auto-switch identities based on directory &#8212; no manual swapping, no leaks. </em></h5><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.tusharkhanka.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>