<?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 Mukesh Vast on Medium]]></title>
        <description><![CDATA[Stories by Mukesh Vast on Medium]]></description>
        <link>https://medium.com/@mukesh.vast?source=rss-469281ebde2e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*F--G-Uuzy7qsnssvJfdSug.jpeg</url>
            <title>Stories by Mukesh Vast on Medium</title>
            <link>https://medium.com/@mukesh.vast?source=rss-469281ebde2e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 00:06:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mukesh.vast/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[Inside Our Autonomous Software Factory: How AI Agents Write, Test and Ship Our Code]]></title>
            <link>https://pub.towardsai.net/inside-our-autonomous-software-factory-how-ai-agents-write-test-and-ship-our-code-5261ae0d38a2?source=rss-469281ebde2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5261ae0d38a2</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[agentic-software-factory]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Mukesh Vast]]></dc:creator>
            <pubDate>Thu, 26 Nov 2026 16:01:03 GMT</pubDate>
            <atom:updated>2026-11-26T16:01:03.938Z</atom:updated>
            <content:encoded><![CDATA[<p>You hand it a few feature requests. Minutes later it hands back a pull request that has been planned, tested, reviewed and tried out by an agent playing your customer.</p><blockquote><strong><em>What we learned running AI agents as an assembly line, told through one small made-up example: a loyalty card for a coffee chain.</em></strong></blockquote><p>For two months, a team of AI agents has built the features of our in-house product. They work like a production line: each agent has one job, and its work gets checked before the next one starts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ciFvUyh4R4aJVGcSmFv0TQ.png" /></figure><p>Our first version cost more to build than the product it shipped. The second one works, and it rests on one rule:</p><h3><strong>Code decides what runs next. Agents only judge.</strong></h3><p>A small Python program called fx keeps each batch&#39;s state in files, picks the next agent and refuses any hand-back that breaks a rule. Agents read, plan, code and review, but none of them can move a batch forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*iYUSIGsgLXm9ORmXtNmbBQ.png" /><figcaption>The whole line on one screen. A person works at only two stations, the brief and the ship. Everything else runs in the background, watched by fx.</figcaption></figure><h4>The example</h4><h3>Three small wishes for a coffee chain</h3><p>Picture Brewline, a loyalty app for a coffee chain with three outlets. The owner wants three things, each written as a short story with numbered acceptance criteria.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*jvfKlGbJBmwOQe_lYHHChQ.png" /></figure><p>Hidden in it are a money question (is a free coffee any size?), a time-zone trap (when does a birthday start?) and a privacy hole (can outlet A see outlet B’s customers?). Watch where each gets caught.</p><h4>The team</h4><h3>Who works on the line</h3><p>Sixteen roles work the line. Some are agents on a strong model, some on a cheaper one, and some are plain code that never makes a judgment call.</p><h4>Plan</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*Wig2RFHiTv-obVL0AnyVNg.png" /><figcaption>The crew. Amber is you: once in planning, once at the end. Every other role gets a narrow job and hands back JSON that fx checks before anything else happens.</figcaption></figure><h4>Step 1 · Planning</h4><h3>What do robot planners argue about?</h3><p>One command starts it: /factory new loyalty S1 S2 S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*aCXgjaHPvEJsb4_BP7tMnQ.png" /><figcaption>Planning the loyalty batch. Two problems get caught here, before anyone writes a line of feature code.</figcaption></figure><p>A cheap reader per story lists every spot where a builder would have to guess. The birthday reader asks: with servers on UTC, does a customer in Mumbai get the pastry at midnight or at 5:30 in the morning?</p><p>S1 and S2 both touch RewardService, so fx builds them as one group. Planners read the code and outline a test for every criterion. The product lead never reads code, on purpose, because an agent that reads code tends to accept whatever it already does. It settles three questions from the spec and sends the two about money to a person.</p><p>The critic tries to break each plan, with evidence. It finds that a refunded coffee keeps its stamp and that baristas would see all three outlets, both fixed before any test exists. Then the tests are written and run on today’s code. Each must fail, because a test that passes before the feature exists proves nothing.</p><h4>Step 2 · The only meeting</h4><h3>Two questions, one reply, six minutes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*rmgOubYWyn19MDK8kfj2Cg.png" /><figcaption>Five questions come in and two reach the owner. The brief fits on one page and can be answered from a phone. Here the owner takes the recommendation on size and overrides it on the birthday window.</figcaption></figure><p>On approval, fx locks the nine tests, moves the Jira tickets and writes each answer back into the story file, so the spec stays the one source of truth. Anything that isn&#39;t money, rules, access or a surprise gets a default the owner can overturn.</p><h4>Step 3 · Build</h4><h3>Round after round, until nothing is left to find</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*Du0MrRmF57oMOdwCwRX1Wg.png" /><figcaption>The build loop. Reviewers only look at code whose checks pass, and every way out of the loop leads either to “ready” or to a person</figcaption></figure><p>Each story gets a fresh builder, and risk picks its model: the birthday story gives away food, so it gets the stronger one. Gates check every commit the moment a builder says “done”. If a locked test was changed, or a test deleted or skipped, the work goes straight back to the same builder while it still remembers why.</p><p>Reviewers only see code whose checks pass, and later rounds re-read only what changed. A reviewer can record anything, but to block it must bring proof that fx can verify:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*teZHcsMOsQ4j9QwniPHEUQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*PeKT67Lpk6gwORwEntrDng.png" /><figcaption>The loyalty batch, round by round. Group 1 needed three rounds and group 2 needed one. They ran at the same time, each in its own copy of the code.</figcaption></figure><h3>The reviewer that orders the coffee</h3><p>In round 2 every test passed and the code looked fine. One reviewer still failed it, because it doesn’t read code. fx starts a throwaway copy of the app in Docker, and an agent signs in as each persona and works through the criteria the way they would. It buys ten coffees. It asks for another outlet&#39;s numbers. Anything short of a pass blocks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*dWGcxvLGpA7HYkun5GaLcQ.png" /><figcaption>Everything that reads code said yes. The server even sent the reward, but the screen had no way to show it, so the customer saw an error. Only an agent using the app could catch that.</figcaption></figure><blockquote><strong>This part is real. In our first real batch, the live check found the only two real bugs, and no test or code reviewer had caught either. That’s why it now runs in every round.</strong></blockquote><h4>Step 4 · Ship and learn</h4><h3>One yes, then three lessons at most</h3><p>fx ship merges in the latest main branch, reruns every check and writes the pull request: each criterion with its test and result, plus what got fixed and what&#39;s still open. The owner confirms once, and the factory never merges its own work. All of its state lives in files, so a crashed session or a closed laptop just means typing /factory next later.</p><p>Afterwards a lessons agent proposes three lessons at most, like “a birthday is a local date, so test 00:30 and 23:30 India time.” The owner keeps the good ones, and the next batch reads them.</p><h4>Brains and tokens</h4><h3>Who gets the expensive brain?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*twVHO4U422p56imVBQ2q6g.png" /><figcaption>Each role’s model is a line in a config file. A round that fails on the cheaper model moves the next round up to the stronger one.</figcaption></figure><p>Two things surprised us. A cheaper model saves only 17 to 40 percent, because most of what an agent reads comes from the cache, which costs about the same on both. And the biggest waste is reading the same thing twice, so nearly every saving came from agents reading less.</p><h4>TOKENS</h4><h3>Where do the tokens go?</h3><p>Every agent run is logged with its tokens and tied to the group, story and round it worked on. We show tokens rather than dollars, so you can price them at whatever rate you pay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*S_BRTmhsl_moZc2b43V0tA.png" /><figcaption>Where the tokens went in our biggest batch. Builders use the most, and the session that steers everything comes second. That second line is the one we most want to shrink.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*F94hrpBWvQJLjDAr13VDbQ.png" /><figcaption>Four real batches, in the order they ran, counting the agents only; the steering session comes on top. The 3-story batch ran long because one criterion depended on a story nobody had linked, and it failed the live check the same way for six rounds. A circuit breaker now stops that after two.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*qjqOX4Yuz2tQIb9_4LauKg.png" /></figure><h4>Lessons</h4><h3>What we’d tell anyone building one</h3><ul><li>The factory can cost more than the product. Our first engine grew to 19,000 lines and cost about five times the product work it shipped. The second has a line limit a test enforces.</li><li>Make reviewers prove it. An agent that double-checked every block overturned 0 of 16, so we deleted it. Now a block needs proof the engine can check.</li><li>Use the product, don’t just read it. The agent that taps through the running app caught what tests and code reviewers missed.</li><li>The conductor is the hidden bill. The session that steers everything still takes 18 to 41 percent of each batch, against our 15 percent target.</li><li>Count tokens, not dollars. On a flat subscription, one more batch costs no extra cash. Tokens show the work, and the real limit is the plan’s usage cap.</li><li>The product got better, not just faster. Every criterion has a test that failed before the code and passes after, and bugs get caught in the running app before the merge.</li></ul><p>None of this replaces engineering judgment. It moves that judgment to the two moments that matter most: writing the spec before the work starts, and saying yes before it ships. Everything in between is a line we can measure, and we keep making it cheaper.</p><h3>If you like this topic :</h3><ol><li><strong>Clap</strong> this article 10+ times; that will really help the article reach more readers 👏</li><li>Follow me on <a href="https://medium.com/@mukesh.vast"><strong>Medium</strong></a> and/or <a href="http://linkedin.com/in/mukeshvast"><strong>LinkedIn</strong></a> and subscribe to get my latest article for Free🫶</li><li>Feel free to connect or drop a comment about the article !</li></ol><h3>Stay tuned for more Tech explorations!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5261ae0d38a2" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/inside-our-autonomous-software-factory-how-ai-agents-write-test-and-ship-our-code-5261ae0d38a2">Inside Our Autonomous Software Factory: How AI Agents Write, Test and Ship Our Code</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I spent a lot of money on my demo $$$]]></title>
            <link>https://blog.devops.dev/i-spent-a-lot-of-money-on-my-demo-e2ebb38d6c2c?source=rss-469281ebde2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2ebb38d6c2c</guid>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[cloud-cost-optimization]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-finops]]></category>
            <dc:creator><![CDATA[Mukesh Vast]]></dc:creator>
            <pubDate>Sat, 15 Aug 2026 20:36:01 GMT</pubDate>
            <atom:updated>2026-08-15T20:36:01.686Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Does this bother you too ?</em></p><p>A prospect asked me, halfway through a call, “<strong><em>can I try this myself later tonight?</em></strong>”<br>Instantly i responded — “yes, offcourse, in some time”.</p><p>It was a mvp1 version of a simple accounting system. How difficult it would be. The prototypes, logic, code, architecture were already there.Just a simple build on a platform and send over. Simple build grew into complex analysis after realising the cost it incurred on my bills.</p><h3>First, though: which demo?</h3><p>In todays vibe world, the clickable prototype for a client with rich UX and modern features is kind-of extremely easy these days. I have myself used Lovable, Claude.design and v0 by Vercel (earlier called v0.dev) for cool looking screens in one afternoon.That wows the client first time round.</p><p>However a live demo is where client expects to see his workflows in a live environment end to end, with some real data (mocked or redacted is fine) that is persisted between his demo runs. Including the authorization and his set business logic.</p><p>Two things get called the same word and only one is hard. If you need a clickable prototype to show someone the idea, that problem is solved: Lovable, v0, Bolt and the rest will get you a convincing screen in an afternoon. The hard one is what comes after, where the buyer signs in as themselves, runs their own workflow end to end, and the numbers on the last screen are right because a real backend computed them. Live authentication, business rules that actually fire, a database that remembers what they did last week. <strong>None of that can be mocked, and it has to run somewhere permanent</strong>.</p><h3>So why not just use what production uses?</h3><p>Thats the safest and most accepted answer, you will get from many a seasoned architects. Production will have definitely scoped out your defined enterprise patterns and infrastructure layouts.Common instinct is use the same and its not wrong either. Some of the defensive responses for the argument, you will get is — “we can debug production defects in demo environment as the deployment stack is same”.</p><blockquote>*Corporates dont have much of a spend restrictions. Infact they build for atleast 4 known environments — DEV (development), UAT (User Acceptance Testing , PRE-PROD (Pre production) and PROD (Production).</blockquote><blockquote><strong>But the challenges there are different. </strong>May be i will capture them in future article.Comment in post, if you would like to hear about it.</blockquote><p><strong>My instinct was right. The scope I applied it to was wrong</strong>, and the bill is where I noticed.</p><p>Our production target is AWS: managed containers, managed Postgres, a managed cache, behind a load balancer. For production that is correct. As a demo it is slow to stand up and expensive to leave running.</p><p>Slow, because six services live means a VPC, subnets, security groups, task definitions, IAM policies and enough infrastructure-as-code to hold it together. Days of work before anyone sees a login screen.</p><p>Expensive, because so little of it switches off. An Application Load Balancer costs <strong>roughly $18 a month</strong>. Add a NAT Gateway and CloudWatch logs and you are near <strong>$90 a month per environment</strong> in fixed costs alone, with compute and the database still to come. Call it <strong>$200 to $300</strong> each.</p><h3>Why not just Terraform it?</h3><p>Terraform is best in building Infrastructure code that is repeatable.Once infra code/configuration and templates are built, its easy to spin up and spin down the entire infrastructure.</p><p>But it cannot optimize cost for a terraform core(say a $18 Load Balancer) and a provider (say AWS) once added to the code.</p><p><em>So I went and priced the alternatives properly.</em></p><h3>What the five options actually cost</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5265c1e68f792fc950a834c877f8277a/href">https://medium.com/media/5265c1e68f792fc950a834c877f8277a/href</a></iframe><p>One direction you will notice in the above table is that the cheapest solutions to run are the most expensive to build. The build cost adds when you have to take platforms job.</p><blockquote><em>“</em><strong>Light Switch</strong><em>” is an architectural design concept where the infrastructure shuts downs or boots up at a scheduled time.</em></blockquote><p>Common sense to build one, but every solution will have its variations.VPS will depend on cron job and scripts, AWS provides LightSwitch patterns. Thats build cost.</p><p>Another factor to consider is the Idle time when no clients are testing even in the Light switch On period.For me, its 95% of the time. Demo is hit for 40 minutes during a call, then goes quiet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*dYSGfZ3GL1VNuO2axKi4Nw.png" /></figure><blockquote><strong><em>Disclaimer</em></strong><em> — Not at all inferring to — Cheap is bad or good. </em><strong><em>Its not a ranking of which platforms are better.</em></strong><em> Thousands of applications are running on all the solutions above. Requirements( non functional) defer, hence the choice.</em></blockquote><h3>The question I should have asked first</h3><p><strong>“</strong>how many environment do I need other than Production?<strong>”</strong></p><p><strong>Answer — Demo environment </strong>where i can do live client demoes that costs as little as possible, as fast as possible<strong>. </strong><em>Nobody has ever asked whether my demo is Multi-AZ.</em></p><p>Differentiator — Data that feels real but actually is generated(synthetic or dummy) data.</p><p>Here is the shape, using a small online store rather than my actual product:</p><pre># storefront — one app, two very different tiers.<br># Only the injected values change per platform.<br><br>app:<br>  services: [shopfront, orders-api, stock-sync, postgres]<br>  contract:                 # the whole portability surface<br>    DATABASE_URL:<br>    DATABASE_USER:<br>    DATABASE_PASSWORD:<br>    PORT:                   # assigned by the platform, never hardcoded<br><br>tiers:<br>  demo:<br>    optimise_for: TIME_TO_URL<br>    platform:     managed-paas<br>    data_class:   SYNTHETIC_ONLY   # the thing I gave up, written down<br>    dataset:      seeded_on_boot   # 3 fake shops, 200 fake orders<br><br>  production:<br>    optimise_for: DURABILITY<br>    platform:     big-cloud<br>    data_class:   REAL<br>    extras:       [point_in_time_restore, multi_az]<br><br>rule: |<br>  A tier may only hold data of the class it declares.<br>  Enforced at boot, not in a wiki: if data_class is SYNTHETIC_ONLY and<br>  the dataset is not the seeded one, the service refuses to start.</pre><blockquote><strong>Data switch is now configurable.</strong></blockquote><p>4 injected values, platform agnostic. 2 tiers can run in different places from one codebase.</p><p><em>None of it was free.</em> My deploy config now lives in a dashboard instead of git, the builder cannot mount build secrets, and the managed Postgres does not run init scripts, which cost me an evening and a stale migration history. I traded reproducibility for speed for this tier.</p><h3>Where it leaves me</h3><p>Demo platform that costs me <strong>$30 to $45 a month</strong> to keep warm. What made that possible was dropping parity as a goal and writing down, in a place the code can check, what each environment is allowed to hold.</p><p>If you run a hosted demo for a B2B product, I would like to know what you gave up for it, and whether that trade has ever been tested by someone on a sales call asking for “just this once”.</p><p><em>Prices checked in August 2026 against published pricing. Treat the monthly figures as sizing, not quotes.</em></p><h3>If you like this topic :</h3><ol><li>Follow me on <a href="https://medium.com/@mukesh.vast"><strong>Medium</strong></a> and/or <a href="http://linkedin.com/in/mukeshvast"><strong>LinkedIn</strong></a> and subscribe to get my latest article for Free🫶</li><li>Feel free to connect or drop a comment !</li></ol><h3>Stay tuned for more Tech explorations!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2ebb38d6c2c" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/i-spent-a-lot-of-money-on-my-demo-e2ebb38d6c2c">I spent a lot of money on my demo $$$</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In a familiar room your nature shows. In a professional room your preparation does.]]></title>
            <link>https://medium.com/@mukesh.vast/in-a-familiar-room-your-nature-shows-in-a-professional-room-your-preparation-does-25dcd3b285a7?source=rss-469281ebde2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/25dcd3b285a7</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[professional-development]]></category>
            <category><![CDATA[introversion]]></category>
            <dc:creator><![CDATA[Mukesh Vast]]></dc:creator>
            <pubDate>Fri, 05 Jun 2026 20:14:57 GMT</pubDate>
            <atom:updated>2026-06-05T20:14:57.169Z</atom:updated>
            <content:encoded><![CDATA[<p>Professional presence has nothing to do with being loud or quiet.</p><p>Picture two colleagues in a meeting — equally capable, equally respected. One is naturally outgoing and speaks with ease. The other is reserved by nature and would rather stay quiet.</p><p>You’d expect the room to revolve around the outgoing one. It doesn’t.</p><p>The reserved colleague had prepared. At the right moment, she made one clear, well-aimed point — the kind that shifts a decision. She didn’t out-talk anyone, didn’t pretend to be someone she’s not, didn’t suddenly turn loud. She simply chose to be present, on her own terms.</p><p>That’s the whole idea. Professional presence has nothing to do with being loud or quiet.</p><p>Outside work, most of us default to introversion — we sidestep rooms we don’t know and opportunities that don’t touch us directly. Our true nature only surfaces where we feel safe.</p><p>A professional setting gives you no such luxury. Stay invisible and it doesn’t read as depth or modesty — it reads as a gap. That’s not a verdict on your intelligence or your effort. Plenty of brilliant, hardworking people simply never get seen.</p><p>So in a professional setting, even the most reserved person eventually has to become a <strong><em>silent extrovert</em> </strong>— not louder, not someone they’re not, just deliberately visible. Presence is a learned act. You build it offline and cast it in the room as influence — bit by bit, one clear contribution at a time. It’s a skill, not a trait. Everyone has to learn it, whether they like it or not.</p><p><strong>So how do you prepare?</strong></p><ul><li><strong>Know the agenda before the room does.</strong> Read the doc, the deck, the numbers. Walk in already holding a view.</li><li><strong>Pre-write your one point.</strong> Decide the single thing you want to say and say it in one clean sentence. Rehearse it.</li><li><strong>Anticipate the pushback.</strong> Guess the two questions you’ll get and have your answer ready.</li><li><strong>Pick your moment, don’t wait for it.</strong> Presence isn’t talking the most — it’s landing once, at the right time.</li></ul><p>You don’t have to become an extrovert. You have to become a silent one — and decide to be seen.</p><blockquote><em>Professional presence is not defined by being an introvert or extrovert. It’s not a choice. Success is defined by the deliberate degree of influence you choose to cast — by the strategic preparation you take offline.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rMt8WVVmEu_ahunxFzfW9Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25dcd3b285a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI agents are here. But how far have they really come?]]></title>
            <link>https://medium.com/@mukesh.vast/ai-agents-are-here-but-how-far-have-they-really-come-805d00ad34a8?source=rss-469281ebde2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/805d00ad34a8</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-revolution]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-evolution]]></category>
            <category><![CDATA[ai-transformation]]></category>
            <dc:creator><![CDATA[Mukesh Vast]]></dc:creator>
            <pubDate>Thu, 12 Feb 2026 03:35:53 GMT</pubDate>
            <atom:updated>2026-02-12T03:35:53.090Z</atom:updated>
            <content:encoded><![CDATA[<p>A short reflection from a very real, very imperfect execution.</p><p>Watching an AI agent attempt a simple Canva design is revealing. Not dramatic — just honest. The task itself was straightforward: create a 4:5 poster, place text on the left, an AI visual on the right and keep the background subtle. Yet the execution told a deeper story about where AI agents truly stand today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*JKplVO4XDUp8aj2onFnJ4g.png" /></figure><h3>1) Errors &amp; Statistics — What actually happened</h3><p>The agent didn’t fail spectacularly; it <strong>struggled gradually</strong>.</p><ul><li><strong>7</strong>+ <strong>iterations</strong> well over ~<strong>60</strong> <strong>minutes</strong>.</li><li><strong>Dozens of UI actions</strong> were performed, likely <strong>100+ interactions</strong> including clicks, drags, deletions and retries.</li><li><strong>Multiple search attempts</strong> for backgrounds, AI visuals and layout fixes.</li><li><strong>Repeated text edits and repositioning</strong>, sometimes undoing prior progress.</li><li><strong>Accidental deletions and layer confusion</strong>, forcing corrective actions.</li></ul><p>None of these errors were catastrophic.<br>But together, they created <strong>friction, delay and inefficiency</strong> — the quiet reality behind many AI workflows today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*0EMTgrfl5C9pcuRb--hY9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*RA38DW2QXvRvjKP6zv0mXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*SzO5k5b2uvbq1otcRsaE6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*OZPdlRqvq3E-PY4Yub2g3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*Zgth24_S_gl5GDIsDMOwxQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*W-zqu27-dyRLI_TJbzBBmw.png" /></figure><h3>2) Likely Causes — Why the delay and misattempts occurred</h3><p>The root causes weren’t intelligence limits alone. They could be process limits, prompting limits, tool limits. I am not here to defend or attack</p><p>In short, the delay wasn’t because the task was hard. It was because <strong>execution lacked deterministic structure</strong> — something humans often apply subconsciously.</p><h3>3) Learning Across Retries — What improved over time</h3><p>Despite the friction, something important happened: <strong>adaptation</strong>.</p><ul><li>Search queries became <strong>more precise</strong> (from generic robots to vertical cut-out AI agents).</li><li>The agent eventually recognized <strong>layer management as the core issue</strong>.</li><li>Errors shifted from <strong>random mistakes → targeted corrections</strong>.</li><li>When Canva execution stalled, it <strong>pivoted to an alternate generation path</strong> to still deliver an output.</li></ul><p>The progress wasn’t smooth, but it was <strong>directional</strong>.<br> And that direction matters more than perfection.</p><h3>Food for thought</h3><p>So, are AI agents overhyped?</p><p>Not exactly.<br>But they are <strong>earlier in their operational maturity than headlines suggest</strong>.<br>They can reason, adapt and eventually deliver — yet still stumble on the mundane details where real work lives.</p><p>And this pattern feels familiar.</p><p>Remember the early <strong>Will Smith AI videos</strong>?<br>At first, they were laughably distorted — faces melting, motion unnatural.<br>Today, the same idea looks <strong>nearly cinematic</strong>.<br>Not because the concept changed, but because <strong>iteration happened faster than skepticism expected</strong>.</p><h3>If you like this topic :</h3><ol><li><strong>Clap</strong> my article 10+ times; that will help reach this article further .👏</li><li>Follow me on <a href="https://medium.com/@mukesh.vast"><strong>Medium</strong></a> and/or <a href="http://linkedin.com/in/mukeshvast"><strong>LinkedIn</strong></a> and subscribe to get my latest article for Free🫶</li><li>Feel free to connect or drop a comment!</li></ol><h3>Stay tuned for more AI explorations!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=805d00ad34a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Enterprise-Grade Security with Supabase: A Notes App That Teaches Real IAM]]></title>
            <link>https://levelup.gitconnected.com/building-enterprise-grade-security-with-supabase-a-notes-app-that-teaches-real-iam-cb22479a4e20?source=rss-469281ebde2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb22479a4e20</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[supabase]]></category>
            <dc:creator><![CDATA[Mukesh Vast]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 15:48:08 GMT</pubDate>
            <atom:updated>2026-02-05T05:19:41.891Z</atom:updated>
            <content:encoded><![CDATA[<p>A deep, practical walkthrough of Supabase Auth, JWTs and RLS — <strong>done right</strong> — full source code.</p><p>This article is <strong>not</strong> about building a Notes app.</p><p>It’s about understanding how <strong>real systems stay secure</strong> — even when they grow, split into services, or need to integrate enterprise identity providers later.</p><p>If you haven’t read my previous article,<br> <strong>“</strong><a href="https://medium.com/gitconnected/supabase-as-an-enterprise-identity-platform-if-you-architect-it-right-6b8ebadd95d6"><strong>Supabase as an Enterprise Identity Platform — If You Architect It Right</strong></a><strong>”</strong>, I strongly recommend starting there.</p><p>That article focused on <em>principles</em>.</p><p>This one is about <em>practice</em>. With full source code to refer to examples.</p><p>We’ll take those principles and apply them end-to-end using a working Notes application — not because Notes are interesting, but because <strong>security mistakes show up fastest in simple apps</strong>.</p><p><strong>If you don’t have Medium account</strong>, read full article free on <strong>Substack</strong> <a href="https://open.substack.com/pub/mukizone/p/building-enterprise-grade-security"><strong><em>here</em></strong></a>. (no login needed)</p><p><strong>What you will learn:</strong></p><ul><li>Why the auth API is the central piece and the only service that talks to Supabase</li><li>How the app JWT flow works (issuance, cookies, verification via JWKS)</li><li>How HTTP-only cookies and CORS/CSRF are used for security</li><li>How notes services verify JWTs locally without calling the auth server on every request</li><li>How API-level authorization (roles and permissions) works in both Node and Java</li><li>How RLS policies enforce who can read or update which rows, with a detailed example in the notes app</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6_rPymWoDGQHFMSvaGV9wg.png" /><figcaption>AI Generated</figcaption></figure><h3>1. Repository and High-Level Architecture</h3><p>The repo is organized as follows:</p><pre>supabase-notes-app/<br>├── backend/<br>│   ├── notes-auth-api/        # Auth API (Supabase facade + JWT issuer)<br>│   ├── notes-java-service/    # Spring Boot Notes API (optional)<br>│   └── notes-node-service/    # Node.js Notes API (optional)<br>└── frontend/<br>    └── notes-ui/              # Next.js UI</pre><p>Only <strong>one</strong> notes service (Java or Node) runs at a time. The UI talks to the auth API for login/signup/session and to the notes API for CRUD. The notes API never talks to Supabase; it only verifies JWTs and talks to Postgres.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*6HqywRPxiIs7-r8NJJHCEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*L3lx08tjTU9gMf5XBpYj3A.png" /></figure><p>👉 <strong><em>Curious to see the code? Check out the </em></strong><a href="https://github.com/mukizone/supabase-notes-app"><strong><em>GitHub repo</em></strong></a><strong><em>.<br></em></strong>Recommend readers to understand the concepts below to sail through code easily.</p><h3>2. Why the Auth API Is the Central Piece</h3><p><strong>Single Supabase boundary.</strong> Only the auth API has SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY. The UI and the notes services never see these. All Supabase Auth and (for roles) PostgREST calls live in one place.</p><p>The auth API checks for these env vars at startup and uses them for every Supabase call:</p><pre>const SUPABASE_URL = process.env.SUPABASE_URL;<br>const SUPABASE_SERVICE_ROLE_KEY = process.env.SUPABASE_SERVICE_ROLE_KEY;<br><br>if (!SUPABASE_URL || !SUPABASE_SERVICE_ROLE_KEY) {<br>  throw new Error(&#39;SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY must be set&#39;);<br>}</pre><p>Full code: <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/supabase/client.ts">backend/notes-auth-api/src/supabase/client.ts</a>.</p><p><strong>Benefits:</strong></p><ol><li><strong>No Supabase keys in the frontend or notes services</strong> — reduces exposure and keeps a clear security boundary.</li><li><strong>One place to change auth</strong> — if you switch provider or token shape, you only change the auth API.</li><li><strong>Notes services stay stateless</strong> — they verify JWTs locally with JWKS; no per-request call to the auth server.</li><li><strong>Clear separation</strong> — “identity” lives in the auth API; “data” lives in the notes service and Postgres.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*gOsUzbaeIlQ5YJtVAQJGdw.png" /></figure><h3>3. Supabase Authentication in Detail</h3><p>The auth API is the only component that calls Supabase. Here is what it does:</p><ul><li><strong>Login:</strong> Validates email/password with Supabase Auth (/auth/v1/token?grant_type=password), then loads roles/permissions and issues app JWTs. See verifyPassword in <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/supabase/client.ts">client.ts</a>.</li><li><strong>Signup:</strong> Creates the user with Supabase Auth (/auth/v1/admin/users), assigns a default user role in the user_roles table, then issues app JWTs. See signup in <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/routes/auth.ts">auth.ts</a>.</li><li><strong>User lookup:</strong> Uses getUserById → /auth/v1/admin/users/:id for /auth/me and refresh.</li><li><strong>Roles:</strong> Reads and updates roles via the REST API and a user_roles table: getUserRoles, assignRole, updateUserRole. See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/supabase/client.ts">client.ts</a>.</li></ul><p><strong>Snippet — login with Supabase (password grant):</strong></p><pre>export async function verifyPassword(email: string, password: string): Promise&lt;SupabaseAuthResponse&gt; {<br>  const response = await fetch(`${SUPABASE_URL}/auth/v1/token?grant_type=password`, {<br>    method: &#39;POST&#39;,<br>    headers: {<br>      &#39;Content-Type&#39;: &#39;application/json&#39;,<br>      &#39;apikey&#39;: SUPABASE_SERVICE_ROLE_KEY || &#39;&#39;,<br>    },<br>    body: JSON.stringify({ email, password }),<br>  });<br>  // ... parse response, return user or error<br>}</pre><p>Full code: <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/supabase/client.ts">backend/notes-auth-api/src/supabase/client.ts</a>.</p><p><strong>Snippet — login in route.ts:</strong></p><pre>// Login<br>authRouter.post(&#39;/login&#39;, async (req: Request, res: Response) =&gt; {<br>const authResult = await verifyPassword(email, password);<br>// ...<br>const { roles, permissions } = await getUserRolesAndPermissions(user.id, user.email || &#39;&#39;);<br>const accessToken = signAccessToken(user.id, user.email || &#39;&#39;, roles, permissions);<br>setAccessCookie(res, accessToken);<br>});</pre><p>Full code:<a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/routes/auth.ts">backend/notes-auth-api/src/routes/auth.ts</a></p><p><strong>Note:</strong> The auth API expects a user_roles(user_id, role) table (and possibly other columns). If it is not in the repo migrations, add a migration so this table exists and is accessible with the service role.</p><h3>4. From Supabase to App JWT: Token Issuance</h3><p>Notes services do not call Supabase. They need a signed, short-lived token that carries user id, roles, and permissions. The auth API issues this <strong>app JWT</strong> after it has validated the user with Supabase.</p><p><strong>Why app JWTs:</strong> The notes API must know “who” and “what they are allowed to do” without calling Supabase on every request. The app JWT encodes sub (user id), roles and permissions and is signed by the auth API. Notes services verify the signature using the auth API’s public key (JWKS).</p><p><strong>Claims in the access token:</strong> iss, aud, sub, exp, roles[], permissions[]. Refresh token adds type: &#39;refresh&#39; and a longer expiry.</p><p>Payload and signing:</p><pre>const payload: TokenPayload = {<br>  iss: issuer,<br>  aud: audience,<br>  sub: userId,<br>  exp: now + 3600, // 1 hour<br>  roles,<br>  permissions,<br>};<br><br>return jwt.sign(payload, privateKey, {<br>  algorithm: &#39;RS256&#39;,<br>  keyid: kid,<br>});</pre><p>Example access token claims:</p><pre>{<br>  &quot;iss&quot;: &quot;notes-auth-api&quot;,<br>  &quot;aud&quot;: &quot;notes-services&quot;,<br>  &quot;sub&quot;: &quot;user-uuid&quot;,<br>  &quot;roles&quot;: [&quot;user&quot;],<br>  &quot;permissions&quot;: [&quot;notes.read&quot;, &quot;notes.create&quot;],<br>  &quot;exp&quot;: 1730000000<br>}</pre><p>Full code: <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/auth/jwt.ts">backend/notes-auth-api/src/auth/jwt.ts</a>.</p><p>The auth API calls signAccessToken(userId, email, roles, permissions) after a successful login, signup or refresh and puts the token in an HTTP-only cookie. See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/routes/auth.ts">auth.ts</a> (login, signup, refresh handlers).</p><p><strong>Roles and permissions:</strong> Roles come from the user_roles table. Permissions are derived from roles in code. Example mapping:</p><ul><li>user → notes.read, notes.create, notes.update, notes.delete, notes.share</li><li>admin → same as user plus admin.view, admin.manage</li></ul><pre>// Permission mapping based on roles<br>const ROLE_PERMISSIONS: Record&lt;string, string[]&gt; = {<br>  user: [<br>    &#39;notes.read&#39;,&#39;notes.create&#39;,&#39;notes.update&#39;,&#39;notes.delete&#39;,&#39;notes.share&#39;,<br>  ],<br>  admin: [<br>    &#39;notes.read&#39;,&#39;notes.create&#39;,&#39;notes.update&#39;,&#39;notes.delete&#39;,&#39;notes.share&#39;,<br>    &#39;admin.view&#39;,&#39;admin.manage&#39;,<br>  ],<br>};</pre><p>See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/policy/roles.ts">backend/notes-auth-api/src/policy/roles.ts</a> — getUserRolesAndPermissions loads roles from Supabase and builds the permissions set from ROLE_PERMISSIONS.</p><h3>5. JWT Handling: Cookies and Security</h3><p>Tokens are never sent to the client in the response body. They are stored in <strong>HTTP-only cookies</strong> so JavaScript cannot read them. The browser sends them automatically with every request when the frontend uses credentials: &#39;include&#39;.</p><p><strong>Cookie options</strong> (access token example): httpOnly: true, secure, sameSite (e.g. lax for local dev, none when cross-site and HTTPS), path: &#39;/&#39;, maxAge.</p><pre>export function setAccessCookie(res: Response, token: string): void {<br>  const cookieOptions: any = {<br>    httpOnly: true,<br>    secure: COOKIE_SECURE,<br>    sameSite: COOKIE_SAMESITE,<br>    path: &#39;/&#39;,<br>    maxAge: 3600 * 1000, // 1 hour<br>  };<br>  <br>  res.cookie(COOKIE_NAME_ACCESS, token, cookieOptions);<br>}</pre><p>See setAccessCookie and setRefreshCookie in <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/auth/cookies.ts">cookies.ts</a>.</p><p><strong>Why cookies:</strong> No token in JS memory; no manual Authorization header from the client; cookies are sent only to the configured domain/path. Cross-origin is controlled via CORS.</p><p><strong>CORS:</strong> The auth API (and notes APIs) use an explicit allowlist of origins and credentials: true. Allowed headers include Content-Type, Authorization, and X-CSRF-Token. See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/middleware/cors.ts">cors.ts</a>.</p><pre>cors({<br>  origin: (origin, callback) =&gt; {<br>    if (!origin || allowedOrigins.includes(origin)) callback(null, true);<br>    else callback(new Error(&#39;Not allowed by CORS&#39;));<br>  },<br>  credentials: true,<br>  allowedHeaders: [&#39;Content-Type&#39;, &#39;Authorization&#39;, &#39;X-CSRF-Token&#39;],<br>});</pre><p><strong>CSRF:</strong> For state-changing methods (POST, PATCH, PUT, DELETE), the auth API uses a double-submit pattern: a CSRF token in a cookie and the same value in a header (X-CSRF-Token). It also validates Origin / Referer against the allowlist. See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/middleware/csrf.ts">csrf.ts</a>.</p><p>Snippet — CSRF validation for writes:</p><pre>if ([&#39;POST&#39;, &#39;PATCH&#39;, &#39;PUT&#39;, &#39;DELETE&#39;].includes(req.method)) {<br>  const cookieToken = req.cookies[COOKIE_NAME];<br>  const headerToken = req.headers[&#39;x-csrf-token&#39;] as string;<br>  // ... origin/referer check ...<br>  if (cookieToken !== headerToken) {<br>    return res.status(403).json({ error: &#39;Invalid CSRF token: Token mismatch&#39; });<br>  }<br>}</pre><h3>6. JWKS and How Notes Services Verify JWTs</h3><p>The auth API exposes a <strong>JWKS</strong> endpoint so other services can verify its JWTs without sharing the private key. Notes services fetch the public key(s) by key id (kid) from the JWT header and verify signature and claims locally.</p><p><strong>Auth API:</strong> GET /.well-known/jwks.json returns the public key in JWK format. Implementation uses the same key pair as for signing (see <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/auth/jwks.ts">jwks.ts</a> and <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/auth/keys.ts">keys.ts</a>). The route is registered in <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-auth-api/src/server.ts">server.ts</a>.</p><pre>app.get(&#39;/.well-known/jwks.json&#39;, (req, res) =&gt; {<br>  res.json(getJWKS());<br>});</pre><p><strong>Node notes service:</strong> Uses jwks-rsa to fetch keys from AUTH_JWKS_URL, with caching. It verifies the JWT with algorithm RS256, and checks issuer and audience. The token is read from the HTTP-only cookie (or Authorization: Bearer / query param if configured). The decoded token is attached as req.user. See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-node-service/src/auth/jwks.ts">notes-node-service/../jwks.ts</a> and <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-node-service/src/auth/middleware/auth.ts">notes-node-service/../auth.ts</a>.</p><pre>const token = req.cookies[COOKIE_NAME];<br>if (!token) return res.status(401).json({ error: &#39;Not authenticated&#39; });<br>const decoded = await verifyToken(token);<br>req.user = decoded;<br>next();</pre><p><strong>Java notes service: </strong>Uses <strong>Spring Boot OAuth2 Resource Server</strong> with a single JwtDecoder bean backed by the auth API&#39;s JWKS URI (NimbusJwtDecoder.withJwkSetUri(jwksUri).build()). Issuer and audience are validated via custom validators so the app JWT from the auth API is accepted. The JWT is read from the <strong>HTTP-only cookie</strong>(or Authorization: Bearer / query param if configured) . The filter decodes the JWT with this JwtDecoder, builds an <strong>AuthenticatedUser</strong> principal (id, email, roles, permissions from claims), and sets the Spring Security context. No manual JWKS fetching or JWT parsing; the framework handles verification and claim mapping</p><p>See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-java-service/src/main/java/com/notes/security/jwt/JwtAuthenticationFilter.java">notes-java-service/../JwtAuthenticationFilter.java</a>.</p><pre>const token = req.cookies[COOKIE_NAME];<br>if (!token) return res.status(401).json({ error: &#39;Not authenticated&#39; });<br>const decoded = await verifyToken(token);<br>req.user = decoded;<br>next();</pre><p><strong>Benefits:</strong> No auth server call per request; algorithm pinning (RS256); issuer and audience validation; expiry checks; key rotation by publishing a new key with a new kid and refreshing JWKS when needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*_kFtl0SSqpOE4bcmjGu6Og.png" /></figure><p>Once the Auth API issues tokens, it <strong>gets out of the way</strong>.</p><p>Notes services:</p><ul><li>never call Auth API per request</li><li>never introspect tokens</li><li>never share private keys</li></ul><p>Instead:</p><ul><li>they fetch public keys from /.well-known/jwks.json</li><li>cache them</li><li>verify JWTs locally</li></ul><h3>Why this matters</h3><ul><li>zero runtime coupling</li><li>horizontal scalability</li><li>no auth bottleneck</li><li>clean trust boundary</li></ul><p>Your Java and Node services both do this, using the same principles.</p><h3>7. API-Level Authorization (Roles and Permissions)</h3><p>After the JWT is verified, the notes API enforces <strong>who</strong> can call <strong>which</strong> endpoint using roles and permissions.</p><p><strong>Node:</strong> Guards are middleware that check req.user.roles or req.user.permissions. Example:</p><pre>export function requirePermission(permission: string) {<br>  return (req: Request, res: Response, next: NextFunction) =&gt; {<br>    if (!req.user?.permissions.includes(permission)) {<br>      return res.status(403).json({ error: &#39;Insufficient permissions&#39; });<br>    }<br>    next();<br>  };<br>}</pre><p>Routes then use them, e.g. notesRouter.get(&#39;/&#39;, requirePermission(&#39;notes.read&#39;), ...). See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-node-service/src/auth/middleware/guards.ts">notes-node-service/../guards.ts</a> and <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-node-service/src/routes/notes.ts">notes-node-service/../notes.ts</a>.</p><pre>notesRouter.get(&#39;/&#39;, requirePermission(&#39;notes.read&#39;), async (req, res) =&gt; {<br>  const userId = req.user!.sub;<br>  const notes = await notesService.listNotes(userId, req.user!.roles.includes(&#39;admin&#39;));<br>  res.json(notes);<br>});</pre><p><strong>Java:</strong> Controllers use annotations such as @RequirePermission(&quot;notes.read&quot;) and @RequireRole(&quot;admin&quot;). An AOP aspect runs before the controller and checks the current authentication’s principal — an <strong>AuthenticatedUser</strong> (id, email, roles, permissions) — for the required permission or role. The controller gets the user via Authentication.getPrincipal() cast to AuthenticatedUser.<br> See notes-<a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-java-service/src/main/java/com/notes/security/aop/RequirePermission.java">java-service/../RequirePermission.java</a>, <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-java-service/src/main/java/com/notes/security/aop/RequireRole.java">RequireRole.java</a>, <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-java-service/src/main/java/com/notes/security/aop/AuthorizationAspect.java">AuthorizationAspect.java</a>, and <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-java-service/src/main/java/com/notes/api/NotesController.java">notes-java-service/../NotesController.java</a>.</p><p>Example controller method:</p><pre>@GetMapping<br>@RequirePermission(&quot;notes.read&quot;)<br>public ResponseEntity&lt;List&lt;Note&gt;&gt; listNotes(Authentication authentication) {<br>  AuthenticatedUser user = (AuthenticatedUser) authentication.getPrincipal();<br>  List&lt;Note&gt; notes = notesService.listNotes(user.getId(), user.getRoles().contains(&quot;admin&quot;));<br>  return ResponseEntity.ok(notes);<br>}</pre><h3>8. UI: No Supabase, Only Auth API and Notes API</h3><p>The frontend never imports the Supabase client. All auth goes through the auth API (login, signup, logout, refresh, /auth/me). All notes data goes through the notes API.</p><p><strong>Auth:</strong> Every request to the auth API uses credentials: &#39;include&#39; so cookies are sent. For write operations, the UI sends the CSRF token (from cookie or a dedicated endpoint) in the X-CSRF-Token header. See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/frontend/notes-ui/src/lib/auth/api.ts">frontend/notes-ui/src/lib/auth/api.ts</a>.</p><pre>async login(email: string, password: string): Promise&lt;{ user: User }&gt; {<br>  const csrfToken = await getCsrfToken();<br>  return fetchWithCredentials(`${AUTH_API_BASE_URL}/auth/login`, {<br>    method: &#39;POST&#39;,<br>    headers: { &#39;X-CSRF-Token&#39;: csrfToken },<br>    body: JSON.stringify({ email, password }),<br>  });<br>}</pre><p><strong>Notes:</strong> Same idea: credentials: &#39;include&#39; on all fetch calls to the notes API so the cookie is sent.</p><p><strong>Session and protection:</strong> The app uses a useAuth hook that calls authApi.getMe() and exposes user, can(permission), and hasRole(role). See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/frontend/notes-ui/src/hooks/useAuth.ts">frontend/notes-ui/src/hooks/useAuth.ts</a>. Next.js middleware calls the auth API’s /auth/me with the request cookies to decide whether the user is logged in and whether they can access admin routes. Unauthenticated users hitting /admin are redirected to login; authenticated non-admins are redirected away from /admin. See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/frontend/notes-ui/src/middleware.ts">frontend/notes-ui/src/middleware.ts</a> and <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/frontend/notes-ui/src/lib/auth/middleware.ts">frontend/notes-ui/src/lib/auth/middleware.ts</a> (checkAuth, isAdminRoute, isPublicRoute).</p><p>Snippet — fetch with credentials and permission check:</p><pre>const response = await fetch(url, {<br>  ...options,<br>  credentials: &#39;include&#39;,<br>  headers: { &#39;Content-Type&#39;: &#39;application/json&#39;, ...options.headers },<br>});</pre><pre>const can = (permission: string): boolean =&gt; {<br>  if (!state.user) return false;<br>  return state.user.permissions.includes(permission);<br>};</pre><h3>9. Database and RLS — The Final Enforcer</h3><p>Authorization in the API (roles/permissions) is the first line of defense. <strong>Row Level Security (RLS)</strong> in Postgres is the last: even if the API has a bug or a JWT is misused, the database will not return or modify rows the user is not allowed to see or change.</p><p><strong>Schema:</strong> The app has notes and note_shares. See<a href="https://github.com/mukizone/supabase-notes-app/blob/develop/supabase/migrations/0001_init_tables.sql">supabase/migrations/0001_init_tables.sql</a>.</p><pre>create table if not exists public.notes (<br>  id uuid primary key default gen_random_uuid(),<br>  owner_id uuid not null references auth.users(id) on delete cascade,<br>  title text not null,<br>  content text,<br>  created_at timestamptz not null default now(),<br>  updated_at timestamptz not null default now()<br>);</pre><p><strong>How the notes service talks to Postgres with RLS:</strong> <br>The notes service connects to Postgres directly (not via Supabase’s REST API). RLS policies use auth.uid() and auth.jwt(). In Supabase, these are usually fed by the JWT from the request. When the app uses a direct Postgres connection, it must <strong>set the same context</strong> so that auth.uid() and auth.jwt() behave correctly. The app does this by setting session variables before running queries.</p><p><strong>Node:</strong> withUserContext(client, userId, isAdmin, callback) runs SET LOCAL request.jwt.claims = &#39;{&quot;sub&quot;:&quot;&lt;userId&gt;&quot;,&quot;role&quot;:&quot;admin&quot;|&quot;authenticated&quot;}&#39; and SET LOCAL role = &#39;authenticated&#39;, then runs the query callback, then resets. Every note operation goes through queryWithUserContext. See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-node-service/src/db/client.ts">notes-node-service/.../client.ts</a>.</p><pre>const claims = { sub: userId, role: isAdmin ? &#39;admin&#39; : &#39;authenticated&#39; };<br>await client.query(`SET LOCAL request.jwt.claims = &#39;${JSON.stringify(claims).replace(/&#39;/g, &quot;&#39;&#39;&quot;)}&#39;`);<br>await client.query(`SET LOCAL role = &#39;authenticated&#39;`);<br>return await callback(); // then RESET in finally</pre><p><strong>Java:</strong> Same idea: DbContext.withUserContext(userId, isAdmin, callback) sets request.jwt.claims and role, executes the callback, then resets. See <a href="https://github.com/mukizone/supabase-notes-app/blob/develop/backend/notes-java-service/src/main/java/com/notes/domain/DbContext.java">notes-java-service/.../DbContext.java</a>.</p><pre><br>claimsMap.put(&quot;sub&quot;, userId.toString());<br>claimsMap.put(&quot;role&quot;, isAdmin ? &quot;admin&quot; : &quot;authenticated&quot;);<br>jdbcTemplate.execute(&quot;SET LOCAL request.jwt.claims = &#39;&quot; + escapedClaims + &quot;&#39;&quot;);<br>jdbcTemplate.execute(&quot;SET LOCAL role = &#39;authenticated&#39;&quot;);<br>return callback.get(); // then RESET in finally</pre><p><strong>Important:</strong> In Supabase, auth.uid() is typically (auth.jwt()-&gt;&gt;&#39;sub&#39;)::uuid. When using a direct Postgres connection, the app must set request.jwt.claims (and the Postgres/Supabase setup must expose auth.uid() and auth.jwt() from that). The two files above show how the notes app sets this context so RLS policies that use auth.uid() and auth.jwt()-&gt;&gt;&#39;role&#39; work as intended.</p><h3>10. RLS Policies — Detailed Walkthrough (Notes App Example)</h3><p>RLS is enabled on notes and note_shares with ALTER TABLE ... ENABLE ROW LEVEL SECURITY and FORCE ROW LEVEL SECURITY.<br>Initial policies are in supabase/migrations/0002_rls_notes.sql and supabase/migrations/0003_rls_note_shares.sql. Because those policies reference each other across tables (notes → note_shares → notes), a later migration refactors them to use <strong>SECURITY DEFINER</strong> helpers so Postgres does not hit infinite recursion; see supabase/migrations/0004_fix_rls_recursion_note_shares.sql.</p><p><strong>Notes table:</strong></p><ul><li><strong>SELECT:</strong> A row is visible if owner_id = auth.uid(), or the user is in note_shares for that note, or auth.jwt()-&gt;&gt;&#39;role&#39; = &#39;admin&#39;.</li><li><strong>INSERT:</strong> Allowed only if owner_id = auth.uid() (users can only create notes for themselves).</li><li><strong>UPDATE:</strong> Allowed if the user is the owner, or is in note_shares with can_edit = true. WITH CHECK keeps owner_id unchanged so ownership cannot be reassigned.</li><li><strong>DELETE:</strong> Allowed only for the owner.</li></ul><p><strong>Note_Shares table:</strong></p><ul><li><strong>Owner manage (all):</strong> Any operation is allowed only if the note’s owner_id = auth.uid() (only the owner can add/remove shares).</li><li><strong>Shared user select:</strong> Rows where shared_with = auth.uid() can be read (so the shared user can see the share record).</li></ul><pre>create policy &quot;notes_select&quot;<br>on public.notes for select<br>using (<br>  owner_id = public.current_app_user_id()<br>  or public.notes_visible_to_app_user(id)<br>  or (current_setting(&#39;request.jwt.claims&#39;, true)::jsonb-&gt;&gt;&#39;role&#39;) = &#39;admin&#39;<br>);</pre><p><strong>Concrete example:</strong> Alice creates a note. She shares it with Bob with can_edit: true. When Alice’s request hits the notes API, the service sets request.jwt.claims = { sub: alice_id, role: &#39;authenticated&#39; }. SELECT returns her note (and any notes shared with her). When Bob’s request is processed, the service sets Bob’s sub. SELECT returns Bob’s own notes and the note shared with him. UPDATE is allowed only on that shared note because RLS checks note_shares and can_edit. An admin has role: &#39;admin&#39; in the JWT; the SELECT policy allows them to see all notes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*qaI2Yan9AGxQgojPKfqHUA.png" /></figure><p>Snippet — INSERT policy (owner only):</p><pre>create policy &quot;notes_insert&quot; on public.notes for insert<br>with check ( owner_id = auth.uid() );</pre><p><strong>Snippet — SELECT policy on notes:</strong></p><pre>create policy &quot;notes_select&quot;<br>on public.notes<br>for select<br>using (<br>  owner_id = auth.uid()<br>  or exists (<br>    select 1<br>    from public.note_shares ns<br>    where ns.note_id = notes.id<br>      and ns.shared_with = auth.uid()<br>  )<br>  or (auth.jwt() -&gt;&gt; &#39;role&#39;) = &#39;admin&#39;<br>);</pre><p><strong>Snippet — UPDATE policy on notes:</strong></p><pre>create policy &quot;notes_update&quot;<br>on public.notes<br>for update<br>using (<br>  owner_id = auth.uid()<br>  or exists (<br>    select 1<br>    from public.note_shares ns<br>    where ns.note_id = notes.id<br>      and ns.shared_with = auth.uid()<br>      and ns.can_edit = true<br>  )<br>)<br>with check (<br>  owner_id = auth.uid()<br>);</pre><h3>11. End-to-End Request Flows</h3><p><strong>Login flow:</strong></p><ol><li>User submits email/password on the UI.</li><li>UI sends POST to auth API /auth/login with credentials and CSRF header.</li><li>Auth API calls Supabase Auth (password grant).</li><li>On success, auth API loads roles/permissions (e.g. from user_roles), signs access and refresh JWTs, sets HTTP-only cookies and returns user info (no tokens in body).</li><li>UI stores no tokens; subsequent requests send cookies automatically.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*qxMSrJkR8ppN5Qqsauyqng.png" /></figure><p><strong>Notes API flow (e.g. list notes):</strong></p><ol><li>UI sends GET to notes API /api/notes with credentials: &#39;include&#39; (cookie sent).</li><li>Notes service reads JWT from cookie, gets kid from header, fetches/caches JWKS, verifies signature and claims (iss, aud, exp).</li><li>Service sets principal (e.g. req.user or SecurityContext).</li><li>Guard checks permission (e.g. notes.read).</li><li>Service sets Postgres context: request.jwt.claims and role for the current user (and admin flag if applicable).</li><li>Service runs SELECT; RLS filters rows so only allowed notes are returned.</li><li>Service resets Postgres context and returns the list to the UI.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*zoTclqNEJ_r7MW7G4pTFrg.png" /></figure><h3>12. Security Checklist and Takeaways</h3><p><strong>Checklist:</strong></p><ul><li>No Supabase keys in the UI or notes services.</li><li>HTTP-only cookies for access and refresh tokens.</li><li>Cross-site cookie support (e.g. SameSite=None with Secure) and explicit CORS with credentials: true.</li><li>CSRF protection on write operations (double-submit + Origin/Referer).</li><li>JWT verification: algorithm pinning (RS256), issuer and audience validation, expiry checks.</li><li>JWKS caching and support for key rotation via kid.</li><li>Authorization at both API level (roles/permissions) and DB level (RLS).</li></ul><p><strong>Takeaways:</strong></p><ul><li>The <strong>auth API is the single Supabase boundary</strong>: only it holds Supabase secrets and talks to Supabase Auth (and, for roles, PostgREST). The UI and notes services stay Supabase-agnostic.</li><li><strong>App JWTs + JWKS</strong> let notes services verify requests locally and scale without calling the auth server on every request.</li><li><strong>RLS is mandatory</strong> for data safety: it enforces who can see or change which rows regardless of API bugs or token misuse.</li><li>This notes app implements the full chain: Supabase Auth → auth API → app JWT in cookies → notes API (JWKS verification + guards) → Postgres with RLS context and policies.</li></ul><h3>If you like this topic :</h3><ol><li><strong>Clap</strong> this article 10+ times; that will really help the article reach more readers 👏</li><li>Follow me on <a href="https://medium.com/@mukesh.vast"><strong>Medium</strong></a> and/or <a href="http://linkedin.com/in/mukeshvast"><strong>LinkedIn</strong></a> and subscribe to get my latest article for Free🫶</li><li>Feel free to connect or drop a comment about the article !</li></ol><h3>Stay tuned for more Tech explorations!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb22479a4e20" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/building-enterprise-grade-security-with-supabase-a-notes-app-that-teaches-real-iam-cb22479a4e20">Building Enterprise-Grade Security with Supabase: A Notes App That Teaches Real IAM</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supabase as an Enterprise Identity Platform — If You Architect It Right]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/supabase-as-an-enterprise-identity-platform-if-you-architect-it-right-6b8ebadd95d6?source=rss-469281ebde2e------2"><img src="https://cdn-images-1.medium.com/max/1536/1*JC0NZVLX__F_TPiqq4H7PA.png" width="1536"></a></p><p class="medium-feed-snippet">How Supabase Auth and Postgres RLS enable scalable SaaS security&#x200A;&#x2014;&#x200A;explained through a Notes App</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/supabase-as-an-enterprise-identity-platform-if-you-architect-it-right-6b8ebadd95d6?source=rss-469281ebde2e------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/supabase-as-an-enterprise-identity-platform-if-you-architect-it-right-6b8ebadd95d6?source=rss-469281ebde2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b8ebadd95d6</guid>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[supabase]]></category>
            <dc:creator><![CDATA[Mukesh Vast]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 17:24:42 GMT</pubDate>
            <atom:updated>2026-02-05T05:31:01.195Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Beyond the Syntax: Java and Python as Architectural Building Blocks]]></title>
            <link>https://levelup.gitconnected.com/beyond-the-syntax-java-and-python-as-architectural-building-blocks-0230bb1984c7?source=rss-469281ebde2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/0230bb1984c7</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Mukesh Vast]]></dc:creator>
            <pubDate>Tue, 25 Nov 2025 16:56:28 GMT</pubDate>
            <atom:updated>2026-02-05T05:38:12.460Z</atom:updated>
            <content:encoded><![CDATA[<p>Not a language war — just pragmatic insight into where each runtime excels in modern architecture</p><p>Java and Python are two pillars of modern software architecture, each excelling in different domains but often coexisting within the same enterprise architecture. As an architect, you’re likely to encounter <strong>Java powering mission-critical backends</strong> and <strong>Python driving AI/ML workflows</strong> side by side. This article goes beyond a simplistic “Java vs Python” debate. Instead, we’ll explore <em>architectural principles</em> — how these languages differ under the hood (bytecode vs binary, static vs dynamic), how they handle workloads (CPU-bound, I/O-bound, concurrent tasks), and how their ecosystems (frameworks, tools) make them suited to particular use cases. The goal is to provide a high-level yet detailed architectural perspective — a <em>guideline for using Java, Python, or both</em> in advanced solutions.</p><p><strong>If you don’t have Medium account</strong>, read full article free on <strong>Substack</strong> <a href="https://open.substack.com/pub/mukizone/p/stop-comparing-syntaxcompare-architectures"><strong><em>here</em></strong></a>. (no login needed)</p><h3>1. Language Architecture and Runtime Differences</h3><h4><strong>1.1 Bytecode to Machine Code:</strong></h4><p>Both Java and Python use an intermediate bytecode, but their execution models differ fundamentally. Java source code is compiled <em>ahead-of-time</em> into platform-neutral bytecode, which runs on the Java Virtual Machine (JVM). The JVM uses a <strong>Just-In-Time (JIT)</strong> compiler to translate hot bytecode paths into optimized native machine code at runtime<a href="https://www.scoutapm.com/blog/python-vs-java#:~:text=,time">s</a> This means after a warm-up period, Java code can execute very close to hardware speeds. Python (specifically CPython), on the other hand, compiles code <em>on the fly</em> into bytecode which a <strong>virtual machine interpreter</strong> then executes step by steps. Unlike Java’s JVM, the CPython interpreter does not JIT-compile by default — it executes each bytecode instruction by invoking C functions under the hood. The result is that Java’s runtime aggressively optimizes code (through JIT and other advanced techniques) whereas Python’s runtime prioritizes simplicity and portability, usually at the cost of raw speed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qD7WmuGBkFwUKeGItLPd0A.gif" /></figure><h4>1.2 Execution and startup:</h4><p>Java programs require a compilation step (javac) and then are launched on the JVM. This means a slight startup delay (to load classes, JIT the code, etc.), but once running, the code runs at optimized speed. Python programs start up very quickly (no separate compile step; the interpreter compiles as it loads code) and are ready to execute immediately, which is great for scripts and short-lived jobs. However, Python pays the cost per execution of functions as the interpreter must decode and dispatch each bytecode instruction. Java amortizes that cost over time by optimizing hot code paths. This is why <strong>short-running tasks or scripts</strong> are often done in Python (fast startup and development), whereas <strong>long-running server processes</strong> are frequently Java (the JVM can optimize over the process’s lifetime).</p><h4><strong>1.3 Static vs. Dynamic Typing:</strong></h4><h4>1.3.1 Java (Statically Typed)</h4><p>Java is statically-typed — variables and method signatures have declared types and type checking happens at compile time. This allows the Java compiler and JVM to perform optimizations (inlining, type-specific dispatch, etc.).</p><pre>public class Sum {<br>    public static void main(String[] args) {<br>        int a = 10;<br>        int b = 20;<br>        int result = a + b;<br>        System.out.println(&quot;Sum is: &quot; + result);<br>    }<br>}</pre><ul><li><strong>What happens</strong>: The compiler knows the types (int), so it performs optimizations like direct memory allocation and inlining. Errors like type mismatch are caught at compile time.</li><li><strong>Result</strong>: Fast execution, fewer runtime surprises.</li></ul><h4>1.3.2 Python (Dynamically Typed)</h4><p>Python on the other hand is dynamically-typed (with optional type hints that are not enforced at runtime) which makes it very flexible and concise but adds overhead. This flexibility slows execution but greatly speeds up development, since you can write code without the verbosity of type declaration.</p><pre>def sum_values(a, b):<br>    return a + b<br><br>result = sum_values(10, 20)<br>print(&quot;Sum is:&quot;, result)</pre><ul><li><strong>What happens</strong>: Python figures out the types of a and b at runtime. Each operation involves extra overhead (type checks, dynamic dispatch).</li><li><strong>Result</strong>: Slower execution but faster to write and easier to change.</li></ul><h4><strong>1.4 Memory Representation:</strong></h4><p>The static vs dynamic difference also affects memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ruF4lG2fBHiiib_7lOqW-Q.gif" /></figure><h4><strong>1.5 Memory Management </strong>and Garbage Collection<strong>:</strong></h4><p>Both languages are memory-safe (no manual malloc/free) and use garbage collection, but with different approaches.</p><p><strong>Java uses generational garbage collection on the JVM</strong>, with multiple algorithms available (e.g. G1, ZGC, Shenandoah) tuned for various workloads. The JVM can reclaim unused memory in parallel, minimize pause times and be configured extensively for throughput vs latency.</p><p><strong>Python uses reference counting</strong> with a cyclic garbage collector. Every Python object has a reference count; when it drops to zero, the object is immediately reclaimed. A separate cycle detector catches reference cycles. This approach ensures timely cleanup of most objects (especially in short-lived scripts) but can struggle with large long-lived workloads (since reference counting adds overhead on every object operation). Python’s memory allocator (PyMalloc) is optimized for small objects — it manages pools of memory to satisfy allocations quickly without going to the OS frequently. Java’s memory management, on the other hand, relies on the JVM’s allocator and GC, which can handle large heaps (tens of gigabytes) with high throughput, especially with modern near-pause-less collectors.</p><p>In practice, <strong>Java’s memory usage for equivalent data can be lower</strong> (one source notes Java can use 40–60% less memory than Python for the same data structures), and its GC is more predictable for long-running servers. Python’s memory management is simpler for the developer (no tuning needed), but at the cost of some performance and less control over GC behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UL8t4tSjdPA1MzXpes5aew.png" /></figure><h4><strong>1.6 Interfacing with Native Code:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*86yWqzGoNUOpDTPhy5C08g.gif" /></figure><h4><strong>1.7 Portability and Binary Distribution:</strong></h4><p>Java’s motto “write once, run anywhere” comes from its architecture — the compiled bytecode runs on any platform with a JVM. This makes Java binaries (JARs or WARs) highly portable across Windows, Linux, macOS, etc. <br>Python source code is also portable, but the <strong>Python interpreter (runtime) must be present</strong> on the target system. There isn’t a single binary you ship; instead you ship source or compiled bytecode plus a Python runtime.</p><p>In modern cloud environments, both Java and Python are commonly deployed in Docker containers, which include the necessary runtime. Still, the <strong>JVM’s strict compatibility and class loader architecture</strong> means a Java app behaves almost identically across environments. Python sometimes runs into issues like differing library versions, Python 2 vs 3 (less so now), or C extension compatibility on different OSes, which architects must manage via virtual environments or containerization.</p><h3>2. Performance Characteristics</h3><p>Modern software faces a mix of <strong>CPU-bound tasks</strong>, <strong>I/O-bound tasks</strong>, and the need for <strong>concurrent execution</strong>. Let’s examine how Java and Python handle these scenarios and where each has an edge.</p><h3>2.1 CPU-Bound Workloads</h3><p>For CPU-intensive tasks (math and number crunching, algorithms, data processing, encryption, image processing, etc.), Java is typically ~10× faster than Python</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tc7FPQaX2qcXAQcWYAbcXQ.gif" /></figure><ul><li><strong>JIT Compilation:</strong><br> Java JIT-compiles hot code into optimized machine instructions. Python interprets bytecode each time, adding dispatch and type-check overhead.</li><li><strong>Static Typing &amp; Primitives:</strong><br> Java uses efficient primitives (int, double), whereas Python wraps values as objects with metadata. Over millions of operations, this drastically affects cache locality and throughput.</li><li><strong>GC &amp; Memory Layout:</strong><br> Java’s generational GC and contiguous allocation handle high object churn well. Python’s object-heavy model increases overhead and reduces cache efficiency.</li><li><strong>Multi Core:</strong> Another aspect is multi-core usage. In a Java program, starting 4 threads on a 4-core machine could roughly divide a CPU-heavy task and finish ~4× faster than a single thread (ideal scenario). In Python, 4 threads would still run one at a time on one core (so no speed-up). Python would need to start 4 separate processes to use 4 cores, which adds overhead and complexity.</li></ul><p><strong>Practical impact:</strong><br> A loop summing 100M integers: Java completes in ~0.5s vs Python’s ~5s. With 4 threads, Java scales to ~0.15–0.2s; Python threads do <strong>not</strong> speed up CPU work due to the <strong>GIL(</strong>Global Interpreter Lock<strong>)</strong>. Python can scale using multiple processes, but with added memory and IPC overhead.</p><p><strong>Bottom line:</strong><br> Java dominates pure CPU-intensive workloads within a single process. Python can match performance only when offloading computation to C extensions (NumPy, etc.), effectively bypassing Python itself.</p><h3>2.2 I/O-Bound and Asynchronous Workloads</h3><p>I/O operations (network, files, DB) spend most time waiting. The challenge becomes: <strong>How do you serve many concurrent requests without wasting resources during I/O waits?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxBCYJLJOigdjR-o9n2vMw.png" /></figure><h4>Java’s Traditional Thread Model</h4><p>Each request uses a thread (OS thread). While the thread waits on I/O, the OS schedules others. This scales well up to hundreds or low thousands of threads, but OS threads consume significant memory (stack space) and increase context-switch overhead.</p><h4>Python’s Threading</h4><p>Despite the GIL, <strong>Python threads work well for I/O-bound tasks</strong> because the interpreter releases the GIL during blocking I/O. Threads take turns executing Python code but spend most time waiting, so concurrency is effective for moderate loads without parallel CPU usage.</p><h4>Async I/O (Python)</h4><p>Python’s asyncio and FastAPI use a single-threaded event loop with coroutines instead of OS threads.<br> Benefits:</p><ul><li>Can handle <strong>thousands of connections</strong> with minimal memory.</li><li>Extremely efficient for “wait-heavy” workloads.<br> Limitation: CPU-intensive work inside the event loop blocks all other coroutines on that core.</li></ul><p>Python scales further by running <strong>multiple processes</strong>, one per CPU core (e.g., Gunicorn workers). Each process has its own GIL and event loop.</p><h4>Java’s Modern Alternatives</h4><p>Java offers two scalable models:</p><ul><li><strong>NIO / Reactive stacks</strong> (Netty, Spring WebFlux) — event-loop based, similar to Python’s async.</li><li><strong>Virtual Threads (Project Loom)</strong> — lightweight threads managed by the JVM, enabling tens or hundreds of thousands of concurrent I/O tasks without the cost of OS threads.</li></ul><p><strong>Bottom line:</strong><br> For high concurrency with mostly-waiting workloads, Python async and Java Loom both scale efficiently. Python needs multiple processes to exploit all cores; Java can scale within a single JVM.</p><h3>2.3 Concurrency and Parallelism</h3><p><strong>Concurrency</strong> = many tasks in progress.<br> <strong>Parallelism</strong> = tasks running simultaneously on multiple cores.</p><h4>Java’s Strengths</h4><ul><li>True parallel execution with OS threads.</li><li>Mature concurrency utilities (java.util.concurrent).</li><li>Excellent for CPU-bound parallelism and large shared-memory workloads.</li><li>Big-data systems (Spark, Hadoop) use JVM threads heavily.</li></ul><h4>Python’s Constraints</h4><ul><li><strong>GIL</strong> prevents multiple threads from executing Python bytecode in parallel.</li><li>Multithreading helps <strong>only for I/O</strong>, not CPU.</li><li>True parallel CPU work requires <strong>multiprocessing</strong>, adding memory overhead and limiting shared-state architectures.</li><li>Many enterprise Python designs embrace distributed or multi-process patterns earlier due to these limits.</li></ul><p><strong>Example:</strong><br> A service performing 0.5s CPU work per request:</p><ul><li>Java on 8 cores handles 8 requests in ~0.5s (parallel).</li><li>Python async handles them serially on one core (~4s total) unless scaled with 8 worker processes.</li></ul><p><strong>Bottom line:</strong><br> Java has simpler and more powerful in-process parallelism. Python requires multi-process or external systems for CPU-parallel workloads.</p><h3>2.4 Performance Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hpsdx9y_cb-vYdbHjY9dnA.png" /></figure><ul><li><strong>Java</strong> tends to win on <strong>raw CPU-bound performance</strong>, often by a wide margin (10x faster or more), thanks to JIT and static optimizations. It efficiently uses multiple cores with threads for parallel tasks.</li><li><strong>Python</strong> provides <strong>faster development and iteration</strong>, and can handle many concurrent I/O operations efficiently using async (coroutine-based concurrency) with lower memory overhead for each waiting task. But it struggles with CPU-bound parallelism in a single process due to the GIL.</li><li>Memory-wise, Java programs may have a smaller memory footprint for the same workload (e.g. dozens of percent less memory), whereas Python might use more memory and CPU to accomplish the same due to interpreter overhead and object metadata.</li><li>It’s common to see <strong>hybrid approaches</strong>: e.g. Python orchestrating calls to a C++ library for heavy math, or an enterprise solution using Python for one component and Java for another . The right tool for the job might mean using Java where throughput is critical and Python where flexibility or quick turnaround is key.</li></ul><h3>3 How Performance Shapes Real-World Usage</h3><p>The earlier performance discussion (CPU vs I/O vs concurrency) shows up in practice as:</p><ul><li><strong>Java</strong> → long-lived, high-throughput, mission-critical systems where latency, correctness, and multicore utilization matter a lot.</li><li><strong>Python</strong> → AI/ML, analytics, automation, and fast-moving services where <em>development speed</em> and <em>library ecosystems</em> matter more than raw CPU efficiency.</li></ul><p>Modern systems increasingly use <strong>both</strong>, connected via APIs, queues, and shared data platforms.</p><h4>3.1 Java in Enterprise Architectures</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owDklvkvKvdAKEonz74pvw.gif" /></figure><h4>3.2 Python in Enterprise &amp; AI/ML</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K7ihq5V2Sn6FABycd0uLgg.gif" /></figure><h4>3.3 Frameworks &amp; Patterns: Side-by-Side View</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DjHtJw1aj2VaRAZ4RB-NAA.gif" /></figure><p>In practice, the most powerful architectures are <strong>deliberately polyglot</strong>: Java provides a robust, scalable backbone; Python injects intelligence, analytics, and rapid innovation on top.</p><h3>If you like this topic :</h3><ol><li><strong>Clap</strong> this article 10+ times; that will really help the article reach more readers 👏</li><li>Follow me on <a href="https://medium.com/@mukesh.vast"><strong>Medium</strong></a> and/or <a href="http://linkedin.com/in/mukeshvast"><strong>LinkedIn</strong></a> and subscribe to get my latest article for Free🫶</li><li>Feel free to connect or drop a comment about the article !</li></ol><h3>Stay tuned for more Tech explorations!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0230bb1984c7" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/beyond-the-syntax-java-and-python-as-architectural-building-blocks-0230bb1984c7">Beyond the Syntax: Java and Python as Architectural Building Blocks</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agentic AI : Communication Patterns for Multi-Agents (Part 3)]]></title>
            <link>https://levelup.gitconnected.com/agentic-ai-communication-patterns-for-multi-agents-part-3-c0867c614641?source=rss-469281ebde2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0867c614641</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-patterns]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[multiagent-system]]></category>
            <category><![CDATA[ai-orchestration]]></category>
            <dc:creator><![CDATA[Mukesh Vast]]></dc:creator>
            <pubDate>Mon, 14 Jul 2025 02:21:08 GMT</pubDate>
            <atom:updated>2025-07-14T05:11:24.882Z</atom:updated>
            <content:encoded><![CDATA[<h3>Agentic AI : Communication Patterns for Multi-Agents (Part 3)</h3><p>Ever wondered how multiple AI agents talk to each other behind the scenes?</p><p>In the <a href="https://medium.com/gitconnected/agentic-ai-building-smarter-systems-with-multi-agent-collaboration-part-1-05a319b93d4f"><strong><em>first part</em></strong></a>, we <strong>created a simple agentic system</strong>: an Orchestrator routing user requests to a Support Agent or Product Agent behind the scenes. That setup worked for basic queries (password resets went to the Support agent, feature questions went to the Product agent) and gave us a taste of how multiple AI agents can work together. Turns out, it’s not just about who does the task, but how they work together. In this follow-up, we’ll explore six common <strong>communication patterns</strong> for agent-to-agent interaction that make multi-agent systems more powerful and flexible.</p><p>If you don’t have medium account, read full article free <a href="https://bit.ly/4eTrpio">here</a>. (no login needed)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ISRtNltwPVdOFO722aGG-A.jpeg" /><figcaption>AI Communication Patterns</figcaption></figure><h3>1. Why Communication Patterns Matter</h3><p>Think of our multi-agent system as a team of experts. Just like human teams, <strong>how</strong> the members communicate is as important as <strong>what</strong> each member knows.</p><ul><li><strong>Sequential Execution:</strong> Agents handling tasks one after the other, passing the baton.</li><li><strong>Parallel Execution:</strong> Agents working on tasks simultaneously to save time.</li><li><strong>Hierarchical Delegation:</strong> Agents organizing in a chain of command (one agent delegating to sub-agents).</li><li><strong>Peer Debate and Consensus:</strong> Agents offering different answers and then agreeing on the best solution.</li><li><strong>Broadcasting:</strong> One agent sending a message to all agents to see who can contribute.</li><li><strong>Planning-Execution Loop:</strong> Agents planning actions, executing, then re-planning in a loop until the goal is met.</li></ul><p>We’ll break down each of these common pattern in an approachable way, tying it back to our Agentic AI example (the Support/Product agents and Orchestrator you met in Part 1). Let’s dive in!</p><h3>2.1 Sequential Execution</h3><p>One agent’s output feeds into the next agent’s input, step by step, until an answer is produced. In our example, the Orchestrator first invokes the Support Agent, then the Product Agent, in a controlled sequence.</p><p><strong>Sequential execution</strong> is the simplest pattern: agents complete tasks one after another, in a deliberate order. It’s like an assembly line for AI tasks. The <strong>output of one step becomes the input of the next</strong>. <br>In our Agentic AI example, imagine a user asks: <em>“</em><strong><em>I need to reset my password and then upgrade to premium features.</em></strong><em>”</em> <br>This query actually involves two sub-tasks — a support issue and a product question. A sequential approach would be:</p><ol><li><strong>Step 1:</strong> Orchestrator routes the password reset part to the Support Agent. The Support Agent finds the solution (maybe by querying the support knowledge base) and returns a password reset link or instructions.</li><li><strong>Step 2:</strong> Once that’s done, Orchestrator takes the <em>same query</em> (or the remaining part of it) to the Product Agent. The Product Agent fetches info on premium features (say via an API or vector DB lookup) and returns the details.</li><li><strong>Step 3:</strong> Orchestrator then <strong>combines the outputs</strong> — perhaps stitching together the Support Agent’s answer and the Product Agent’s info — into one coherent response for the user.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C1ln5s6ydekbEe4uGIkAqg.jpeg" /><figcaption>The flow shows how both Support and Product agents are triggered in sequence</figcaption></figure><p>This pattern ensures each task is handled in the correct order. The agents act like relay racers passing the baton. For example, a <strong>Support Agent</strong> might need to finish verifying a user’s identity <strong>before</strong> a <strong>Product Agent</strong> can suggest an upgrade. Sequential execution guarantees that kind of dependent ordering.</p><p>In code, a sequential chain might look like a simple script:</p><pre>support_output = support_agent.handle(user_query)<br>intermediate_context = update_context(user_query, support_output)<br>product_output = product_agent.handle(intermediate_context)<br><br>final_response = synthesize([support_output, product_output])</pre><p>The benefit of sequential execution is its <strong>simplicity</strong> and clarity. You always know which agent acts first, second and so on. However, the downside is <strong>latency</strong>: the user waits for each step to finish in turn. If step 1 takes a while, step 2 can’t start until step 1 is done. In cases where tasks could be done in parallel, sequential execution might not be the fastest approach. But when tasks have natural dependencies or order (you <em>must</em> do A before B), sequential is the way to go.</p><h3>2.2 Parallel Execution</h3><p>The Orchestrator triggers multiple agents at once (Support and Product in this diagram), and their results converge into a final answer. This pattern speeds up responses by handling independent tasks simultaneously.</p><p><strong>Parallel execution</strong> is all about speed and efficiency. Instead of waiting on one agent to finish before starting the next, the Orchestrator says: <strong>“Alright team, fan out and tackle everything at once!”</strong> Agents work concurrently on different aspects of a problem, and then their results are merged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_zbQngzYHYwV2g3_vPv_Gw.jpeg" /><figcaption>The flow shows how both Support and Product agents are triggered in parallel</figcaption></figure><p>In our multi-agent setup, suppose a user asks: <em>“</em><strong><em>How can I contact support and what are the features of the premium plan?</em></strong><em>”</em> There are two independent parts here. With parallel execution, the Orchestrator could <strong>call the Support Agent and Product Agent simultaneously</strong>. For instance:</p><ul><li>The Support Agent fetches instructions on how to reach support.</li><li>At the same time, the Product Agent pulls the latest premium feature info.</li></ul><p>Both agents work in parallel and when they’re done, the Orchestrator <strong>combines their answers</strong> into one response. The user gets a comprehensive answer faster, because we didn’t force the product info lookup to wait for the password reset to finish. LangGraph (the orchestration library we use) actually supports this kind of branching. We can design a workflow where two nodes run concurrently and then join into a final node. In pseudocode, it might look like:</p><pre># Kick off two tasks concurrently<br>support_task = asyncio.create_task(support_agent.handle(query))<br>product_task = asyncio.create_task(product_agent.handle(query))<br><br># Wait for both results<br>support_result = await support_task<br>product_result = await product_task<br>return merge_answers(support_result, product_result)</pre><p>The key benefit here is <strong>speed through concurrency</strong>. Of course, not every problem can be split up — but for those that can, this pattern is a game-changer. The main challenge is that you need to handle merging: How do you combine two answers? In our case it could be as simple as concatenating the Support and Product answers. In more complex cases, you might need another step to reconcile or synthesize the results. Still, when applicable, parallel execution makes your multi-agent system feel snappy and efficient to the user.</p><h3>2.3 Hierarchical Delegation</h3><p>Agents organized in a hierarchy, where a top-level <strong>Manager Agent</strong> delegates subtasks to lower-level specialist agents. In our case, the Orchestrator acts as a Manager Agent and routes work to Support and Product agents. However, any agent can temporarily take on a “manager” role if it needs help from another specialized agent.</p><p>Hierarchical delegation is like a <strong>manager assigning work to their team</strong>. It’s a natural way to organize a problem: break it down into parts and hand each part to someone best suited to solve it. In multi-agent systems, that means one agent (often the Orchestrator) becomes a <strong>Manager Agent</strong> that decides what needs to be done, then <strong>delegates those sub-tasks</strong> to the appropriate specialized agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-tZRZH2yX6MqRU5-nPaNcg.jpeg" /><figcaption>The flow shows how both Support and Product agents are triggered in heirarchy</figcaption></figure><p>In our Agentic AI setup, the Orchestrator gets a user query like: <em>“</em><strong><em>My integration isn’t working with Outlook”</em></strong>. Instead of answering directly, it first delegates to the Support Agent to check for integration issues, and then asks the Product Agent to fetch compatibility details. Each agent works independently on their subtask and reports back. Finally, the Orchestrator gathers both results and responds to the user. That’s classic delegation.</p><p>But here’s the twist: <strong>any agent can become a temporary manager</strong>.</p><p>Let’s say the Support Agent receives a question about a bug. It doesn’t have all the info, so it reaches out to a <strong>Logs Agent</strong> to fetch user logs. Now the Support Agent is acting like a <strong>mini-manager</strong>, delegating work downstream. This nesting of delegation creates flexibility: agents don’t need to know everything — they just need to know who to ask.</p><p>If you peek into our code, the Support agent’s logic does something like:</p><pre># Orchestrator as manager delegating known subtasks<br>subtasks = [&quot;check_support_logs&quot;, &quot;get_product_info&quot;]<br>responses = []<br><br>for task in subtasks:<br>    agent = get_specialist_for(task)<br>    result = agent.handle(task)<br>    responses.append(result)<br><br>return combine_responses(responses)</pre><p>Hierarchy is excellent for <strong>structured workflows</strong>. It scales well and matches how organizations delegate responsibilities. But it works best when you already <strong>know the subtasks</strong> ahead of time. Unlike planning-execution, you’re not adapting the plan mid-way — you’re just executing a plan with <strong>delegated roles</strong>.</p><h3>2.4 Peer Debate and Consensus</h3><p>Two agents tackle the same problem from different angles, then a consensus step compares their answers to produce the final result. This can improve answer quality by leveraging multiple perspectives.</p><p>What if two heads are better than one? <strong>Peer debate and consensus</strong> is a pattern where you have multiple agents (or multiple attempts by agents) address the <em>same</em> question, and then a process to reconcile their answers. It’s like getting a second opinion from another expert and then deciding which answer (or combination) is best. It is not about asking everyone, but about getting multiple trusted perspectives for the same problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BM4Fgya-58HaZwy0Wr725Q.jpeg" /><figcaption>The flow shows how both Support and Product agents are triggered in debate and consensus</figcaption></figure><p>How does this look in our example? Suppose the user asks a question that <em>could</em> fall under either agent’s domain, or it’s complex enough that we want to double-check. For instance: <em>“</em><strong><em>Our premium plan isn’t working as expected. Should I contact support or upgrade my account?</em></strong><em>”</em> This has both support and product aspects. Instead of picking one agent, the Orchestrator might pose the question to both the Support Agent and the Product Agent independently. Each agent produces its answer or solution from its perspective. Now we have two answers for the same query. The next step is <strong>consensus</strong>: we need to derive a final answer from these two.</p><p>There are a few ways to do this:</p><ul><li>The Orchestrator itself can act as the “judge,” comparing the agents’ answers. For example, if both agents returned identical or complementary info, that makes the final answer easy (just combine them). If they conflict or differ, the Orchestrator could choose the one that seems more directly relevant, or even merge parts of each.</li><li>We could employ a <strong>referee LLM</strong> — essentially another agent whose job is to read both answers and decide the best outcome. (Think of it as an AI moderator ensuring the user gets the correct info.)</li><li>Or, the agents could even have a brief direct debate: e.g., Support Agent says “I think contacting support is better because X,” Product Agent says “Upgrading might solve it because Y,” and through a few rounds they converge to an agreed recommendation. This is an advanced scenario and requires careful prompt design to have agents discuss with each other.</li></ul><p>Another simpler approach is often to run both answers through a single LLM with a prompt like: <em>“Here are two answers from different agents; please combine them or choose the best one for the user.”</em> This consensus agent will produce a reconciled answer. Here’s a conceptual snippet:</p><pre>answer_a = support_agent.handle(query)<br>answer_b = product_agent.handle(query)<br>if answer_a == answer_b:<br>    final = answer_a  # both agents agreed<br>else:<br>    final = llm_consensus(answer_a, answer_b)  # ask LLM to compare and refine<br>return final</pre><p>The big advantage of peer debate is <strong>improved reliability</strong>. If Agent A misses something, maybe Agent B catches it. If they disagree, the system can flag uncertainty. It’s a bit like unit testing your answers — two agents double-check each other. The cost is extra computation (running two agents instead of one, plus a consensus step), so you wouldn’t do this for every trivial query. But for high-stakes questions or when you want greater confidence, this pattern can be extremely valuable. It showcases the power of <em>agentic collaboration</em>: even AI agents can benefit from a second opinion and healthy debate before finalizing an answer!</p><h3>2.5 Broadcasting</h3><p>The Orchestrator sends the query to <em>all</em> available agents (Support, Product, Analytics, etc.), essentially asking “Who knows about this?” Each agent’s output can be collected and combined into the final answer. This pattern is useful when it’s unclear which agent is best suited or when many contributions are welcome.</p><p>Broadcasting is like shouting a question in a room full of experts and seeing who answers — “Who in the room has a good answer?”. In the <strong>broadcast pattern</strong>, the Orchestrator doesn’t target a specific agent or even just two — it sends the user’s question to <em>every</em> agent in the system (or at least to a broad subset). Each agent will attempt to answer if they have something relevant, and the Orchestrator gathers their responses. This is useful if you’re not sure <em>which</em> agent has the info, or if <strong>multiple agents might add value</strong> to the final answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oPpli5_y9kkQixAxIMeYaA.jpeg" /><figcaption>The flow shows how both Support and Product agents are triggered in braodcasts</figcaption></figure><p>Let’s tie this to our example. Imagine the user asks something like: <em>“</em><strong><em>I’m considering upgrading because I need better analytics and support. What can I do?</em></strong><em>”</em> This question touches multiple domains: support policies, product features, maybe an analytics tool if one exists. Instead of picking one agent, the Orchestrator broadcasts it to all:</p><ul><li>The Support Agent hears it and thinks: “This might be about a support issue or policy,” and prepares an answer about how to contact support or what support can do.</li><li>The Product Agent hears it and prepares info on premium features that might help analytics.</li><li>The Analytics Agent might chip in: e.g. “We have an analytics dashboard in premium that could solve your need.”</li></ul><p>The Orchestrator then collects all these contributions. How to form the final answer? There are a couple of strategies:</p><ul><li><strong>Combine and summarize:</strong> Just concatenate all agent responses and then have an LLM summarize or unify them into a single answer.</li><li><strong>Select best answer:</strong> If only one agent responded meaningfully (others might say “I don’t have info”), you can take that one agent’s answer as final.</li><li><strong>Sectioned answer:</strong> Sometimes, you might present each agent’s info in parts (e.g., “Support says: … Product says: …”). This is less common in user-facing answers but could be used in internal reports.</li></ul><pre>agents = [support_agent, product_agent, analytics_agent]<br>responses = [agent.handle(user_query) for agent in agents if agent.can_handle(user_query)]<br>final = merge(responses)</pre><p>The difference between broadcasting and generic parallel execution is the <strong>intention</strong>: broadcasting is a discovery mechanism (“whichever agent can handle this, please do”), whereas parallel execution is usually a planned split of a task (“you do Part A, I’ll do Part B”). <br>Broadcasting is great for flexibility — you can add new agents and they automatically start “listening” to questions without needing to change the orchestrator logic.</p><h3>2.6 Planning-Execution Loop</h3><p>This is an <strong>iterative cycle</strong> where the Planner (Orchestrator) plans a step, an Executor agent runs it, and the Planner revises the next step based on new data. It continues until the goal is complete.</p><p>The Planning-Execution Loop is like <strong>problem-solving in real time</strong>. You take one step, see what happens, and then decide what to do next. It’s used when the <strong>full plan isn’t known upfront</strong>, and the system needs to <strong>learn and adapt</strong> as it moves toward the goal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1AQTi0qXM07MjGX2Oo6MQQ.jpeg" /><figcaption>The flow shows how both Support and Product agents are triggered in planning-execution</figcaption></figure><p>How might this work in our scenario? Let’s say a user asks a very complex request: <em>“</em><strong><em>My account data is messed up. Please audit my account and fix any issues.</em></strong><em>”</em> This is not a single API call or a single agent query — it’s a <em>project</em> consisting of multiple steps:</p><ol><li>Maybe the system needs to <strong>identify what “messed up” means</strong> — is it billing, profile info, or something else? (This could involve the Support Agent analyzing account logs, or the Orchestrator asking follow-up questions.)</li><li>Then it might need to <strong>fetch data</strong> from various sources (maybe use a Data Agent or the Vector DB to retrieve account records).</li><li>Next, <strong>analyze the data</strong> (perhaps an Analytics Agent checks for anomalies).</li><li><strong>Take action</strong> to fix issues (maybe call a backend API via a specialized agent).</li><li><strong>Verify</strong> that the issues are resolved.</li><li>Finally, <strong>summarize the outcome</strong> to the user.</li></ol><p>That’s a lot of steps, and the exact sequence isn’t known upfront — it depends on what the data shows. A planning-execution loop handles this by dynamically deciding each step. The Orchestrator (or a dedicated Planner agent) would start by formulating an initial plan: e.g., “First, let’s retrieve account data.” It sends that task to the appropriate agent (Executor), gets the result, then the Planner reviews the new information and decides the next step: “Now, analyze this data for anomalies.” It loops: plan -&gt; execute -&gt; new info -&gt; re-plan -&gt; execute, and so on until some <strong>stopping condition</strong> is met (e.g., the account audit is complete and issues are fixed). Then the final answer or confirmation is returned to the user.</p><p>In code/pseudocode, it might look like this logic inside the Orchestrator:</p><pre>def plan_execution_loop(initial_state):<br>    state = initial_state<br>    while not goal_achieved(state):<br>        next_action = planner.decide_next(state)<br>        result = executor.perform(next_action)<br>        state = planner.update_state(state, result)<br>    return planner.summarize(state)</pre><p>Key difference from hierarchy? <strong>Planning is not fixed.</strong></p><ul><li>In hierarchy: the manager already knows all subtasks and who should do them.</li><li>In planning-execution: the system figures out each next step <strong>after seeing the outcome</strong> of the previous one.</li></ul><p>The real strength of the planning-execution loop is <strong>autonomy and adaptability</strong>. The system isn’t confined to a fixed sequence or parallel branches; it can <strong>handle surprises and new information on the fly</strong>. This pattern is what allows a multi-agent system to tackle <strong>open-ended problems</strong> that require reasoning, memory, and multiple actions.</p><h3>3. Quick Usage Tip</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8POufXEYXPegRxYkLO-lZg.jpeg" /><figcaption>Ai Pattern Usage</figcaption></figure><h3>4. Bringing It All Together</h3><ul><li>These patterns help you design smarter, more modular AI systems. Depending on your problem — be it sequential steps, parallel tasks, expert debates, or dynamic planning — you can mix and match patterns to fit the goal.</li><li>There’s no one-size-fits-all. Think of these as a <strong>toolbox</strong>, not a rulebook. And remember: these six are <strong>common and useful</strong>, but not exhaustive. As your agents get smarter and workflows get deeper, <strong>new hybrid patterns</strong> will naturally emerge.</li><li>Let the agents collaborate, iterate, and delegate — and you’ll unlock systems that feel less like tools and more like teammates.</li></ul><h3>If you like this topic :</h3><ol><li><strong>Clap</strong> this article 10+ times; that will really help the article reach more readers 👏</li><li>I’ll be back soon with follow-up articles diving into the actual LangFlow and/or LangGraph code that powers these patterns. If you’re a curious reader or developer and would like to contribute or collaborate, feel free to reach out.<strong><em>GitHub Repo</em></strong><em>: </em><a href="https://github.com/mukizonese/agentic-ai-demo/tree/feature/Iteration3-LangGraphAndLangFlow"><em>Agentic AI Demo</em></a></li><li>Follow me on <a href="https://medium.com/@mukesh.vast"><strong>Medium</strong></a> and/or <a href="http://linkedin.com/in/mukeshvast"><strong>LinkedIn</strong></a> and subscribe to get my latest article for Free🫶</li><li>Feel free to connect or drop a comment about the article !</li></ol><h3>Stay tuned for more AI explorations!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0867c614641" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/agentic-ai-communication-patterns-for-multi-agents-part-3-c0867c614641">Agentic AI : Communication Patterns for Multi-Agents (Part 3)</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agentic AI : How to move Multi-Agent Orchestration to No-Code Tools with LangGraph & LangFlow…]]></title>
            <link>https://levelup.gitconnected.com/agentic-ai-how-to-move-multi-agent-orchestration-to-no-code-tools-with-langgraph-langflow-e2da565bfc92?source=rss-469281ebde2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2da565bfc92</guid>
            <category><![CDATA[ai-orchestration]]></category>
            <category><![CDATA[langflow]]></category>
            <category><![CDATA[langgraph]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[multiagent-system]]></category>
            <dc:creator><![CDATA[Mukesh Vast]]></dc:creator>
            <pubDate>Mon, 07 Jul 2025 13:36:59 GMT</pubDate>
            <atom:updated>2026-01-28T02:41:29.342Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Agentic AI : How to move Multi-Agent Orchestration to No-Code Tools w</strong><em>ith Lang</em>Graph<em> &amp; Lang</em>Flow (Part 2)</h3><p><em>In this second part of our series, we explore how no-code and low-code tools like LangFlow and LangGraph help us offload the complexity of managing multi-agent systems. Instead of hand-coding orchestration logic, we show how visual and graph-based builders can make agent collaboration easier, faster and more scalable.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0N__vkqwFwh7nJplXC2GOg.png" /><figcaption>AI generated image</figcaption></figure><h3>1. Quick Recap</h3><p>In <a href="https://medium.com/gitconnected/agentic-ai-building-smarter-systems-with-multi-agent-collaboration-part-1-05a319b93d4f">Part 1 of this series,</a> we explored how Agentic AI lets us build smarter systems where multiple agents (support bots, product info bots, etc.) collaborate behind the scenes to handle complex user queries. We hand-wrote orchestration logic in Python:</p><pre>if intent == &quot;support&quot;:<br>    return support_agent.run(user_query)<br>elif intent == &quot;product_info&quot;:<br>    return product_agent.run(user_query)<br>else:<br>    return &quot;Sorry, I don&#39;t understand.&quot;</pre><p>This worked… at first. But as agents multiplied, so did the if-else chains, custom handlers, and test cases. That’s when we started looking for a better way — a <strong>visual, scalable, no-code/low-code solution</strong> to orchestrate our agents without drowning in glue code.</p><h3>2. Enter LangGraph &amp; LangFlow</h3><p>Both <strong>LangGraph</strong> and <strong>LangFlow</strong> help you build complex multi-agent systems:</p><ul><li>🌱 Without writing orchestration code by hand</li><li>🔗 By visually wiring up agents, routers and tool nodes</li><li>⏱️ And making changes in minutes, not hours</li></ul><h3>3. LangGraph: Minimal agent change, big orchestrator gain</h3><p>One of the most fascinating things about adopting <strong>LangGraph</strong> in our multi-agent system is this:<br> 👉 The individual agents (our ProductAppAgent and SupportAppAgent) stay almost exactly the same.<br> 👉 All the orchestration logic — the decision-making, routing, retries — moves into <strong>LangGraph’s orchestrator</strong>.</p><h3>3.1 LangGraph Code Snippets</h3><h4>3.1.1 Our agents stayed clean:</h4><p>Here’s what our ProductAppAgent looked like — no LangGraph specifics added:</p><pre>class ProductAppAgent:<br>    def __init__(self, llm_service):<br>        self.llm_service = llm_service<br>        # ... same as before<br>    <br>async def process_query(self, query: str):<br>        # Check if query is product-related, search, generate response<br>        # Same code as our Python orchestrator version</pre><p>Similarly, SupportAppAgent:</p><pre>class SupportAppAgent:<br>    def __init__(self, llm_service):<br>        self.llm_service = llm_service<br>        # ... same as before<br>  <br>async def process_query(self, query: str):<br>        # Same logic: classify, fetch support articles, generate response</pre><p>👉 We didn’t have to touch these classes when adopting LangGraph.</p><h4>3.1.2 The LangGraph magic lives in the orchestrator</h4><p>Here’s a simplified snippet of our LangGraphOrchestrator:</p><pre>from langgraph.graph import StateGraph, END<br><br>workflow = StateGraph(AgentState)<br>workflow.add_node(&quot;intent_detection&quot;, self._intent_detection_node)<br>workflow.add_node(&quot;support_agent&quot;, self._support_agent_node)<br>workflow.add_node(&quot;product_agent&quot;, self._product_agent_node)<br>workflow.add_node(&quot;fallback_handler&quot;, self._fallback_handler_node)<br>workflow.add_node(&quot;response_synthesis&quot;, self._response_synthesis_node)<br><br>workflow.set_entry_point(&quot;intent_detection&quot;)<br>workflow.add_conditional_edges(<br>    &quot;intent_detection&quot;,<br>    self._route_by_intent,<br>    {<br>        &quot;support_agent&quot;: &quot;support_agent&quot;,<br>        &quot;product_agent&quot;: &quot;product_agent&quot;,<br>        &quot;fallback_handler&quot;: &quot;fallback_handler&quot;<br>    }<br>)<br>workflow.add_edge(&quot;support_agent&quot;, &quot;response_synthesis&quot;)<br>workflow.add_edge(&quot;product_agent&quot;, &quot;response_synthesis&quot;)<br>workflow.add_edge(&quot;fallback_handler&quot;, &quot;response_synthesis&quot;)<br>workflow.add_edge(&quot;response_synthesis&quot;, END)<br><br>workflow.compile()</pre><p>👉 The <strong>graph nodes + edges handle everything</strong>:</p><ul><li>Intent detection → routes to agent</li><li>Agents → feed responses</li><li>Synthesis node → final response</li></ul><h3>3.2 What changed</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db03dcb5febe333da0b1ebfdd602945c/href">https://medium.com/media/db03dcb5febe333da0b1ebfdd602945c/href</a></iframe><h4>See the full working code</h4><p>👉 Our orchestrator.py, product_agent.py, support_agent.py and LangGraph setup:<br> <a href="https://github.com/mukizone/agentic-ai-demo/tree/feature/Iteration3-LangGraphAndLangFlow">📂 GitHub: Agentic AI Demo</a></p><h3>3.3 Key insight</h3><p>By adopting LangGraph:<br> — Our individual agent logic stayed focused and unchanged<br> — The orchestrator became modular, visualizable, and scalable<br> — We can easily add nodes like analytics, summarizers, or validators</p><h3>4. LangFlow — Visual Agent Orchestration</h3><p>LangFlow brings this graph idea into a drag-and-drop canvas:</p><ul><li>Drop your agents, routers, tools</li><li>Wire them together visually</li><li>Run or edit flows in real time</li></ul><h3><strong>4.1 Our LangFlow flow:</strong></h3><h4>The no-code magic</h4><p>In LangFlow, our multi-agent orchestration became:<br> — <strong>Chat Input node</strong> → receives user query<br> — <strong>Ollama LLM node</strong> → extracts intent like support or product_info<br> — <strong>Custom Router node</strong> → routes based on intent<br> — <strong>Agent nodes</strong> → handle support/product<br> — <strong>Output node</strong> → shows response</p><pre>Chat Input<br>  ↓<br>Ollama LLM (intent extractor)<br>  ↓<br>Custom Router Selector<br>  ↙︎          ↘︎<br>Product Agent   Support Agent<br>  ↓             ↓<br>Chat Output     Chat Output</pre><h4>4.1.1 <strong>LangFlow node connections :</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BM-IG3FzG8rPkQwasHA04g.png" /></figure><p>👉 You can see this actual flow in our repo:<br> 📄 <a href="https://github.com/mukizone/agentic-ai-demo/blob/feature/Iteration3-LangGraphAndLangFlow/langflow/flows/MultiAgentSelector.json">multi_agent_selector_flow.json</a></p><h4>4.1.2 LangFlow Custom Components :</h4><p>While LangFlow shines as a no-code visual builder, it also lets you add custom Python components using its API. This means you can extend flows with logic that would otherwise need hand-coded orchestration — but in a way that’s simple and pluggable.</p><p>For example, in our project we built a <strong>Custom Router</strong> component that parses intent and emits clean signals to agents:</p><pre>def support_path(self) -&gt; Message:<br>    intent = self._parse_intent()<br>    if intent == &quot;support&quot;:<br>        return Message(text=&quot;support&quot;)<br>    return Message(text=&quot;NO_OUTPUT&quot;)</pre><p>👉 i<em>ntegrated smoothly into our LangFlow canvas.</em></p><h3>5. Comparisions</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ccbe31bd5d7aa9d63d5e64fe72f52d9a/href">https://medium.com/media/ccbe31bd5d7aa9d63d5e64fe72f52d9a/href</a></iframe><h3>6. Hosting and Integration</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e836c3f3fd51029408435fc7f15039f8/href">https://medium.com/media/e836c3f3fd51029408435fc7f15039f8/href</a></iframe><p>👉 <strong>LangFlow</strong> is ideal for teams wanting rapid prototyping, demos, and low-code/visual orchestration with easy hosting.<br> 👉 <strong>LangGraph</strong> is for those needing production-grade orchestration baked into Python apps, where you control the logic end-to-end.</p><h3>7. Final Thoughts</h3><p>💡 If you’re building AI systems with multiple agents<em>, </em>whether you choose LangGraph or LangFlow:</p><ul><li>You can offload your multi-agent orchestration logic</li><li>Make your architecture cleaner and easier to scale</li><li>And empower non-engineers to collaborate!</li></ul><p>👀 Stay tuned for Part 3, where we’ll explore adding memory, feedback loops, and more advanced agent communication patterns!</p><h3>Stay tuned for more AI explorations!</h3><h3>If you like this topic :</h3><ol><li><strong>Clap</strong> my article 10+ times; that will really help me out.👏</li><li>Follow me on <a href="https://medium.com/@mukesh.vast"><strong>Medium</strong></a> and/or <a href="http://linkedin.com/in/mukeshvast"><strong>LinkedIn</strong></a> and subscribe to get my latest article for Free🫶</li><li>Feel free to connect or drop a comment!</li></ol><h3>Appendix</h3><h3>1. Other tools worth mentioning</h3><ul><li><strong>Flowise</strong>: Great for visual LangChain flows.</li><li><strong>Autogen Studio</strong>: Visualize multi-agent LangChain Autogen setups.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2da565bfc92" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/agentic-ai-how-to-move-multi-agent-orchestration-to-no-code-tools-with-langgraph-langflow-e2da565bfc92">Agentic AI : How to move Multi-Agent Orchestration to No-Code Tools with LangGraph &amp; LangFlow…</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agentic AI : Building Smarter Systems with Multi-Agent Collaboration (Part 1)]]></title>
            <link>https://levelup.gitconnected.com/agentic-ai-building-smarter-systems-with-multi-agent-collaboration-part-1-05a319b93d4f?source=rss-469281ebde2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/05a319b93d4f</guid>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-applications]]></category>
            <category><![CDATA[ai-development]]></category>
            <dc:creator><![CDATA[Mukesh Vast]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 12:08:43 GMT</pubDate>
            <atom:updated>2026-01-28T02:18:22.955Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://medium.com/gitconnected/agentic-ai-building-smarter-systems-with-multi-agent-collaboration-part-1-05a319b93d4f?source=your_stories_page--------------------------------------------">Agentic AI : Building Smarter Systems with Multi-Agent Collaboration (Part 1)</a></h3><p>We’ve all interacted with chatbots that just give canned responses. But what if AI could act like a smart team — deciding, collaborating, and helping without you spelling out each step? That’s where Agentic AI shines.</p><p>This article kicks off a series where we’ll break down:</p><ul><li>What <strong>Agentic AI</strong> is all about</li><li>How <strong>multi-agent systems</strong> work together to solve tasks</li><li>Real examples of how we built and extended our own agentic example.</li></ul><p>In future posts, we’ll dive deeper into tools, visual builders, advanced flows, and scaling strategies — but for now, let’s start with the core concepts and architecture that power our setup.</p><p><strong>If you don’t have medium account</strong>, read full article free <a href="https://bit.ly/4lhbywg"><strong><em>here</em></strong></a>. (no login needed)</p><h3>1. What is Agentic AI?</h3><p>Picture this: Instead of having just one chatbot that tries to do everything, what if you had a <strong>team of smart assistants</strong>, each with a specialty, working together behind the scenes to help you? That’s what <strong>Agentic AI</strong> is all about.</p><p>🌱 <strong>It’s AI that doesn’t just give answers — it takes action.</strong><br> Agentic AI breaks a task into smaller parts, delegates them to the right helper (we call them “agents”), and pulls everything together, all without you needing to guide each step. These agents aren’t just passive responders; they <strong>think, decide, and collaborate</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sF0rgh_7RwqIR_yy8bERFw.png" /></figure><p>👉 In our example, you’ll see this in action:</p><ul><li>A <strong>Support Agent</strong> knows how to handle account issues, like helping you reset your password.</li><li>A <strong>Product Agent</strong> fetches details about products, features, or pricing from APIs.</li><li>A smart orchestrator figures out which agent to activate, based on what you ask.</li></ul><p>💡 <strong>Why is this exciting?</strong><br> Because this type of AI can:<br> — Solve multi-step problems — not just give you one-off replies<br> — Call external APIs to get fresh data<br> — Trigger real actions, like looking up support articles or sending alerts<br> — Do it all automatically — no human micromanagement needed</p><h3>2. What is a Multi-Agent System?</h3><p>Think of a multi-agent system like a <strong>well-coordinated team</strong> working together to help you.</p><p>👥 Each agent plays a specific role:</p><ul><li>The <strong>Support Agent</strong> is your go-to for help with things like password resets or billing issues.</li><li>The <strong>Product Agent</strong> handles queries about features or recommendations.</li><li>(And you can add more agents easily — like one for analytics or customer feedback.)</li></ul><p>📣 These agents can communicate, share what they find, and hand off tasks. It’s like having different experts collaborating to get the job done faster and smarter than one big, overworked AI.</p><p><em>A good way to think of it: It’s like microservices, but for intelligence.</em><br> In fact, in our example, each agent is its own REST service — simple to extend, swap, or upgrade as your needs grow.</p><h3>3. Our Example in Action</h3><p>In our <strong>Agentic AI Example</strong>, when you type:</p><blockquote>“I forgot my password and need help logging in.”</blockquote><p>👉 The orchestrator spots that this is a support request.<br> 👉 It routes your message to the <strong>Support Agent</strong>, which queries the support API for the right help articles.<br> 👉 If you’d asked about product features instead, it would’ve activated the <strong>Product Agent</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*VCfkhcsDZXQ4V-63LgF-JQ.png" /><figcaption>Run from the github source code attached</figcaption></figure><p>📌 And here’s the magic:</p><ul><li>You can plug in new agents by just adding a handler — no need to rewrite the whole system.</li><li>Our <strong>LLM service (Ollama, HuggingFace, OpenAI — your choice!)</strong> figures out intent lightning-fast.</li><li>The <strong>Vector Service</strong> (which could be powered by ChromaDB, Pinecone, etc.) can help the agents do smarter lookups based on embeddings or past knowledge.</li></ul><h4>Why Does This Matter?</h4><p>In the real world, businesses don’t need <em>just</em> a chatbot — they need AI that can:<br> 🌟 Assist customers,<br> 🌟 Fetch live data,<br> 🌟 Power recommendations,<br> 🌟 Automate workflows — and scale as they grow.</p><p><strong>Agentic AI lets you build that kind of system, one agent at a time.</strong><br> It’s flexible, easy to extend, and ready for real-world challenges.</p><h3>4. Architecture at a Glance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pm87IzopEtUxCbGzpO5jAw.gif" /></figure><p><em>Each agent lives behind a clean FastAPI microservice. </em>Each piece is modular — you can add more agents, swap LLMs, or enhance vector search independently.</p><p>👉 <strong><em>Curious to see the code? Check out the </em></strong><a href="https://github.com/mukizone/agentic-ai-demo.git"><strong><em>GitHub repo</em></strong></a><strong><em>.</em></strong></p><h3>4.1 LLM Service — Intent and More</h3><p>This is the brain of our setup: the <strong>LLM Service</strong> (Large Language Model service).</p><p>👉 In our case, we used <strong>Ollama</strong> locally because it’s fast and easy to run during development. But the design allows us to hook in HuggingFace, OpenAI, or any other model platform just by changing the backend.<br><strong>Design Intent:</strong> Start fast with Ollama locally, scale to cloud LLMs when needed!</p><pre># llm_service.py<br>def get_intent(message):<br>    prompt = f&quot;&quot;&quot;<br>    Analyze this message and return the intent:<br>    User message: {message}<br>    Possible intents: support, product_info, general_question<br>    &quot;&quot;&quot;<br>    response = ollama.call(prompt).            # or huggingface.call(prompt)<br>    return parse_intent(response)</pre><p>🌱 <strong>Tip:</strong> This service isn’t just for intent detection — it could generate summaries, rewrite responses, or even draft replies!</p><h3>4.2 What’s the Orchestrator?</h3><p>Imagine you walk into a help center. Instead of talking to every specialist one by one, there’s a friendly receptionist who listens to you and figures out <strong>exactly who you should see first</strong>. That’s what our <strong>orchestrator</strong> does.</p><p>➡️ The orchestrator:</p><ul><li>Listens to the user’s input</li><li>Asks the LLM service to figure out the intent (is this a support question? product question? something else?)</li><li>Based on the intent, routes the task to the correct agent</li></ul><p>✨ <strong>Why is this powerful?</strong><br> Because adding new capabilities is as easy as adding new agents. Want to handle order tracking? Just create an <strong>Order Agent</strong> and let the orchestrator direct those queries!</p><p>💡 <strong>The orchestrator code is small but powerful.</strong></p><pre># orchestrator.py<br>intent = llm_service.get_intent(user_message)<br>if intent == &quot;product_info&quot;:<br>    result = product_agent_call(user_message)<br>elif intent == &quot;support&quot;:<br>    result = support_agent_call(user_message)<br>else:<br>    result = {&quot;result&quot;: &quot;I don&#39;t understand.&quot;}</pre><p>👉 <strong>Replaceable with Langflow or other visual orchestrators</strong><br> While this example implements orchestration logic in Python (simple and readable), the same logic could be offloaded to a no-code or low-code tool like <strong>Langflow</strong>, <strong>Flowise</strong> or <strong>LangGraph</strong>. These tools allow drag-and-drop orchestration and make it easier for teams to add new intents, agents, or tools without editing code. <a href="https://levelup.gitconnected.com/agentic-ai-how-to-move-multi-agent-orchestration-to-no-code-tools-with-langgraph-langflow-e2da565bfc92"><strong><em>Part2</em></strong></a> covers this in brief.</p><h3>4.3 Vector Service — Add AI Memory</h3><p>In our example, we introduced a <strong>Vector Service</strong> — a smart storage for what the agents know or discover.</p><p>💡 Think of it as giving your AI agents a <strong>memory </strong>— a place where it remembers past answers or similar cases, so it can respond faster next time.<br> Instead of searching the same info repeatedly, they can store key data (like support articles, product descriptions) as <strong>embeddings</strong> — mathematical representations of meaning.</p><p>➡️ When a user asks something, the agent can query the Vector Service:</p><pre># vector_service.py<br>def add_to_vector_store(text, metadata=None):<br>    embedding = get_embedding(text)<br>    chroma.add(embedding, metadata)<br><br>def search_similar(text):<br>    embedding = get_embedding(text)<br>    return chroma.query(embedding, top_k=3)</pre><p>🌟 <strong>Why does this matter?</strong><br> — It makes responses smarter by considering past knowledge<br> — It enables similarity searches — “What’s closest to this question?”<br> — It’s pluggable — today we use ChromaDB, but you could switch to Pinecone, Weaviate, or any vector DB</p><h3>4.4 How the Agents Work</h3><p>Each agent (like the Support Agent or Product Agent) is its own little microservice:</p><ul><li>It gets a task from the orchestrator</li><li>Calls the appropriate API (like your support app’s REST API)</li><li>Sends back a result</li></ul><p>➡️ Example call:</p><pre># product_agent.py<br>def call_product_agent(input_text):<br>    api_url = f&quot;http://product-app-api:8003//search//search/{input_text}&quot;<br>    response = requests.get(api_url)<br>    return response.json()<br><br># support_agent.py<br>def call_support_agent(input_text):<br>    api_url = f&quot;http://support-app-api:8003/support_articles/search/{input_text}&quot;<br>    response = requests.get(api_url)<br>    return response.json()</pre><p>✅ <em>Easy to extend with real DBs, external APIs, or business logic.</em></p><h3>5. Why This Design?</h3><p>We chose this design because:</p><ul><li>It’s <strong>modular</strong> — easy to extend with new agents</li><li>It’s <strong>real-world ready</strong> — can integrate with any REST API, database, or external service</li><li>It’s <strong>AI-enhanced</strong> — combining human-like reasoning (via LLM) with structured automation (via agents)</li></ul><p>And perhaps most importantly:<br> ➡️ <strong>You can start small and grow big</strong><br> Maybe you start with just support + product info, but tomorrow you add analytics, recommendations, even order tracking — no need to rebuild from scratch.</p><h3>Conclusion</h3><p>Agentic AI isn’t just another chatbot — it’s a blueprint for building intelligent assistants that can act, decide, and collaborate.</p><p>In our example, we’ve shown:<br> — How to create an orchestrator that understands what you want<br> — How to plug in multiple agents that handle tasks<br> — How to add memory with vectors<br> — How to use LLMs to power decision-making</p><p>👉 And the best part? You can extend it easily, or even connect it to visual tools like <strong>LangFlow/LangGraph</strong> to build agentic flows without writing code.In our <a href="https://levelup.gitconnected.com/agentic-ai-how-to-move-multi-agent-orchestration-to-no-code-tools-with-langgraph-langflow-e2da565bfc92"><strong><em>next article</em></strong></a>, we’ll explore <em>the same</em>.</p><p>👉 To read how agents talk to each other, check <a href="https://levelup.gitconnected.com/agentic-ai-communication-patterns-for-multi-agents-part-3-c0867c614641"><strong><em>part 3</em></strong></a><strong><em> </em></strong>that talks about AI communication patterns in details with simple examples.</p><h3>If you like this topic :</h3><ol><li><strong>Clap</strong> my article 10+ times; that will help reach this article further .👏</li><li>Follow me on <a href="https://medium.com/@mukesh.vast"><strong>Medium</strong></a> and/or <a href="http://linkedin.com/in/mukeshvast"><strong>LinkedIn</strong></a> and subscribe to get my latest article for Free🫶</li><li>Feel free to connect or drop a comment!</li></ol><h3>Stay tuned for more AI explorations!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05a319b93d4f" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/agentic-ai-building-smarter-systems-with-multi-agent-collaboration-part-1-05a319b93d4f">Agentic AI : Building Smarter Systems with Multi-Agent Collaboration (Part 1)</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>