<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aymaan  pathan on Medium]]></title>
        <description><![CDATA[Stories by Aymaan  pathan on Medium]]></description>
        <link>https://medium.com/@aymaanpathan5?source=rss-cca4d90f4f9a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Aymaan  pathan on Medium</title>
            <link>https://medium.com/@aymaanpathan5?source=rss-cca4d90f4f9a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 06:06:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aymaanpathan5/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I Stopped Asking AI to Write Code. I Gave It a Team Instead.]]></title>
            <link>https://medium.com/@aymaanpathan5/i-stopped-asking-ai-to-write-code-i-gave-it-a-team-instead-2527d1edd56f?source=rss-cca4d90f4f9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2527d1edd56f</guid>
            <dc:creator><![CDATA[Aymaan  pathan]]></dc:creator>
            <pubDate>Sat, 07 Nov 2026 12:53:23 GMT</pubDate>
            <atom:updated>2026-11-08T06:23:56.143Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UcocFl0EXjIB3Oxf-XU8cQ.png" /></figure><h3>How I built Oggy on Switch: I say one sentence, and a team of AI agents takes it from bug report to production, while I watch from my phone.</h3><p>I can say this out loud to my laptop:</p><blockquote><strong><em>“Fix the 500 error on huge payment amounts in paytrack and deploy it.”</em></strong></blockquote><p>What happens next: the bug is found, fixed, tested, reviewed, approved by my team, deployed, and confirmed live in production.</p><p>I never open my editor, and I could have sent the same sentence from my phone.</p><p>That’s <strong>Oggy</strong>.</p><p>This post covers what it does, how it works, and why building it on <strong>Switch</strong> let me skip half the work.</p><h3>The problem: AI gave us hands, not a team</h3><p>AI writes code well now. But writing code was never the whole job.</p><p>When a bug comes in, someone still has to:</p><p><strong>find it → fix it → prove it with a test → get it reviewed → ask the team → deploy → check production.</strong></p><p>AI helps with one of those seven steps.</p><p>The other six are still you, at your desk, switching windows.</p><p>I didn’t want a smarter pair of hands.</p><p>I wanted a <strong>team</strong>, plus a lead who runs it for me and only comes to me when a real decision is needed.</p><h3>What Oggy is</h3><p>Oggy is a Windows app you control with your <strong>voice</strong>.</p><p>Press Ctrl + Space, speak (I use <a href="https://wisprflow.ai/">Wispr Flow</a>), and Oggy does two kinds of work:</p><ol><li><strong>It operates your PC:</strong> apps, files, projects, dev servers and settings.</li><li><strong>It builds and ships software</strong> by leading a team of AI agents that live in Switch.</li></ol><p>The same box takes typing, and the same commands work from Discord on your phone.</p><h3>1. It runs your PC</h3><p>Say what you want in plain words.</p><p>Common commands like:</p><ul><li>“open my Downloads”</li><li>“mute”</li><li>“take a screenshot”</li></ul><p>are matched instantly, with no AI call.</p><p>Anything new is planned by Claude and checked against your real files before it runs.</p><p>For example:</p><ul><li><strong>“Put my resume and offer letter in a folder called Jobs and zip it.”</strong></li><li><strong>“Close Chrome and Notepad, then mute.”</strong></li><li><strong>“Start the dev server in paytrack.”</strong></li><li><strong>“Undo that.”</strong></li></ul><p>If something is unclear, Oggy asks:</p><blockquote><em>“Which one, the PDF or the DOCX?”</em></blockquote><p>Everything lands in the <strong>Daily</strong> view, so you can see what it did.</p><h3>2. It leads an agent team</h3><p>This is the part that changed how I work.</p><p><strong>Oggy never writes your project’s code itself.</strong></p><p>It plans the work, hands each step to a specialist agent, runs independent steps in parallel, asks people at the right moments, and checks the result.</p><p>Every agent has <strong>one clear responsibility</strong> — and strict boundaries on what it is allowed to do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z6zdSaCyOkPgqNuniUVN_A.png" /></figure><h3>The Agent Team</h3><ul><li><strong>Scout Agent</strong> — Finds the root cause of the issue, down to the file and line.</li><li><strong>Frontend Agent</strong> — Fixes and builds the UI. Never touches APIs or databases.</li><li><strong>Backend Agent</strong> — Fixes and builds APIs, servers, and databases. Never touches the UI.</li><li><strong>Tester Agent</strong> — Writes a failing test that proves the bug, then verifies the fix. Never changes application code.</li><li><strong>Reviewer Agent</strong> — Reviews the changes and returns either LOOKS GOOD or CHANGES NEEDED. Never edits code.</li><li><strong>Release Agent</strong> — Writes release notes, merges the changes, and deploys. Never ships without the team’s approval.</li><li><strong>Assistant Agent</strong> — Reads Gmail and Calendar, creates Notion tasks, and drafts emails. Never sends emails.</li></ul><h3>Why one job per agent?</h3><p>I tried one big agent first.</p><p>On real work, it fails predictably: the agent that wrote the code writes the test, and a test written to pass isn’t a test. The agent that reviews its own fix approves its own fix.</p><p>Splitting jobs fixes this <strong>through structure, not prompting</strong>.</p><p>Scout and Reviewer can’t introduce bugs because they can’t edit. Tester can’t “fix” a failing test by changing the app. Nothing ships by accident because only Release can deploy, and it waits for the team’s approval.</p><p>It also unlocks parallel work:</p><p><strong>while Backend writes the fix, Tester is already writing the test that proves the bug.</strong></p><h3>A real run, start to finish</h3><p>Back to that sentence:</p><blockquote><strong><em>“Fix the 500 error on huge payment amounts in paytrack and deploy it.”</em></strong></blockquote><h3>1. Oggy plans</h3><p>Claude drafts the plan using real project data — actual folders, scripts, and recent jobs.</p><p>Oggy validates every step against the project and rejects plans that reference files or tools that don’t exist.</p><p>It also adds guardrails: bugs get a Scout step first, while deployments require a Tester, Reviewer, and release notes.</p><h3>2. I approve once</h3><p>One approval covers the entire plan.</p><h3>3. The agents work</h3><p>Scout finds the root cause.</p><p>Backend and Tester work in parallel.</p><p>Tester verifies the fix, while Reviewer checks the changes.</p><h3>4. I see the real changes</h3><p>Oggy creates a Git snapshot when the job starts, giving me a complete diff of every file the agents touched, along with a plain-English summary.</p><p>I can keep the changes, undo them, or request changes.</p><h3>5. The team votes</h3><p>The team votes in Discord.</p><p>One no is enough to stop the deployment.</p><h3>6. Ship, then verify</h3><p>Release deploys the changes, and Oggy checks the live site for the new commit.</p><p><strong>“Done” means production is running the new code — not that an agent simply said it finished.</strong></p><p>Every job lives on the <strong>Coding</strong> board, from Queued to Done:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aJbSUq5Co9_qUIurflYC5Q.png" /></figure><p>And the team sees every step in Discord:</p><h3>Workflows: define it once, run it by name</h3><p>Once you have a team, you notice you give it the same instructions over and over.</p><p>So any routine can become a <strong>workflow</strong>.</p><p>Describe it once, in plain words, and give it a name.</p><p>Oggy designs it, then checks every part against what’s real: your agents, your teammates, and your projects.</p><p>A workflow can’t name an agent you don’t have or a project that doesn’t exist.</p><p>Once saved, it runs exactly as designed.</p><p>From then on, the whole command is the name:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0pzSlPI1y4ormu1_3au2jA.png" /></figure><p><strong>“run Release Day.”</strong></p><p>You can say it, type it, send it from Discord, or schedule it for every weekday at 9am.</p><p>My most-used ones:</p><ul><li><strong>Release Day:</strong> Tester and Reviewer work in parallel, then Release deploys after I approve.</li><li><strong>logs-analyzer:</strong> Scout reads paytrack’s live Render logs and posts what’s going on to the team.</li><li><strong>todo:</strong> Assistant reads my unread mail and turns it into Notion tasks. One morning it read 20 emails and added 4 tasks.</li></ul><h3>Control from your phone</h3><p>Oggy lives in my Discord as @oggy.</p><p>From anywhere I can:</p><ul><li>start a job</li><li>run a workflow</li><li>reply yes to approve a step</li><li>control the PC with commands like @oggy take a screenshot</li></ul><p>My teammates can also vote on deploys from their own phones.</p><p>There are <strong>no open ports, no tunnel, no VPN, and no mobile app</strong>.</p><p>My phone and laptop don’t even need to share a network.</p><p>That works because of the most important decision in the project.</p><h3>Why I built it on Switch</h3><p>A multi-agent system usually needs a long list of plumbing:</p><ul><li>a message bus so agents can talk</li><li>a registry of who exists</li><li>an approval UI</li><li>remote access</li><li>a history store</li><li>a way for humans to join in</li></ul><p>That’s months of work before you even get to the interesting part.</p><p><a href="https://switchagents.ai/">Switch</a> already provides all of it because it treats <strong>agents and people the same way</strong>.</p><p>Both sit in <strong>rooms</strong>, post in <strong>threads</strong>, and hold <strong>roles</strong>. Rooms are also bridged to chat apps like Discord.</p><p>Oggy itself is just another Switch agent: @oggy.</p><p>Once I saw that, every hard feature became a small one:</p><p>Switch feature What it became in Oggy Seven Claude Code agents, each with one job. Oggy messages each one its step.<strong>Threads </strong>Every job is one thread: request, hand-offs, questions, approvals, and result.<strong>Discord bridge </strong>Phone control for free: the desktop thread <em>is</em> the phone thread.<strong>People in rooms </strong>Team votes are just yes replies, checked against each person&#39;s Switch ID. <strong>Roles </strong>Each agent&#39;s job is a seat. Whoever holds the Tester seat gets testing work. <strong>Rooms + references </strong>One room per project, with its GitHub repo attached. <strong>Room documents </strong>A Project log the next job reads first, so agents never start from scratch.</p><h3>The agent contract is one line</h3><p>The whole contract between Oggy and an agent is one line.</p><p>Each agent ends its reply with a marker:</p><ul><li>DONE: … means finished, and that line becomes the step&#39;s result.</li><li>BLOCKED: … means stuck, so the run stops and says why.</li><li>ASK: … means the agent wants a person&#39;s OK before a heavy step.</li><li>LOOKS GOOD / CHANGES NEEDED is the Reviewer&#39;s verdict.</li></ul><p>That means <strong>any Claude Code session can join the team with no custom integration</strong>.</p><p>Add an agent in Switch Console, give it a seat, and Oggy starts sending it that kind of work.</p><p><strong>Without Switch, Oggy would be a desktop app with no team, no phone control, and no shared history.</strong></p><h3>Build this on Switch yourself</h3><p>If you’ve never used Switch, here’s the path I took.</p><p>Everything runs locally.</p><h3>You need</h3><ul><li>Windows 10/11</li><li>Docker Desktop</li><li>Claude Code, signed in</li><li>A Discord server where you can add a bot</li></ul><h3>1. Install Switch Console</h3><p>Run switch-console-x64.exe, choose <strong>Run a server on this computer</strong>, and wait for <strong>Running locally</strong>.</p><h3>2. Add your agents</h3><p>In <strong>Your Agents</strong>, click <strong>+</strong>, give the agent a lowercase name, point <strong>Directory</strong> at your code folder, and pick <strong>Claude Code</strong>.</p><p>One agent is enough to start.</p><p>Names like scout, backend, and tester let Oggy guess each one&#39;s job.</p><h3>3. Connect Discord</h3><p>Create a bot in the Discord Developer Portal.</p><p>Turn on:</p><ul><li><strong>Server Members</strong></li><li><strong>Message Content</strong></li></ul><p>Then invite it.</p><p>In Switch Console, go to <strong>Messaging apps → Connect → Discord</strong> and paste the token and server ID.</p><p>Every channel can now become a room.</p><h3>4. Make the rooms</h3><p>Create Discord channels named:</p><ul><li>team — coding jobs</li><li>oggy-daily — everyday tasks</li></ul><p>Post once in each.</p><p>Switch turns them into rooms.</p><h3>5. Install Oggy</h3><p>Run Oggy-Setup.exe.</p><p>It finds Switch Console and registers itself, so you don’t need to copy any keys.</p><p>Then select the agents Oggy is allowed to use.</p><h3>6. Invite Oggy</h3><p>Invite Oggy to team and oggy-daily in Switch Console.</p><h3>7. Try it</h3><p>Press Ctrl + Space and say:</p><blockquote><strong><em>“take a screenshot”</em></strong></blockquote><p>Then send this from Discord:</p><p>@oggy open my Downloads</p><p>That’s it.</p><h3>Safe by design</h3><p>An app that can press keys, move files, and deploy needs to be careful.</p><p>Every step passes three checks right before it runs:</p><h3>1. Is it from you?</h3><p>Desktop commands carry an owner token.</p><p>Discord commands must come from your exact account.</p><h3>2. Is it allowed?</h3><p>Oggy only uses its own fixed toolbox, inside the folders and apps you allow.</p><h3>3. Is it risky?</h3><p>Deleting, installing, pressing keys, and deploying always wait for your approval.</p><p>On top of that, every code change is a real Git diff you can undo.</p><p>A deploy needs the whole team’s approval.</p><p>And everything stays on your machine.</p><h3>What I learned</h3><ul><li><strong>Structure beats prompting.</strong> Taking away an agent’s ability to edit worked better than any prompt telling it to be careful.</li><li><strong>“Done” has to be verified.</strong> Agents will say they finished. Checking production for the new commit is the only “done” I trust.</li><li><strong>Humans belong in the loop, not in the way.</strong> One approval for the plan and one vote for the deploy. Everything in between runs on its own.</li><li><strong>Pick the platform that makes your hard parts easy.</strong> Switch turned phone control, team votes, and agent hand-offs from projects into features.</li></ul><h3>Try it</h3><p>Oggy is open source and runs on Windows 10 and 11.</p><ul><li><strong>Website:</strong> oggy-landing.vercel.app</li><li><strong>Code:</strong> github.com/AymaanPathan/oggy</li></ul><p>If you build something with it, or break something with it, I’d love to hear about it.</p><p><em>Built for the Flip the Switch hackathon with </em><a href="https://switchagents.ai/"><em>Switch</em></a><em> and </em><a href="https://wisprflow.ai/"><em>Wispr Flow</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2527d1edd56f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pathway: I Turned GitHub History into a Knowledge Graph That Assigns You Your Next Coding Mission]]></title>
            <link>https://medium.com/@aymaanpathan5/pathway-we-turned-github-history-into-a-knowledge-graph-that-assigns-you-your-next-coding-mission-2c240a2bf45e?source=rss-cca4d90f4f9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c240a2bf45e</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[graph]]></category>
            <dc:creator><![CDATA[Aymaan  pathan]]></dc:creator>
            <pubDate>Sun, 18 Oct 2026 16:13:32 GMT</pubDate>
            <atom:updated>2026-10-18T17:34:34.132Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mo5q5Dqo_Eq1lOepRQbrew.png" /></figure><p>Built for the FalkorDB Hackathon</p><h3>Every developer growth tool I’ve used has the same flaw: it guesses.</h3><p>It reads your resume, your self-rated skills, or a quiz score, then recommends a “Top 10 React Tutorials” list. None of it knows what you’ve actually built.</p><p>Your GitHub history does know. Every commit is a small piece of evidence about what you can do. The problem is that evidence is a pile of diffs, not a structure you can reason over.</p><p><strong>Pathway</strong> is our answer. It turns your coding history into a <strong>knowledge graph</strong> in FalkorDB, works out how your demonstrated capabilities relate to your goal, and hands you <strong>one specific coding mission</strong> in your own repository. When your code passes verification, that becomes new evidence in the graph, and the next recommendation gets smarter.</p><blockquote><em>Pathway understands what you’ve built, figures out what you can work on next, gives you a real coding task, and learns from your verified progress.</em></blockquote><p>This post covers how it works, with a focus on the graph, the agents, and the tools.</p><h3>The core idea: evidence, not claims</h3><p>Most platforms store <em>assertions</em> (“aymaan knows Redis”). Pathway stores <em>evidence</em> (“aymaan wired a Redis client into session.ts in commit a3f91c2”) and derives everything else from it.</p><p>That choice shapes the whole architecture:</p><ul><li>A skill is never a number we make up. It is a <strong>depth assessment</strong> backed by real file changes.</li><li>A recommendation is never “learn X.” It is a <strong>mission anchored to a file in your repo</strong>, citing the evidence that justified it.</li><li>A completed mission is never a checkbox. It has to <strong>pass tests the platform runs</strong>, and only then does it write back to the graph.</li></ul><p>This creates a closed loop:</p><pre>GitHub history ──► Knowledge graph ──► Goal &amp; next move ──► Mission<br>       ▲                                                       │<br>       └────── verified evidence ◄── sandbox tests ◄── your code</pre><h3>Why a graph (and why FalkorDB)</h3><p>Developer knowledge is relational. Skills aren’t a flat list:</p><ul><li>You can’t properly learn <em>distributed locking</em> before you understand <em>caching</em> and <em>connection lifecycles</em>.</li><li>Topics form natural communities that cut across engineering domains.</li><li>Some topics are <strong>foundations</strong> that dozens of others stand on. Others are <strong>bridges</strong> connecting separate areas.</li></ul><p>Those are graph questions, and FalkorDB let us answer them natively with Cypher and built-in graph algorithms instead of exporting data into a separate analytics pipeline.</p><h4>The schema</h4><p>The core of the graph is small:</p><p>Node / EdgeMeaning(:Developer)The person(:Topic)A node in a shared engineering taxonomy(Topic)-[:BUILDS_ON]-&gt;(Topic)Prerequisite structure, pointing from advanced topic to foundation(Topic)-[:RELATED_TOPIC]-(Topic)Topical affinity, used for community detection(Developer)-[:KNOWS_TOPIC {level, level_rank}]-&gt;(Topic)What this developer demonstrably showsDepthAssessmentPer-topic roll-up with first_seen / last_seen derived from authored file changes</p><p>Depth is graded on four levels: <strong>surface → working → proficient → deep</strong>. Each assessment also carries an <em>authenticity</em> signal (for example genuine_implementation), so a topic you merely imported doesn’t count the same as one you actually built.</p><p>The shared taxonomy is the clever part. Because every developer’s KNOWS_TOPIC edges attach to the <em>same</em> Topic nodes, the graph can reason about what’s <strong>adjacent to what you know but not yet assessed</strong>. That frontier is where the best next move lives.</p><h3>Graph algorithms doing real work</h3><p>I deliberately avoided “score everything with an LLM.” Wherever structure can answer a question, FalkorDB’s algorithms do it. Ordering and ranking come from graph position, not from a made-up skill score.</p><h4>1. PageRank: “What are my foundations?”</h4><p>cypher</p><pre>algo.pageRank(&#39;Topic&#39;, &#39;BUILDS_ON&#39;)</pre><p>Edges point from advanced topic to foundation, so PageRank mass <strong>accumulates on foundations</strong>. A high score means many other topics transitively stand on it. Our rank_foundations tool surfaces these and flags the ones where the developer is still shallow (foundation not yet deep). Those are the highest-leverage things to strengthen.</p><h4>2. Betweenness: “What connects my skills?”</h4><p>Betweenness centrality finds <strong>bridge topics</strong>, the ones that sit on the shortest paths between otherwise separate parts of your knowledge. PageRank tells you what’s <em>deep</em>, and betweenness tells you what’s <em>connective</em>. I combine them in a shared graphOrder comparator so ordering across tools is consistent and explainable.</p><h4>3. Label propagation: “What do I actually work on together?”</h4><p>cypher</p><pre>CALL algo.labelPropagation({<br>  nodeLabels: [&#39;Topic&#39;],<br>  relationshipTypes: [&#39;RELATED_TOPIC&#39;],<br>  maxIterations: 10<br>})<br>YIELD node, communityId</pre><p>This is community detection <strong>without choosing the number of clusters up front</strong>. The communities often cut across engineering domains, for example backend, observability, and data topics clustering together because that’s how <em>you</em> work. If the live algorithm isn’t available, the tool falls back to the persisted Topic.cluster_id written during analysis, so it degrades gracefully.</p><h4>4. Variable-length traversal: “How do I get to X?”</h4><p>Our learning_path_to_topic tool is pure Cypher:</p><p>cypher</p><pre>MATCH path = (t:Topic {slug: $slug})-[:BUILDS_ON*1..4]-&gt;(f:Topic)<br>WITH f, min(length(path)) AS hops<br>OPTIONAL MATCH (:Developer {id: $dev})-[k:KNOWS_TOPIC]-&gt;(f)<br>RETURN f.slug, f.name, hops,<br>       coalesce(k.level, &quot;&quot;) AS level,<br>       coalesce(k.level_rank, -1) AS rank</pre><p>It walks up to four hops of prerequisites, takes the <strong>minimum path length</strong> per prerequisite (how deep it sits), and left-joins your KNOWS_TOPIC edges to mark what you already have. The result is sorted deepest-foundation-first, then by PageRank, and rendered as an ordered roadmap with known / todo / target statuses.</p><h4>5. The frontier query: “What’s ready for me?”</h4><p>recommend_next_topics finds topics you haven’t been assessed on <strong>whose </strong><strong>BUILDS_ON foundations you already show</strong>. Candidates are ranked by <em>readiness</em> (fraction of foundations known), then by PageRank and betweenness. It also surfaces topics worth <em>deepening</em>: assessed at working or proficient level but high in graph influence.</p><h3>The tool layer: 16 graph tools behind a planner</h3><p>The graph is exposed to the chat agent through a typed catalog of <strong>16 tools</strong>, each wrapping a specific FalkorDB capability:</p><p>ToolGraph capabilityprofile_overviewDepthAssessment roll-up + PageRank/betweenness orderingstrongest_topics, find_gapsDepth levels and graph positionrecommend_next_topicsBUILDS_ON traversal + KNOWS_TOPIC joinlearning_path_to_topicBUILDS_ON*1..4 traversalrank_foundationsalgo.pageRankfind_bridgesalgo.betweennessknowledge_communitiesalgo.labelPropagationconnect_topics, explore_neighborhoodPath and neighborhood queriesconnectivity_check, compare_topics, explain_topic, search_topicsStructural analysis and lookupaudit_authenticityGenuine vs. superficial usagerecent_activitylast_seen reads: what’s active, what’s gone quiet</p><p>Each tool declares its name, title, description, a whenToUse hint, the FalkorDB features it relies on, and a typed parameter schema. That one declaration feeds three things:</p><ol><li><strong>The planner model</strong> sees the catalog (describeTools()) and picks tools.</li><li><strong>Argument validation</strong> (parseToolArgs) enforces types, enums, and numeric clamps, and drops unknown keys, so model output can never inject arbitrary parameters. Parameters can also default to the topic the user currently has selected in the UI.</li><li><strong>The frontend</strong> renders the same metadata, so users see <em>which graph feature</em> answered their question.</li></ol><h4>Explainability built in</h4><p>Every tool run is wrapped in runTool, which enforces a <strong>20-second timeout</strong> and returns a ToolRun containing the result, latency, and an ordered, plain-language how: string[] explaining how the answer was reached. Tools can return their own real operations and counts. The fallback only states what’s certain: the inputs received, what the tool is designed to read, and the size of what came back. It never claims an operation ran when it can’t prove it.</p><p>Tools return structured <strong>UI blocks</strong> (roadmap, ranking, groups, timeline, stats, callout) rather than prose. The LLM narrates; the graph supplies the facts and the visuals.</p><h3>The agent pipeline: from graph to goal to mission</h3><p>This is where the graph turns into action. The system is a chain of narrow agents, each with one job and a validator between it and the database.</p><h4>Stage 1: Depth Analyzer</h4><p>Reads your commit and file-change history, maps changes to taxonomy topics, and writes DepthAssessments and KNOWS_TOPIC edges, including authenticity classification.</p><h4>Stage 2: Goal Agent</h4><p>Given your stated goal and the graph, it decides <strong>ONE next move</strong>: a focus topic, the capability that advances it, the gap topics standing in the way, and the strengths to build on. The decision is saved to the graph as a Goal + NextMove, linked to the <strong>evidence</strong> (E1, E2, …) it was based on.</p><h4>Stage 3: Mission Agent</h4><p>This is the most constrained agent, and where I spent the most care. It reads the saved move <em>by id</em> (it cannot change your goal, focus, or capability) and gets a <strong>fresh inspection of your real repository</strong>: the pinned commit, the current code around the starting point, nearby files, and a <strong>gap probe</strong>.</p><p>The gap probe is a grounding mechanism. Before the agent can claim “your code lacks Redis,” I check package.json dependencies, the start file’s text, and file paths. If the probe finds hits, the agent is told not to claim the capability is missing and must describe what the code actually shows.</p><p>The agent must return a mission with strict structure:</p><ul><li><strong>≤5 files</strong>, all implementation. modifyPaths must include the start file.</li><li><strong>Exactly 3 acceptance criteria</strong>, each an observable test case (status code, thrown error, retried call).</li><li><strong>3–5 implementation steps</strong>, step 1 opening the start file and naming real functions, the last one committing and pushing.</li><li><strong>A verbatim </strong><strong>observedNow fragment</strong> (12–140 characters) copied from the actual code, proving the mission is anchored to reality.</li><li><strong>A </strong><strong>contract</strong>: the decisions the developer shouldn’t have to guess, such as library, exported function names, key format, TTL, connection lifecycle, and error behavior.</li></ul><h4>The key insight: developers write implementation only</h4><p>The developer <strong>never writes tests</strong>. The platform writes them from the acceptance criteria and runs them in an evaluation sandbox against the developer’s files. That makes verification independent of the person being verified.</p><p>But it introduces a risk: a trivial implementation (a local Map instead of Redis) could pass a result-only test. So I enforce a rule at the validation layer:</p><blockquote><em>The criteria must </em><strong><em>prove the mechanism</em></strong><em>, not just the result.</em></blockquote><p>If the move requires a library, <strong>at least 2 of the 3 criteria must name it</strong> and assert the interaction (calls received by a mock client, keys written, values read back, deletions issued). criteriaNameMechanism checks this programmatically and rejects the plan otherwise.</p><h4>A self-repairing generation loop</h4><p>LLMs break contracts, so the pipeline treats generation as untrusted:</p><ol><li>The agent replies with JSON only.</li><li>validateMission repairs what it can and rejects what isn’t grounded.</li><li>readContract rejects a missing contract or fewer than 3 concrete decisions.</li><li>criteriaNameMechanism rejects criteria that don’t name the library.</li><li>On rejection, the agent is re-prompted <strong>with the exact rejection reasons</strong> and its previous reply, up to <strong>3 attempts</strong>, and told to keep what’s sound.</li><li>stripTesting is a final guard: even if a test file slipped into scope or steps, it’s removed before storage.</li></ol><p>The result is tagged llm or llm_repaired so I can see how often repair was needed. And if no LLM is available, Pathway refuses to invent a task (llm_unavailable) rather than faking one.</p><h3>Closing the loop</h3><p>When the developer pushes their branch, the platform runs its generated tests in the sandbox. If they pass, the diff becomes <strong>new, verified evidence</strong>: new commits, new file changes, new DepthAssessments. The graph updates, the frontier shifts, and PageRank and community structure shift with it. The next move is chosen from a graph that now contains proof you just earned. The celebration screen is the visible edge of a real graph write.</p><h3>What I learned</h3><p><strong>1. Use the graph for structure, the LLM for judgment.</strong> Ordering, readiness, and foundations come from algorithms. The LLM only writes the move and the mission, and only inside a validated envelope.</p><p><strong>2. Ground every claim.</strong> Verbatim code fragments, gap probes, and evidence ids make hallucination checkable instead of just discouraged.</p><p><strong>3. Make verification independent.</strong> Platform-written tests against developer-written code removes the “grading your own homework” problem.</p><p><strong>4. Make tools self-describing.</strong> One declaration drives the planner, the validator, and the UI. Adding a new graph tool is a single file.</p><p><strong>5. Show your work.</strong> The how trail, the feature labels, and the llm_repaired flag all make the system auditable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c240a2bf45e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a Backend That Optimizes Itself, Based on Whatever Scenario You Give It]]></title>
            <link>https://medium.com/@aymaanpathan5/i-built-a-backend-that-optimizes-itself-based-on-whatever-scenario-you-give-it-998c036914a0?source=rss-cca4d90f4f9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/998c036914a0</guid>
            <dc:creator><![CDATA[Aymaan  pathan]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 21:28:53 GMT</pubDate>
            <atom:updated>2026-07-25T21:28:53.706Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fLtNz0cBx7Gnd7Fg4Mv1mw.png" /></figure><p>You give it a scenario, like 100 people checking out at once, and it goes and finds the actual bottleneck, tries out a few different fixes, and tells you which one really worked. No guessing, no “this should help” from an AI with no way to check its own answer.</p><p>That’s Axiom AI. It reads live telemetry from a SigNoz instance wired to your backend, states the real bottleneck in plain English, proposes several fix strategies, and then runs each one in its own sandboxed container under identical load before it claims a winner. Nothing ships because it sounded right. It ships because a number said so.</p><h3>The shape of the pipeline</h3><p>Axiom connects to two things: your GitHub repo and your SigNoz instance. When you pick a route, it starts by pulling that route’s real trace data from SigNoz: p50/p95/p99 latency, error rate, request volume, over a live window. It also pulls container-level CPU and memory from the docker_stats OTel receiver. Only once it has actual numbers does it hand the trace context to a model and ask for a root cause.</p><p>From there it generates several independent fix strategies, each with its own diff and an estimated improvement range. I made it plural on purpose. The first fix I try is rarely the right one, and pretending otherwise is how you end up shipping a batched-query rewrite for a concurrency problem.</p><h3>How SigNoz powers this</h3><p>Every number in Axiom comes from one of two SigNoz query paths. Aggregation queries pull p50, p95, p99, and a request count scoped to a service and route, plus a second pass with an hasError filter for the error rate, both over the live window the run just generated. Raw queries pull the actual rows behind those numbers when something needs the detail: recent traces, recent errors with their exception message and stack trace attached, deduplicated by trace and span ID since SigNoz’s query_range path can return the same span twice.</p><p>Container CPU and memory come from a completely separate signal, the docker_stats OTel receiver, queried over a 30-second trailing window so a single quiet 5-second gap in collection doesn&#39;t read as a dead container. There&#39;s no fallback anywhere in that path. If SigNoz has no data point for a container in that window, the number shown is 0, never a guess. That matters more than it sounds like it should: it&#39;s the reason the model diagnosing your bottleneck is reasoning from what actually happened in your service, not from a plausible-sounding description of your code.</p><h3>Before the Arena: the workspace for one route</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhe2elJyAycOFSkqf3OIrw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQCGwumvmIF3n9MdUuJKlw.png" /></figure><p>Pick a route and you land on a page built around that one endpoint. A sidebar explains what the route actually does in plain English, generated from the code itself, plus the call chain underneath it: route, controller, service, in order, each one clickable back to source. Describe a scenario in a text box, something like “simulate 20 requests at a single time,” and it turns that into a real k6 script with the right VUs, iterations, and thresholds already set. Hit run and container health and live telemetry update in real time next to it: CPU, memory, req/sec, error rate, p50/p95/p99, whether the thresholds passed. That run is what feeds the diagnosis that eventually lands in the Arena.</p><h3>The Arena: where the AI has to show its work</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qFWOiBE4kkVF8Eu2LBZbQ.png" /></figure><p>Each strategy gets its own isolated container, gets the patch applied, and gets hit with the same k6-generated load test as every other strategy: same virtual users, same duration, same scenario. While it runs, live CPU, memory, and latency stream back to the UI over sockets, so I can watch each candidate in real time instead of waiting on a spinner. When all three finish, a synthesis step scores them on latency, p95, CPU, and memory together and picks a winner. Only then does it open a real PR against the base branch.</p><p>That last step turned out trickier than I expected. By the time the PR runs, the file on GitHub might not match the copy the strategy was generated against, because someone could have pushed in the meantime. So the PR service re-fetches the file right before opening the PR, re-locates the original code snippet inside whatever’s actually there now, and refuses to touch anything if that snippet can’t be found in exactly one place. A silent overwrite of a stale file is worse than failing loudly.</p><h3>The bug that taught me the most</h3><p>SigNoz has a known issue where firing multiple query_range calls at once can return intermittent 5xxs. Separately, the same span can come back duplicated in a raw trace list. Neither is fatal on its own, but both will quietly corrupt a dashboard if nothing accounts for them.</p><p>The fix took three layers, not one: every SigNoz call funnels through a single internal queue so requests never actually run in parallel, a small TTL cache with in-flight de-duplication stops repeat panel mounts from joining that queue for data that’s still fresh, and every route query gets one retry with a short backoff so a single bad attempt doesn’t drop it from the dashboard.</p><pre>async function withOneRetry&lt;T&gt;(fn: () =&gt; Promise&lt;T&gt;): Promise&lt;T&gt; {<br>  try {<br>    return await fn();<br>  } catch {<br>    await new Promise((r) =&gt; setTimeout(r, 300));<br>    return fn();<br>  }<br>}</pre><p>I found this combination the slow way, by watching the dashboard fail in three separate ways on three separate days and fixing each one as it showed up. None of the three alone would have been enough.</p><p>There was a smaller, equally annoying bug in the Arena view too: I was recomputing every node’s position from scratch on each telemetry tick, so any node a user dragged would silently snap back. The fix was to stop treating the computed layout as ground truth and merge it into react-flow’s own position state instead of replacing it.</p><h3>What I’d tell past-me</h3><p>Build the caching and de-duplication layer before you build the dashboard that needs it. I built it after, once I’d already watched the dashboard fall over in front of me, which cost more time than doing it first would have. And don’t let an AI’s confidence stand in for a benchmark. “Sounds right” and “measured faster” are different claims, and in Axiom only one of them gets to open a pull request.</p><p>The whole pipeline runs on SigNoz traces and metrics from end to end: diagnosis, strategy generation, isolated benchmarking, and the PR. If you’re building anything that reasons about your system’s behavior, build the observability layer first. It changes what your AI is allowed to claim.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=998c036914a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What actually happens when you scan a QR code to pay someone in crypto]]></title>
            <link>https://medium.com/@aymaanpathan5/what-actually-happens-when-you-scan-a-qr-code-to-pay-someone-in-crypto-9f9848bb5578?source=rss-cca4d90f4f9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f9848bb5578</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[blockchain-cryptocurrency]]></category>
            <dc:creator><![CDATA[Aymaan  pathan]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 19:06:36 GMT</pubDate>
            <atom:updated>2026-07-08T15:00:39.405Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dtv9p9e4jZw073SDsX6s2A.png" /></figure><blockquote>Okay so I got mildly obsessed with this for like two days. I scanned a QR to send someone USDT, and it just worked, and that bugged me because I had no idea what “worked” actually meant underneath. So I went down the rabbit hole.</blockquote><p><strong>The first thing that surprised me was that the QR code is doing WAY more than just holding an address.</strong> It’s carrying the chain too. Which sounds obvious once you say it out loud. But think about it the same wallet address can technically exist on Ethereum, Polygon, and a bunch of other EVM-compatible chains. If the QR doesn’t specify the correct network and you send on the wrong one, recovering those funds can be difficult or sometimes impossible depending on the wallets and chains involved. It’s not always a “customer support will fix it” situation. So yeah, half the point of the QR isn’t encoding, it’s basically babyproofing the whole flow.</p><p>Then your wallet has to build the actual transaction, and this is where nonces show up, <strong>which honestly I didn’t fully get until I broke something with one</strong>. A nonce is just a counter like transaction #47 for your account. If you skip one or reuse one, the transaction doesn’t error out nicely, it just kind of sits there doing nothing, or gets stuck, and you’re left refreshing your wallet like an idiot wondering what’s wrong. There’s also a fee/gas estimate happening at the same time, and that number is basically guessing how busy the network is right now, which is why sometimes the same transfer costs way more or less than last time.</p><p>Before any of that hits the network there’s a validation step. Signature checks out? Balance actually covers the amount plus the fee? Fee high enough that someone will actually bother processing it? Nobody talks about this part because when it works you never see it. <strong>My guess is that a lot of the annoying “why did my transaction fail?” bugs live right here</strong>.</p><p>Honestly the part that got me thinking the most was <strong>idempotency</strong>, which I didn’t expect going in. Picture this you hit confirm, the app just hangs. No error, no confirmation, just spinning. Do you tap it again? What if the first one actually went through fine and you just never got the response back? That’s not some rare edge case, that happens constantly, especially on bad connections. Systems handle it a few ways at once a unique key per attempt so a duplicate doesn’t create a second payment, the backend recognizing “hey I’ve seen this request already,” and even the blockchain itself helps a bit here since rebroadcasting the exact same signed transaction doesn’t create a duplicate payment because the network recognizes it as the same transaction. The actual risk isn’t resending the same thing, it’s the wallet deciding to build a brand new transaction because it wrongly assumed the old one failed.</p><p>Then finally you get to the bit everyone actually associates with “blockchain” broadcast, sits in the mempool for a bit, a validator picks it up, it lands in a block. And even then it’s not really done. Being in a block doesn’t mean it’s locked in forever, which is why exchanges make you wait for a handful of confirmations before they credit your account. Blocks can still get reorganized, rare but it happens.</p><p>And the last piece is just status pending, confirming, confirmed, or failed getting pushed to your screen somehow websockets<strong>.</strong></p><p>The thing I keep coming back to is that the blockchain is honestly just one piece of the puzzle. Most of the engineering and most of the things that can go wrong happen around it QR parsing, transaction construction, validation, idempotency, and status tracking.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f9848bb5578" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Built My First SaaS Product]]></title>
            <link>https://medium.com/@aymaanpathan5/how-i-built-my-first-saas-product-7d3cb781c822?source=rss-cca4d90f4f9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d3cb781c822</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Aymaan  pathan]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 07:25:27 GMT</pubDate>
            <atom:updated>2026-03-31T07:35:27.246Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vsgPzltlWNwVEoegHqEecQ.png" /></figure><h3>The Mess That Started It All</h3><p>I was working closely with a solar company. Smart people. Real customers. Growing fast.</p><p>And yet — complete operational chaos.</p><p>Leads were being tracked in someone’s head. Follow-ups happened when someone <em>remembered</em>. Documents were buried in WhatsApp threads. Quotations were being typed manually. Payments? Tracked on a spreadsheet nobody trusted.</p><p>There was no system. Just people trying to hold it together.</p><p>That’s when I stopped asking <em>“what should I build?”</em> and started asking — <strong>“what’s actually broken here?”</strong></p><h3>The Real Problem Wasn’t Software</h3><p>It wasn’t that they needed an app.</p><p>It was that <strong>their entire business ran on WhatsApp</strong> — and there was no structure underneath it.</p><p>The goal wasn’t to replace how they worked. It was to give it a backbone.</p><p>So I set out to build something that could:</p><ul><li>Turn WhatsApp conversations into structured business workflows</li><li>Catch every lead, payment, and document — automatically</li><li>Give the whole team complete visibility, in real time</li><li>Run quietly in the background without forcing anyone to change their habits</li></ul><h3>What I Actually Built — SolarChat Pro</h3><p>A CRM system built specifically for solar businesses. But not your typical CRM.</p><p><strong>A Kanban pipeline</strong> that moves leads from first contact to closed deal — with zero guesswork.</p><p><strong>A quotation engine</strong> that builds and sends pricing directly to customers over WhatsApp.</p><p><strong>A WhatsApp chatbot</strong> that does real CRM work — registration, quotations, payment collection — all inside a chat thread.</p><p><strong>Document management</strong> where customers upload files via WhatsApp, and they land automatically in the right customer profile.</p><p><strong>A payment workflow</strong> with proof uploads, account-role verification, and clear status visibility — pending, verified, done.</p><p><strong>A dealer and channel partner system</strong> with automatic commission tracking and repayment calculation.</p><p>And the most complex piece of all —</p><h3>The Subscription System That Humbled Me</h3><p>I thought payment integration would be straightforward. Razorpay has good docs. How hard could it be?</p><p>Very.</p><p>I wasn’t just processing payments. I was building a full subscription lifecycle:</p><ul><li>Plan upgrades and downgrades</li><li>Cancellations (immediate and end-of-cycle)</li><li>Reactivation for cancelled and halted accounts</li><li>Failed payment retries</li><li>Abandoned checkout recovery</li><li>Webhook race conditions and duplicate-prevention</li></ul><p>Every edge case I handled revealed two more. Users don’t follow happy paths. Networks fail. Webhooks fire twice. People close tabs mid-payment.</p><p><strong>Real systems have to survive all of that.</strong></p><h3>The Hardest Part Wasn’t Technical</h3><p>The hardest challenge wasn’t GraphQL or WebSockets or Razorpay edge cases.</p><p>It was <strong>thinking like a business owner, not a developer.</strong></p><p>Developers optimize for clean code. Business systems optimize for correctness, reliability, and real human behavior.</p><p>Those are very different goals.</p><h3>What I Walked Away With</h3><p><strong>Building real systems &gt; building isolated features.</strong> A feature works in isolation. A system works when everything goes wrong.</p><p><strong>Business problems are harder than technical problems.</strong> The code was the easy part. Understanding the workflow was the real work.</p><p><strong>Financial logic demands correctness over everything.</strong> You can ship a buggy UI. You cannot ship a buggy payment system.</p><p><strong>Handle failure first, success second.</strong> The happy path is 10% of your system. The edge cases are the other 90%.</p><h3>The Stack (For the Curious)</h3><p>React · Next.js · Redux · Tailwind · Node.js · Express · GraphQL · MongoDB · Redis · WebSockets · WhatsApp Business API · Razorpay · AWS S3</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d3cb781c822" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Vector Databases Make Sense in AI-Powered Medical Apps]]></title>
            <link>https://medium.com/@aymaanpathan5/how-vector-databases-make-sense-in-ai-powered-medical-apps-0d9111f7dd2a?source=rss-cca4d90f4f9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d9111f7dd2a</guid>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[vector-database]]></category>
            <dc:creator><![CDATA[Aymaan  pathan]]></dc:creator>
            <pubDate>Sat, 12 Jul 2025 17:43:43 GMT</pubDate>
            <atom:updated>2025-07-12T17:43:43.271Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rwzs-XP6fgKfK4HATkmLMw.png" /></figure><blockquote>While working on a <strong>medical chatbot</strong>, I ran into a problem. Users were typing different ways to describe the same symptom — like <em>“pain in the throat”</em> or <em>“my throat feels sore”</em> — but the system couldn’t match them unless they used the exact words we had in the database. That’s when I realized keyword search wasn’t enough — and started learning about <strong>semantic search</strong> and <strong>vector databases</strong>.</blockquote><p>Before jumping into vector databases, let’s first understand what semantic search actually means.</p><p>Imagine I’m chatting with a friend about our favorite colors. We’re naming colors like blue, red, and orange. Then my friend suddenly asks me:</p><p>👉 “What’s special about orange?”</p><p>I instantly know they’re talking about the <strong>color orange</strong> — not the fruit. That’s because I understand the <strong>context</strong> of our conversation.</p><p>This is exactly how <strong>semantic search</strong> works.</p><p>Instead of just matching exact keywords, it understands the <strong>meaning</strong> behind the query — just like a human would in a real conversation.</p><h3>Why Keyword Search Fails</h3><blockquote>Let’s say I search:<br> <strong>“Give me the cat with orange color, looking upwards.”</strong></blockquote><blockquote>In a traditional (keyword-based) database, this query would fail unless we’ve manually stored <strong>every possible attribute</strong> for every cat: color, posture, direction it’s facing, expression, etc.</blockquote><blockquote>And not just for cats — for <strong>everything</strong> a user might search.</blockquote><blockquote>To make keyword search work, we’d have to anticipate <strong>every possible way</strong> someone might describe something — and store all of that explicitly in the database.</blockquote><blockquote>That’s nearly impossible at scale.</blockquote><h3>How Semantic Search Works</h3><blockquote>Unlike keyword search — which looks for exact word matches — <strong>semantic search</strong> tries to understand the <strong>meaning</strong> behind the query.</blockquote><blockquote>It does this using something called <strong>embeddings</strong>.<br> Embeddings turn words, sentences, or even full documents into <strong>vectors</strong> (just a list of numbers). These numbers capture <strong>context</strong> and <strong>meaning</strong>, not just text.</blockquote><blockquote>For example, “sore throat” and “throat pain” might look different to a traditional database. But in vector space, their embeddings are <strong>very close</strong>, because they mean almost the same thing.</blockquote><blockquote>This allows the system to return relevant results — even if the exact words don’t match.</blockquote><p>### Visualizing Vector Space</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5gPfMRNs1HH3WdsksXTQIw.png" /></figure><h3>Now What Is a Vector Database?</h3><blockquote>Once you’ve turned your data (like “girl”, “cricket”, or “apple”) into <strong>embeddings</strong> — which are just high-dimensional vectors — you need a way to <strong>store</strong>, <strong>search</strong>, and <strong>compare</strong> them efficiently.</blockquote><blockquote>That’s where <strong>vector databases</strong> come in.</blockquote><blockquote>Unlike traditional databases that look for exact matches (like “WHERE name = ‘girl’”), a vector database can answer questions like:</blockquote><blockquote><em>“Find me things that are </em>similar<em> to this query.”</em></blockquote><blockquote>It uses something called <strong>vector similarity search</strong> — which measures <strong>how close</strong> the embeddings are in vector space.</blockquote><blockquote>In above image, similar items (like “Man”, “Boy”, “Girl”, “Woman”) are <strong>clustered together</strong> in the top-right corner.</blockquote><blockquote>Now imagine a user searches for:</blockquote><blockquote>“young human male”</blockquote><blockquote>Even if that <strong>exact phrase</strong> doesn’t exist in your data, the vector database can return “Boy” — because its <strong>embedding is close</strong> to that query’s embedding.</blockquote><h3>Popular Vector Databases:</h3><ul><li><strong>Pinecone</strong></li><li><strong>Weaviate</strong></li><li><strong>Qdrant</strong></li><li><strong>FAISS (by Facebook)</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d9111f7dd2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting End-to-End Language Model Chains from Prompts]]></title>
            <link>https://medium.com/@aymaanpathan5/architecting-end-to-end-language-model-chains-from-prompts-afbdc590819b?source=rss-cca4d90f4f9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/afbdc590819b</guid>
            <category><![CDATA[chaining]]></category>
            <category><![CDATA[optional-chaining]]></category>
            <dc:creator><![CDATA[Aymaan  pathan]]></dc:creator>
            <pubDate>Thu, 22 May 2025 07:47:54 GMT</pubDate>
            <atom:updated>2025-05-22T07:48:25.667Z</atom:updated>
            <content:encoded><![CDATA[<p>When most folks picture using a large language model (LLM) like GPT, they often think it’s as easy as typing in a prompt and getting an answer back. Straightforward, right? But it can also feel a bit… limiting.</p><p>In reality, tasks are rarely that simple. What if you need to pull specific data from a document, reformat it into a spreadsheet, run some calculations, and then summarize everything? A single prompt just won’t do the trick. That’s where chaining comes into play.</p><p>So, what exactly is chaining in LLMs? <br>Chaining is all about connecting multiple LLM calls together, where the output from one step feeds into the next. It’s like creating a workflow, with language models acting as your team members.</p><p>Instead of viewing the LLM as a mysterious black box, chaining transforms it into a series of logical, structured steps — each one tackling a part of a bigger task. Think of it like coding, but with each function driven by natural language and machine intelligence. This method makes LLMs genuinely useful in real-world applications. Let’s break it down.</p><p>Why is Chaining Important?<br>Picture this scenario: You’re an analyst who needs to:<br>- Go through hundreds of product reviews.<br>- Pull out key complaints and praises.<br>- Organize them by theme.<br>- Create an executive summary.</p><p>Could you tackle this with just one GPT prompt? Maybe, but the results might be hit or miss. Chaining lets you approach this in stages:<br>Step 1: Extract insights from the reviews.<br>Step 2: Sort them into themes.<br>Step 3: Summarize each theme.<br>Step 4: Put together a polished report.</p><p>Each step is clearer, more manageable, and can be debugged on its own — just like well-written code.</p><p>Key Elements of a Custom LLM Chain<br>When you’re crafting a language model chain, it’s crucial to design it like a well-thought-out architecture. It should be modular, flexible, and easy to understand. Here are the key components:<br>1. Prompt Templates<br>Prompt templates are structured, reusable prompts that can take dynamic inputs. Instead of hardcoding your prompts, you create templates like this:<br>Prompt: Summarize the following customer feedback in 2–3 bullet points:</p><pre>from langchain_core.prompts import ChatPromptTemplate<br>from model_utils import callModel<br>from langchain.schema.output_parser import StrOutputParser # to get direct content from ai anwser<br>from langchain.schema.runnable import RunnableBranch<br>currentModel = callModel()  <br># We make a conditional response based on user feed back on our product<br><br># 1. we need to create a classification Template to tell model that he is <br># assistant and identify if the user response is positive , negative or netural<br><br># 2. we create a function of if condtions if the above task if our model answer<br># lets says its a positive response we run positive chains<br><br><br><br><br><br>classification_template = ChatPromptTemplate.from_messages(<br>    [<br>    (&quot;system&quot;,&quot;you are an assistant&quot;),<br>    (&quot;human&quot;,&quot;classify the sentiment of this feedback as&quot;<br>    &quot;positive , negative or netural : {feedback}&quot;)<br>    ]<br>)<br><br>format_template = classification_template.invoke({<br>    &quot;feedback&quot;:&quot;product is not working so laggy and switched off after one use&quot;<br>})<br><br># Emotions Templates<br>positive_Template = ChatPromptTemplate.from_messages(<br>    [<br>    (&quot;system&quot;,&quot;you are an assistant&quot;),<br>    (&quot;human&quot;,&quot;Generate a thank You note for this feedback : {feedback}&quot;)<br>    ]<br>)<br><br>negative_Template = ChatPromptTemplate.from_messages(<br>    [<br>    (&quot;system&quot;,&quot;you are an assistant&quot;),<br>    (&quot;human&quot;,&quot;Give a trustfull feedback and solution of this feedback : {feedback}&quot;)<br>    ]<br>)<br><br><br>Netural_Template = ChatPromptTemplate.from_messages(<br>    [<br>    (&quot;system&quot;,&quot;you are an assistant&quot;),<br>    (&quot;human&quot;,&quot;Give a netural response for this feedback : {feedback}&quot;)<br>    ]<br>)<br><br><br><br>branches = RunnableBranch(<br>    (<br>        lambda x:&quot;positive&quot; in x,<br>        positive_Template | currentModel| StrOutputParser()<br>    ),<br>     (<br>        lambda x:&quot;negative&quot; in x,<br>        negative_Template | currentModel| StrOutputParser()<br>    ),<br><br>    (<br>        lambda x:&quot;netural&quot; in x,<br>        Netural_Template | currentModel| StrOutputParser()<br>    ),<br>     ChatPromptTemplate.from_template(&quot;Sorry, couldn&#39;t understand the sentiment: {feedback}&quot;)<br>            | currentModel | StrOutputParser()<br>    <br>)<br><br>classification_chain = classification_template | currentModel | StrOutputParser()<br>chain = classification_chain | branches<br><br><br>feedback = &quot;This is a product is very good&quot; <br>res = chain.invoke({<br>    &quot;feedback&quot;:feedback<br>})<br><br>print(res)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afbdc590819b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tokenization: The Pillar of NLP Models and Labeling]]></title>
            <link>https://medium.com/@aymaanpathan5/tokenization-the-pillar-of-nlp-models-and-labeling-59b02fe45c38?source=rss-cca4d90f4f9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/59b02fe45c38</guid>
            <dc:creator><![CDATA[Aymaan  pathan]]></dc:creator>
            <pubDate>Thu, 08 May 2025 07:59:29 GMT</pubDate>
            <atom:updated>2025-05-08T12:08:58.035Z</atom:updated>
            <content:encoded><![CDATA[<p>Tokenization is a basic Natural Language Processing (NLP) and machine learning process that entails splitting text into smaller segments known as tokens. Tokens can be words, characters, and are used as the elementary building blocks for most NLP tasks.</p><p>Tokenization refers to the act of transforming a string of text into smaller units, referred to as tokens. Tokens may be as tiny as characters or as big as words. The major reason why this process is significant is that it enables machines to comprehend human language by dividing it into manageable bits, which are simpler to examine.</p><p>For example, given the sentence: <em>“Tokenization helps NLP process text more easily.”</em></p><ul><li>If we apply word tokenization, the result might be: [“I’m”, “a”, “software”, “developer”]</li><li>If we use character-based tokenization, the result would be: [“I”, “‘“, “m”, “ “, “a”, “ “, “s”, “o”, “f”, “t”, “w”, “a”, “r”, “e”, “ “, “d”, “e”, “v”, “e”, “l”, “o”, “p”, “e”, “r”]</li></ul><h3>The Real Question: Why Do We Need Tokenization?</h3><p>Machines don’t understand human languages like English, Hindi, or any other language. They only understand <strong>numbers — specifically binary data like 0s and 1s</strong>.</p><p>That’s where <strong>tokenization</strong> comes in.</p><p>Tokenization is the process of <strong>breaking text into smaller pieces (called tokens)</strong>, and then converting those tokens into <strong>numerical representations</strong>. This transformation is essential because it allows NLP models to process and “understand” our language in a mathematical way.</p><p>Imagine you say, <em>“I’m a software developer.”</em> The model will:</p><ol><li><strong>Split the sentence into tokens</strong> — like words or subwords.</li><li><strong>Assign a unique numerical ID to each token</strong> — for example, &quot;software&quot; might become 20156.</li><li><strong>Use those token IDs to analyze, predict, or generate text</strong>.</li></ol><p>What If the Machine Can’t Find a Matched Token?</p><p>Let’s say the sentence is:</p><blockquote><strong><em>“Elon just made Grok.”</em></strong></blockquote><p>Now imagine this is passed into an NLP model. Here’s what happens step-by-step:</p><h4>Step 1: Tokenization</h4><ul><li><strong>Word-level Tokenization</strong>: [“Elon”, “just”, “made”, “Grok”, “.”]</li></ul><h4>Step 2: Vocabulary Lookup</h4><p>The model now checks its <strong>pre-trained vocabulary</strong> to assign token IDs.<br> It probably knows words like:</p><ul><li>&quot;Elon&quot; → token ID 3124</li><li>&quot;just&quot; → token ID 105</li><li>&quot;made&quot; → token ID 672</li></ul><p>But what about <strong>“Grok”</strong>?</p><h4>Step 3: What If “Grok” Is Not in the Vocabulary?</h4><p>If the model has <strong>never seen “Grok”</strong>, and it’s not in the vocabulary, here’s what might happen:</p><p>If using Sub word<strong> Tokenization</strong> (like in BERT or GPT):</p><p>It will <strong>break “Grok” into parts it knows</strong>.</p><blockquote><em>&quot;Grok&quot; → </em><em>&quot;Gr&quot;, </em><em>&quot;##ok&quot;<br> Or maybe even → </em><em>&quot;G&quot;, </em><em>&quot;##ro&quot;, </em><em>&quot;##k&quot;</em></blockquote><p>This way, the model can <strong>guess the meaning</strong> from familiar pieces.</p><p>If using basic <strong>word tokenization</strong>:</p><p>The word might become [UNK] (Unknown token).<br> So the sentence would be:</p><blockquote><em>[&quot;Elon&quot;, &quot;just&quot;, &quot;made&quot;, &quot;[UNK]&quot;, &quot;.&quot;]</em></blockquote><h3>How Can the Model Still Learn What “Grok” Means?</h3><p>Even if it’s a new word, the model can:</p><ol><li><strong>Look at context</strong>:</li></ol><ul><li>“Elon just made Grok” → Grok might be a product, tool, or company.</li></ul><ol><li><strong>Use sub words to guess</strong>:<br> If it sees patterns like ##ok used in tech names, it can infer that Grok is probably a noun.</li><li><strong>Learn over time</strong>:<br> If “Grok” shows up more in its training or fine-tuning data (like on Twitter or news), it’ll learn to associate it with related terms like “AI”, “X”, “Elon”, or “chatbot”.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59b02fe45c38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I recently started learning about Few-Shot Prompting, a technique that lets you guide a pretrained…]]></title>
            <link>https://medium.com/@aymaanpathan5/i-recently-started-learning-about-few-shot-prompting-a-technique-that-lets-you-guide-a-pretrained-808875aff754?source=rss-cca4d90f4f9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/808875aff754</guid>
            <dc:creator><![CDATA[Aymaan  pathan]]></dc:creator>
            <pubDate>Wed, 07 May 2025 14:58:09 GMT</pubDate>
            <atom:updated>2025-05-07T15:07:42.130Z</atom:updated>
            <content:encoded><![CDATA[<h3>I recently started learning about <strong>Few-Shot Prompting</strong>, a technique that lets you guide a pretrained language model (like GPT) by simply giving it a few examples in the prompt. No fine-tuning or retraining needed.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*rFPLpXN0IiUiMdvKa59h1g.png" /></figure><p>I just learn about <strong>few-shot prompting </strong>and it’s quite interesting that we can just “teach” a model to respond in specific ways just by showing it a pattern. For example, you can even inject a custom tone by giving just a few sample question-answer pairs.</p><p>This is what makes <strong>few-shot prompting</strong> such a powerful tool: it’s all about <strong>teaching</strong> the model without retraining it. You don’t need to spend hours coding or collecting massive datasets; instead, you simply provide a small number of examples that the model can use as a <strong>template</strong>. The model then applies that template to new questions, adjusting its responses based on the cues you’ve given it.</p><h4>🧪 Example</h4><p>Let’s say we provide the following Q&amp;A example to the model:</p><p><strong>Q:</strong> What is gravity?<br> <strong>A:</strong> Gravity is a force that attracts a body toward the center of the Earth or any other physical body having mass.</p><p>Now, if the user asks a similar question like “Can you explain gravity to me?”, the model will look at the example we provided and respond in the same style or format, essentially mimicking what we taught it.</p><p>It’s like giving the model a short “memory” of how to behave, without any code or training — just the <strong>right words</strong> in the <strong>right order</strong>.</p><h3>Why Does This Matter?</h3><p>What’s particularly powerful about few-shot prompting is the <strong>level of control</strong> you can have over the model’s behavior. By simply providing a few examples, you can:</p><ul><li><strong>Set the tone</strong>: Want the model to sound formal? Casual? Sarcastic? It’s all about choosing the right examples.</li><li><strong>Steer the format</strong>: If you want the model to respond in a list, paragraph, or step-by-step, just provide a few responses in that format.</li><li><strong>Influence the scope of responses</strong>: You can even limit or expand the model’s answers by giving it more or fewer examples of what you want. For example, one answer might be very detailed, while another is brief.</li></ul><p>Few-shot prompting is like <strong>programming with words</strong> — you’re not teaching the model through code or vast datasets but simply through examples of how you want it to behave. This makes AI more accessible and flexible, allowing you to easily guide responses without complex configurations or deep technical skills.</p><p>It’s a perfect example of how <strong>AI and human creativity</strong> can come together to build smarter, more interactive systems, one example at a time.</p><p>If you’re interested in diving deeper into this technique, there are plenty of advanced strategies to explore, such as <strong>zero-shot</strong> and <strong>multi-step prompting</strong>, that take the concept even further. But for now, experimenting with few-shot prompting is a great starting point for unlocking the power of AI in ways that are practical, intuitive, and creative.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=808875aff754" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>