<?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 Nasir Mahmood on Medium]]></title>
        <description><![CDATA[Stories by Nasir Mahmood on Medium]]></description>
        <link>https://medium.com/@naxirmahmood?source=rss-a9699fb5c96------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*lzwPVMFL7mvvv4ZG.jpeg</url>
            <title>Stories by Nasir Mahmood on Medium</title>
            <link>https://medium.com/@naxirmahmood?source=rss-a9699fb5c96------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:06:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@naxirmahmood/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[The Web Wasn’t Built for AI Agents. Here’s How to Fix It.]]></title>
            <link>https://naxirmahmood.medium.com/the-web-wasnt-built-for-ai-agents-here-s-how-to-fix-it-1a24d39d72f5?source=rss-a9699fb5c96------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a24d39d72f5</guid>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[agent-native]]></category>
            <dc:creator><![CDATA[Nasir Mahmood]]></dc:creator>
            <pubDate>Sun, 26 Apr 2026 11:49:43 GMT</pubDate>
            <atom:updated>2026-04-26T11:52:53.982Z</atom:updated>
            <content:encoded><![CDATA[<h4>Websites serve HTML to humans. They have no idea what to do when an AI comes knocking. That’s a solvable problem.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZOAom6-wOrlqBCDwQRLCQ.png" /></figure><p>Picture an AI agent with a simple job: order a pizza.</p><p>It navigates to a food delivery website. The server responds with 847 kilobytes of HTML — a navigation bar, a cookie consent modal, promotional banners, restaurant cards built from a dozen nested &lt;div&gt; elements, and a JavaScript bundle that has to execute before anything is even rendered. The agent parses all of it, tries to find the &quot;Add to Cart&quot; button, succeeds, places the order.</p><p>Three weeks later, the website ships a redesign. The agent breaks.</p><p>This is the state of AI agents on the web in 2025. Not because the technology is immature — the models are remarkable. But because websites were never designed to be called by machines. They were designed for eyes.</p><h3>The data is already there</h3><p>Here’s the thing: the information the agent needs — restaurant names, menu items, prices, order endpoints — exists on the server as clean, structured data. The HTML is just a presentation layer added on top for human consumption. We’re asking agents to reverse-engineer a process that the server itself already went through in the opposite direction.</p><p>Think about what happens when a backend developer builds a food ordering feature. They write a function that takes {query, location} and returns a list of restaurants. Then they write a template that renders those restaurants as HTML cards. Then an agent comes along and has to figure out which HTML cards represent restaurants, extract the data, and reconstruct the original structured objects.</p><p>We’re asking agents to undo the work the server already did. That’s absurd.</p><h3>What agents actually need</h3><p>The solution isn’t better HTML parsers or more clever prompting. It’s giving agents a different response entirely — one that was designed for them.</p><p>I built <strong>agentgate</strong> to do exactly this. It’s a Python library that website operators add to their FastAPI backend in a few lines. When an agent sends a single header — X-Agent-Request: true — the site stops serving HTML and starts serving something the agent can actually use.</p><p>What it serves is a manifest. A machine-readable description of everything the site can do, available at /.well-known/agent-manifest.json. The manifest includes every capability the site exposes, with full JSON Schema for inputs and outputs — auto-generated from Python type hints. No hand-written documentation. No API reference the agent has to parse. Just a contract, in a format any agent can understand at runtime.</p><pre>{<br>  &quot;name&quot;: &quot;FoodPanda&quot;,<br>  &quot;intents&quot;: [{<br>    &quot;name&quot;: &quot;search_restaurants&quot;,<br>    &quot;input_schema&quot;: {<br>      &quot;properties&quot;: {<br>        &quot;query&quot;: { &quot;type&quot;: &quot;string&quot; },<br>        &quot;location&quot;: { &quot;type&quot;: &quot;string&quot; }<br>      }<br>    }<br>  }],<br>  &quot;flows&quot;: [{<br>    &quot;name&quot;: &quot;order_food&quot;,<br>    &quot;orchestration&quot;: &quot;server&quot;,<br>    &quot;steps&quot;: [<br>      { &quot;name&quot;: &quot;search&quot;, &quot;entry&quot;: true, &quot;next_steps&quot;: [&quot;select&quot;] },<br>      { &quot;name&quot;: &quot;select&quot;, &quot;next_steps&quot;: [&quot;checkout&quot;] },<br>      { &quot;name&quot;: &quot;checkout&quot;, &quot;next_steps&quot;: [] }<br>    ]<br>  }]<br>}</pre><h3>Two primitives: intents and flows</h3><p>The manifest exposes two kinds of capabilities.</p><p><strong>Intents</strong> are single-step actions — search for a product, convert a currency, look up a tracking number. One request, one typed response. The server-side definition is a single decorated function:</p><pre>@agent_app.intent(&quot;search_restaurants&quot;)<br>async def search_restaurants(query: str, location: str) -&gt; list[Restaurant]:<br>    return db.search(query, location)</pre><p><strong>Flows</strong> are where it gets interesting. Most real-world agent tasks aren’t one step — they’re sequences. Ordering food is search, then select a restaurant, then add items to a cart, then check out. Agentgate models this explicitly as a named, ordered workflow:</p><pre>@agent_app.flow(&quot;order_food&quot;, orchestration=&quot;server&quot;)<br>class OrderFoodFlow:</pre><pre>    @step(entry=True)<br>    async def search(self, query: str, location: str) -&gt; list[Restaurant]:<br>        ...</pre><pre>    @step(after=&quot;search&quot;)<br>    async def select_restaurant(self, restaurant_id: str) -&gt; list[MenuItem]:<br>        ...</pre><pre>    @step(after=&quot;select_restaurant&quot;)<br>    async def checkout(self, items: list[CartItem], address: str) -&gt; OrderConfirmation:<br>        ...</pre><p>The server enforces the step order. An agent that tries to jump to checkout before completing search gets a clear, structured error — not a broken page or a silent failure.</p><h3>What it looks like from the agent’s perspective</h3><p>This is what an agent does with an agentgate-enabled site:</p><pre>client = AgentClient(agent_id=&quot;my-agent&quot;, api_key=&quot;sk-...&quot;)</pre><pre># Discover capabilities at runtime — no prior knowledge needed<br>site = await client.discover(&quot;https://foodpanda.com&quot;)</pre><pre># Start a flow and walk through it step by step<br>session = await site.flows.order_food.start()<br>restaurants = await session.step(&quot;search&quot;, query=&quot;pizza&quot;, location=&quot;Berlin&quot;)<br>menu = await session.step(&quot;select_restaurant&quot;, restaurant_id=restaurants[0][&quot;id&quot;])<br>order = await session.step(&quot;checkout&quot;, items=[...], address=&quot;Alexanderplatz 1&quot;)</pre><pre>print(session.is_complete)  # True</pre><p>No HTML. No DOM parsing. No fragile selectors that break on redesigns. The agent gets typed structured data at every step, and the server validates that the agent is walking the workflow in a valid order.</p><h3>A note on MCP</h3><p>If you’ve been following the AI tooling space, you may be thinking: <em>isn’t this what Model Context Protocol does?</em></p><p>MCP (Anthropic’s Model Context Protocol) is excellent — it solves a different problem. MCP connects an LLM to local tools and resources: file systems, databases, code execution environments, internal APIs. It’s a client-side protocol for expanding what a model can do within a session.</p><p>Agentgate is for the other direction: public websites on the open internet opting in to being structured and callable by agents. The two protocols address different layers of the stack and complement each other naturally. An agent can use MCP to access its own tools (memory, calendar, search) while using agentgate to interact with the external services it needs to call.</p><h3>The website operator’s perspective</h3><p>For the developer building the backend, the integration is minimal. You decorate your existing business logic functions and mount the agent layer onto your existing FastAPI app:</p><pre>agent_app = AgentApp(<br>    title=&quot;FoodPanda&quot;,<br>    auth=AuthDef(type=&quot;api_key&quot;, header=&quot;X-API-Key&quot;),<br>)</pre><pre># ... decorate your functions ...</pre><pre>fastapi_app = FastAPI()<br>agent_app.mount(fastapi_app)  # existing routes are completely untouched</pre><p>The normal website keeps working exactly as it did. Browsers see no change. Only requests with X-Agent-Request: true are routed to the agent API. The manifest is auto-generated — if you change a function&#39;s signature, the schema updates automatically on the next deploy.</p><h3>The bigger picture</h3><p>We’re in a period where AI agents are being given more and more responsibility on the web — booking travel, managing subscriptions, monitoring services, placing orders. The infrastructure under those agents still assumes a human is in the loop, clicking through pages designed for human eyes.</p><p>That assumption is breaking down. And patching it with better HTML parsers is the wrong answer — it’s treating the symptom while leaving the cause untouched.</p><p>The right answer is for websites to learn to speak agent. Not by replacing their human-facing interfaces, but by adding a parallel layer — just as they added mobile APIs alongside their desktop pages, and REST APIs alongside their server-rendered views.</p><p>Agentgate is an attempt to make that parallel layer easy to build and standard enough that agents can discover it without being told it’s there.</p><p><em>The library is open source, MIT licensed, and includes a full working example of a FoodPanda-style server and agent client.</em></p><p><em>→</em> <a href="https://github.com/NasirMalik/agentgate"><em>github.com/NasirMalik/agentgate</em></a></p><p><em>Feedback welcome — especially on the protocol design and whether the flow model maps to workflows you’re actually building.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a24d39d72f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS Application Architecture]]></title>
            <link>https://naxirmahmood.medium.com/ios-application-architecture-7607b367811d?source=rss-a9699fb5c96------2</link>
            <guid isPermaLink="false">https://medium.com/p/7607b367811d</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-architecture]]></category>
            <category><![CDATA[mvvm-c]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Nasir Mahmood]]></dc:creator>
            <pubDate>Sat, 03 Apr 2021 12:08:05 GMT</pubDate>
            <atom:updated>2021-04-13T10:00:14.153Z</atom:updated>
            <content:encoded><![CDATA[<h3>iOS App Architecture: MVVM-C at Scale</h3><p>Code Sample: <a href="https://github.com/NasirMalik/Eris">Here</a></p><p>During last one year there was a big task at hand, how to modularise application with an architecture that have following considerations.</p><ul><li>SOLID should be practised.</li><li>Code should be based on an architecture with less boilerplate code, thus an unofficial industry standard calledMVVM-C was obvious choice.</li><li>Every layer should be interfaced via dependency management and lays foundation for high level DI-Framework.</li><li>Code should be easilytestable and mocks can be easily replaced with original objects.</li><li>Project should be structured to scale, as big as it can be.</li><li>Folder structure should be highlighting the architecture.</li><li>Shared areas and team based divisions should be implemented as independent Modules (Swift Package)</li><li>Layers should be interfaced together via Protocols.</li><li>Architecture should be close to Android so that we can resolve problems at once and use on multiple platforms.</li><li>Code should be following iOS Swift Style Guidelines and have similar styling throughout the code.</li><li>Code should be easily extendable, maintainable and understandable.</li></ul><p>After discussions at length we came to a conclusion to bench mark the following architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w1dp0X27feRUtLhaNey4oA.png" /><figcaption>Architecture Reference</figcaption></figure><p>Unmarked arrows show ownership.</p><p>Its a <strong>MVVM-C</strong> architecture with few more layers to cater special needs. Layers are defined here.</p><h3>Coordinator</h3><p>Application Screen-flow and Push Routing handling should be done in this layer.</p><h3>Model</h3><p>Model acts as an entity. In <a href="https://github.com/NasirMalik/Eris/blob/main/Eris/Screens/Planet/Models/Models/Planet.swift">sample code</a> model is shared entity between Codable and NSManagedObject, thus needs some boiler-plate, as both APIs do not go along automatically.</p><h3>View</h3><p>Display of data can be done with Storyboard or in code. If Component based design system i-e <a href="https://github.com/amzn/style-dictionary">Style Dictionary</a> is under consideration in future, it’s better to go with code based user interfaces i-e UIKit in code or SwiftUI.</p><p>Data is being displayed in the form of Models (viewData/ViewModel). Views conform to Model Configurable to populate data via configure(model:) method.</p><h3>ViewController</h3><p>Controller contains logic of view’s state representation and pass actions to viewModel and listens for actions from viewModel.</p><h3>ViewModel</h3><ul><li>ViewModel is only stateful layer and does contains all the business logic, with or without the help of mappers.</li><li>Also it informs view-controller about the state update via bindings.</li><li>Bindings can be implemented by any method of your choice closures, delegates, observers, Combine, RxSwift and Promises etc.</li></ul><h3>Mapper/UseCases (Optional)</h3><p>Mapper are the Domain Usecases. Any domain logic will be injected in the form of independently tested usecases. Idea is to keep Domain-Layer independent from ViewModels thus can be widely reuseable. Also on higher level there can be an independent module of just mappers/usecases, written in a cross-platform technology i-e Kotlin Native and exported for both iOS and Android. This can set a foundation for shared domain logic between both platforms.</p><h3>Repository</h3><p>Its a facade and abstraction layer between ViewModel and Data Stores that encapsulates Data-source layer. Currently there are two data sources, Network and CoreData in example. This layer can also encapsulate further data sources i-e Firebase Remote Configurations etc.</p><h3>Interactor</h3><p>This layer interacts with network interface that fetches and decodes data. It’s a wrapper written on top of Swift Package Ceres which fetches and decodes data into inferred model object.</p><h3>Persister</h3><p>Persister encapsulates CoreData and fetches and updates data. [Edit] An (optional) abstraction protocol i-e Persister, can be placed between CoreDataService and Repository to make unit testing simpler.</p><h3>Other</h3><p>Other data sources can also be part of your repository, i-e Firebase remote config to turn features on/off or for giving arrangement of features in a particular flow etc.</p><h3>Sample Code:</h3><p>This architecture reference is backed with a sample project available <a href="https://github.com/NasirMalik/Eris"><strong>here</strong></a>. Please be critical and leave your comments here or create issues on Github.</p><h3>Conclusion</h3><p>There are tons of ways to create an application architecture, as there are no rights or wrongs, at the same time there are tradeoffs that can be expensive. Keeping expense to bare minimum and robustness as high as possible, it is an effort to introduce iOS app to modern modular architecture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7607b367811d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mobile System Design Interviews (iOS and Android)]]></title>
            <link>https://naxirmahmood.medium.com/mobile-system-design-interviews-ios-and-android-f5d360292c22?source=rss-a9699fb5c96------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5d360292c22</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[mobile-developer]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Nasir Mahmood]]></dc:creator>
            <pubDate>Wed, 07 Aug 2019 10:11:42 GMT</pubDate>
            <atom:updated>2019-08-09T23:37:42.934Z</atom:updated>
            <content:encoded><![CDATA[<p>Many people asked me how to prepare for a Mobile System Design interview. Here I will give you my personal experience about how I prepared and how I approached the problem during my interview with a well known FAANG company.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DBmXYch_wsfZEIqbVuhIwQ.jpeg" /><figcaption>Silicon Valley</figcaption></figure><p><strong>Overview</strong>.</p><p>Mobile system design interviews are not different than other general system design interviews. It’s just the order/approach that is needed to be amended to make it more mobile-centric. Thus all the knowledge that you get for system design interviews from books and youtube is equally applicable here as well.</p><p><strong>Preparation</strong>. <br>For a successful system design interview, most of your knowledge comes from your daily experiences. So just do brainstorming about your daily routine as a software developer and think about how you start with a problem. For preparation, as there are no dedicated mobile system design resources so you have to rely on all the sources people use to prepare for general system design interviews. I will not name any source here but for me, youtube videos were the biggest help. There are many examples of how to build URL shortener, how to build WhatsApp, how to design uber etc. Just go through them.</p><p>Understandably, you are a mobile developer but it doesn’t necessarily mean you are going to handle only front-end part of mobile application in the interview. So apart from the front end be ready for explaining a high-level overview of the backend, network communication, infrastructure, and even hardware.</p><p>Practice with a friend how to use whiteboard effectively to communicate a fully working system. This sounds easy but practically it’s much harder than you think. In the end, the interviewer will take a snapshot of your whiteboard so it should not be messy.</p><p><strong>Problem</strong>.<br>Example: “Design a ride-sharing service for three buildings of our tech campus”</p><p><strong>Approach</strong>.<br>Here is step by step approach of how to handle a mobile system design interview question.</p><ol><li><strong>Ask Questions</strong>: Start by asking clarification questions. Ask enough questions to give u a starting point. Listen to answers carefully and don’t repeat the same things in the next questions.</li><li><strong>Outline Features</strong>: Outline a few simple features that you are going to build. Ask the interviewer if he wants to add something to features. Turn your interview into a discussion rather than a one-way explanation. This will decrease the awkwardness and give you the comfort of effective communication.</li><li><strong>Wire-Frame</strong>: For mobile, your starting point is drawn wireframe. Think of any similar application and draw it in the simplest form. Don’t over complicate. Be incremental, don’t start by adding all the outlined features at once. Start simple and iterate to turn it into a fully functional system.</li><li><strong>Backend</strong>: Connect your front end with a backend. If you have used some specific kind of backend and you have good knowledge of it there is no harm in naming it. In the backend, you will be mentioning two things, server code (5) and database (6).</li><li><strong>Server</strong>: In the server code you will explain the necessary services required to make this system work. List them down and explain its functionality and reasons why we need it. Also, explain what kind of web-services you want to use and why.</li><li><strong>Database</strong>: In the database, you need to create all the required tables that are needed to handle data. Also, mention columns. Define relations if you want to go with relational databases. Also, mention why you choose the relational database over non-relational or vice versa.</li><li><strong>Hardware</strong>: As in the above example the autonomous vehicles need an embedded system to be part of this intra ride-sharing system. So you need to decide a communication protocol on which they will communicate to the main system. From the questions, you asked you will clarify the distance area and then you will decide between a GSM module or a Wifi based system or whatever u prefer. Also list-down and explain briefly features of your hardware system i-e communication with the server, locking/unlocking, location tracking, charging, etc.</li><li><strong>Scaleability</strong>: Now you need to explain how you need to scale this system up as traffic grows. For this part, general system design interview answers are fully applicable.</li><li><strong>Failure Points</strong>: Explain a few failure points and remedies to coup up with the issues for example vehicle going out of range or battery etc. You can explain this by adding a subsystem that will only handle failures and take necessary actions.</li><li><strong>Security</strong>: This is a broad topic but you just need to give a general overview of how you will handle security at the application side and on the vehicle side. If you have more detailed knowledge on this topic go with it.</li><li><strong>Payments</strong>: Ask the interviewer if users need to pay for using this service. If the interviewer says yes this is a very nice topic to spend your time during the interview. For this, you need to know PCI compliance and the procedure of using In-app-purchase/Apple pay or Google Pay.</li><li><strong>Wrapping up</strong>: After all these as you have covered quite a few areas you need to politely asked if he/she has any additional questions.</li><li><strong>Ask Questions</strong>: Now it’s your turn to ask questions. Be prepared with a few questions that depict your higher intellect and geekiness.</li></ol><p><strong>Conclusion</strong>:<br>During the 45–60 mins of your interview you need to keep it detailed, interesting, engaging and enlightening. It’s your chance to shine and with little preparedness and confidence, you can ace it.</p><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYxBP_WV7LI6zc-zdUkNqQ.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5d360292c22" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>