<?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 Shrirang Edgaonkar on Medium]]></title>
        <description><![CDATA[Stories by Shrirang Edgaonkar on Medium]]></description>
        <link>https://medium.com/@shrirangedgaonkar?source=rss-23d3d2a35f38------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*s0HqnS0Eq17Ria_0.jpg</url>
            <title>Stories by Shrirang Edgaonkar on Medium</title>
            <link>https://medium.com/@shrirangedgaonkar?source=rss-23d3d2a35f38------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 13:48:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shrirangedgaonkar/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[AI Readiness Is More Than LLM Credits: A Practical Starting Point for Engineering Teams]]></title>
            <link>https://medium.com/@shrirangedgaonkar/ai-readiness-is-more-than-llm-credits-a-practical-starting-point-for-engineering-teams-05c08770ae22?source=rss-23d3d2a35f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/05c08770ae22</guid>
            <category><![CDATA[dl]]></category>
            <category><![CDATA[ai-learning]]></category>
            <category><![CDATA[course]]></category>
            <category><![CDATA[mls]]></category>
            <dc:creator><![CDATA[Shrirang Edgaonkar]]></dc:creator>
            <pubDate>Sat, 26 Sep 2026 09:26:59 GMT</pubDate>
            <atom:updated>2026-09-26T09:33:16.398Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Shrirang Edgaonkar</em></p><p>Organizations are moving quickly to make AI available to their engineering teams. They buy subscriptions, distribute API keys, and set aside hundreds of dollars in model credits. Then they wait for productivity to appear.</p><p>Often, it does not.</p><p>Developers try a few prompts, generate a prototype, hit unfamiliar failure modes, and return to the tools and habits they already know. The problem is rarely a lack of access to a model. It is the gap between access and capability.</p><h3>The first question is: where do we start?</h3><p>For many engineering teams, the AI journey begins with a simple but difficult question: <em>What should I learn first?</em> The internet offers an overwhelming number of free lectures, courses, books, notebooks, and tutorials. Paid programs add more choices, but busy developers often need a clear, time-bounded route rather than another enormous catalogue.</p><p>Here are 12 credible free starting points. This is a curated shortlist, not a count of every free AI resource on the internet. Course access and certificate or exam fees can differ, so check each provider’s current terms.</p><ol><li><a href="https://developers.google.com/machine-learning/crash-course">Google Machine Learning Crash Course</a> — visual, interactive ML fundamentals and exercises.</li><li><a href="https://see.stanford.edu/Course/CS229">Stanford Engineering Everywhere: CS229</a> — lectures and course materials for a rigorous ML foundation.</li><li><a href="https://ai.stanford.edu/stanford-ai-courses/">Stanford AI courses</a> — recorded AI and deep learning courses, including CS230.</li><li><a href="https://nptel.ac.in/">NPTEL</a> — courses taught by faculty from IITs and IISc; learning access is free, while certification exams may have a fee.</li><li><a href="https://course.fast.ai/">fast.ai: Practical Deep Learning for Coders</a> — a practical, code-first course for people with programming experience.</li><li><a href="https://d2l.ai/">Dive into Deep Learning</a> — an open, interactive book with explanations and runnable code.</li><li><a href="https://huggingface.co/learn">Hugging Face course</a> — hands-on material for transformers, NLP, and the Hugging Face ecosystem.</li><li><a href="https://ocw.mit.edu/">MIT OpenCourseWare</a> — open course materials; search for machine learning, deep learning, and related prerequisites.</li><li><a href="https://pytorch.org/tutorials/">PyTorch tutorials</a> — official examples for learning and building with PyTorch.</li><li><a href="https://scikit-learn.org/stable/user_guide.html">scikit-learn user guide</a> — practical reference and examples for classical machine learning.</li><li><a href="https://www.kaggle.com/learn">Kaggle Learn</a> — short, hands-on lessons in Python, data, and machine learning.</li><li><a href="https://www.elementsofai.com/">Elements of AI</a> — an accessible introduction to AI concepts and their implications.</li><li><a href="https://www.youtube.com/watch?v=1ctqJCHMAmc">100 days of machine learning https://www.youtube.com/watch?v=1ctqJCHMAmc</a></li><li>100 days of deep learning <a href="https://www.youtube.com/results?search_query=100+days+of+deep+learning">https://www.youtube.com/results?search_query=100+days+of+deep+learning</a></li></ol><p>A long list still does not solve the real problem: turning learning into a habit. Teams need an intentional path. Start with foundations, practice on small datasets, then build a narrow use case and evaluate it. Do not ask everyone to watch everything. ML and DL learning needs time. One has to go back to school days to learn probability, statistics and linear algebra. The topics you put for option then will come at you again but they are interesting. Being curious to learn them helps the most than having burden to learn them again.</p><h3>AI is not just another programming language</h3><p>A developer can learn the syntax of a new language and start shipping small changes quickly. AI systems demand a different kind of understanding. Their behavior depends on data, probability, training, evaluation, and uncertainty. A model can be confidently wrong, perform well on one sample and poorly on another, or degrade when the data or context changes.</p><p>That does not mean every engineer must become a machine learning researcher before using an LLM. Teams can build useful applications with hosted models and APIs. But responsible AI implementation requires more than knowing how to call an API. Engineers need enough ML literacy to ask good questions about data quality, model behavior, evaluation, limitations, privacy, and risk. Deeper ML and deep learning knowledge matters when a team is selecting, adapting, or operating models rather than simply integrating a service.</p><p>Without that foundation, a prompt that looks impressive in a demo can be mistaken for a reliable product. “It worked once” is not an evaluation strategy.</p><h3>Credits are access, not readiness</h3><p>Giving a team access to hundreds of dollars of LLM credits can be a useful experiment. But credits alone can lead to what many call <em>vibe coding</em>: generating code through repeated prompts without a clear problem, sound engineering checks, or a way to measure whether the result works.</p><p>The output may be a flashy prototype with no owner, no test strategy, no user evidence, and no path to production. After a few frustrating cycles, developers may conclude that AI is more trouble than it is worth and return to manual development.</p><p>That outcome is not proof that AI has no value. It is evidence that access was mistaken for enablement.</p><h3>What organizations can do instead</h3><p>A practical readiness program gives teams three things:</p><ul><li>Protected learning time: a short, guided sequence covering core ML ideas, practical deep learning, and modern model use.</li><li>A real engineering problem: a small, bounded use case connected to an existing workflow, with a user and a measurable outcome.</li><li>Review and evaluation: code review, tests, representative examples, failure analysis, privacy checks, and a clear decision about whether to continue.</li></ul><p>Track outcomes such as time saved, quality, error rates, and developer confidence — not the number of prompts or dollars spent. Make it safe to stop experiments that do not help.</p><h3>Good teaching matters</h3><p>High-quality instruction can make a substantial difference. Faculty and teachers with subject depth and a genuine commitment to teaching can make difficult ideas understandable, connect theory to practice, and help learners develop judgment — not just copy code from a notebook.</p><p>Programs from leading institutes in India, including IITs and IISc through NPTEL, are one valuable route. They are not the only route, and a prestigious name alone does not guarantee that a course fits a team’s needs. Evaluate the syllabus, exercises, support, workload, and relevance to the work engineers actually do.</p><p>Commercial training providers can also offer structure, feedback, and accountability. Assess them carefully: look at the curriculum, the instructor’s experience, the hands-on work, the claims being made, and what learners can demonstrate afterward. Marketing promises deserve scrutiny; useful teaching deserves recognition wherever it comes from.</p><h3>Readiness is a capability, not a purchase</h3><p>Organizations do not become AI-ready by buying model credits, subscriptions, or a course catalogue. They become ready by helping people learn, giving them meaningful problems to solve, and building the engineering practices that make results measurable and dependable.</p><p>For engineering teams, the first step is not “use more AI.” It is to learn enough to choose where AI belongs, build a small thing carefully, and know whether it worked.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05c08770ae22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an AI-Native SDLC: From Codebase to Context-Aware Engineering]]></title>
            <link>https://medium.com/@shrirangedgaonkar/building-an-ai-native-sdlc-from-codebase-to-context-aware-engineering-e4e8a30dc437?source=rss-23d3d2a35f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4e8a30dc437</guid>
            <dc:creator><![CDATA[Shrirang Edgaonkar]]></dc:creator>
            <pubDate>Fri, 11 Sep 2026 06:18:37 GMT</pubDate>
            <atom:updated>2026-09-11T06:18:37.162Z</atom:updated>
            <content:encoded><![CDATA[<p>Building an AI-Native SDLC: From Codebase to Context-Aware Engineering</p><p>Most teams adopting AI for software delivery begin at the most visible layer: a coding assistant that can read a file, suggest a change, or generate a test. That is useful, but it is not yet an AI-enabled software development life cycle.</p><p><em>AI native SDLC architecture</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*GmtYYYT_OTAvsCcTLwBYHA.png" /></figure><p>An AI-native SDLC needs to understand more than source code. It needs to work within the team’s engineering conventions, connect work to tickets and knowledge, reason about architecture, and use specialized capabilities safely. In other words, it needs <em>context</em> — organized, accessible, and relevant to the task at hand.</p><p>The architecture below offers a practical way to think about that system. It moves upward from the codebase through semantic understanding, purpose-built AI models, organizational knowledge, project tooling, and finally an execution harness. On either side, it connects to technology-specific and domain-specific sources of truth.</p><h3>The foundation: the codebase is necessary, but not sufficient</h3><p>Every engineering assistant starts with the repository. It contains the implementation, tests, configuration, documentation, and often the clearest record of how a product actually works.</p><p>But raw code is a poor interface for reasoning at scale. A model that only sees files as text can miss important relationships: which function calls which service, where a data model is defined, whether a change affects a public API, or how a module fits into the wider architecture.</p><p>That is why the first step above the codebase is a <strong>semantic layer for reading source code in AST format</strong>.</p><h3>Give AI a semantic view of software</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*aZSMXrl5sRN_y4B38IN0jw.png" /><figcaption><em>From source code to semantic structure</em></figcaption></figure><p><em>From source code to semantic structure</em></p><p>An abstract syntax tree (AST) represents code by structure rather than by lines of text. Functions, classes, imports, method calls, types, and control flow become explicit entities an AI system can inspect and navigate.</p><p>This changes the quality of assistance dramatically. Instead of asking an agent to “search the repository and guess,” we can help it answer more precise questions:</p><p>· Which services depend on this API?</p><p>· Where is this field written and read?</p><p>· What tests exercise this method?</p><p>· Which modules would be affected by replacing this library?</p><p>The semantic layer is the bridge between generative AI and reliable code intelligence. It makes code retrieval more targeted, provides better context for code reviews and refactoring, and reduces the risk of changes based on superficial pattern matching.</p><h3>Add focused models where general reasoning is not enough</h3><p>A general-purpose model is excellent at conversation, synthesis, and many coding tasks. Yet certain software-delivery problems are repetitive, measurable, and rich in historical signals. They deserve specialized models.</p><p>Examples include:</p><p>· <strong>Defect deduplication:</strong> determine whether a newly filed issue is genuinely new or a variation of an existing defect.</p><p>· <strong>Reopen-risk prediction:</strong> identify issues likely to return after an apparently successful fix.</p><p>· <strong>Intelligent triage:</strong> route tickets using signals from component ownership, error patterns, severity, and similar past work.</p><p>These custom AI models should not replace engineers’ judgment. Their role is to prioritize attention, surface evidence, and make high-volume operational work less tedious. A useful design principle is to combine their predictions with explanations and links to the underlying code, incidents, or historical tickets.</p><h3>Turn organizational history into a graph, not a pile of documents</h3><p><em>Connected organizational knowledge</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*TbMYmqGLWJB1tIdKOhU1UA.png" /><figcaption><em>Connected organizational knowledge</em></figcaption></figure><p>Engineering context is scattered. It lives in Confluence pages, issue trackers, architecture diagrams, incident reports, pull requests, and the heads of experienced engineers.</p><p>The diagram’s <strong>graph layer</strong> addresses this problem by connecting past Confluence pages, tickets, domain objects, and architecture correlations. This is important because software knowledge is relational.</p><p>For example, a production issue may connect to:</p><p>· a service in the repository,</p><p>· a design decision recorded months ago,</p><p>· several related tickets,</p><p>· an owning team,</p><p>· a dependency that recently changed, and</p><p>· a business domain object affected by the failure.</p><p>A graph allows an AI agent to follow those connections rather than treating each document as an isolated search result. When an engineer asks why a component exists, what has failed before, or who should review a change, the system can retrieve an evidence-backed path through the organization’s knowledge.</p><p>This is where an AI assistant begins to feel less like a chatbot and more like an engineering colleague with institutional memory.</p><h3>Make the platform fit the project, not the other way around</h3><p>No two repositories are identical. Each has its own build commands, deployment model, quality gates, naming conventions, ownership rules, and operational habits.</p><p>That is the purpose of the <strong>project-specific toolset, hooks, and skills</strong> layer. It gives an AI agent a controlled set of project-aware ways to act. A project might expose skills for running the right test suite, validating an API contract, checking migration safety, querying logs, or preparing a release note.</p><p>Hooks can add guardrails at key moments. Before a proposed change is accepted, for example, the system can require linting, unit tests, security checks, policy validation, or a human approval step. The AI becomes more useful because it acts through the same delivery practices the team already trusts.</p><p>The goal is not to give an agent unrestricted access. The goal is to make the safe and correct path the easiest path.</p><h3>The harness: where AI work becomes dependable engineering work</h3><p><em>A controlled path from request to verified change</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*Qfl3HE90lpWasPBbI0mOpw.png" /><figcaption><em>A controlled path from request to verified change</em></figcaption></figure><p>At the top sits the <strong>harness</strong>, equipped with built-in tools such as file search, pattern matching, and editing. This is the execution environment that lets an AI agent investigate a problem, gather context, make a bounded change, and verify its result.</p><p>Think of the harness as the operating system for agentic work. It coordinates tool use, controls permissions, keeps a trace of actions, and enables repeatable workflows such as:</p><p>1. Read a ticket and retrieve related history from the graph.</p><p>2. Map the request to affected code using the semantic layer.</p><p>3. Inspect the relevant files and tests.</p><p>4. Make a proposed change through approved project tools.</p><p>5. Run checks and present the evidence for review.</p><p>Without a harness, AI remains a text-generation feature. With one, it can participate in an engineering workflow with observable actions and clear boundaries.</p><h3>Connect both the technology and the business domain</h3><p>The two side integrations in the architecture are easy to overlook, but they are essential.</p><p><strong>Technology-specific web fetching</strong> brings in knowledge about frameworks, libraries, APIs, standards, and vendor documentation. It helps an agent work accurately in the technologies that surround the codebase.</p><p><strong>Domain-specific web fetching</strong> brings in the language and facts of the business: regulations, product rules, industry terminology, customer workflows, and domain data. This prevents technically valid changes that are wrong for the business.</p><p>Together, these integrations let the platform reason across three worlds: the implementation, the technology ecosystem, and the business domain.</p><h3>What this architecture enables</h3><p>When these layers work together, common SDLC activities become richer and more reliable.</p><p>An engineer investigating a defect can receive a concise map of affected code, similar historical tickets, relevant architecture decisions, likely duplicate reports, and the appropriate verification steps. A reviewer can see not only a diff, but also impacted interfaces and related domain rules. A new team member can ask questions in natural language and get answers grounded in repository structure and internal knowledge.</p><p>The key outcome is not autonomous coding for its own sake. It is reducing the distance between a question, the context required to answer it, and a verified engineering action.</p><h3>A sensible path to adoption</h3><p>This architecture does not need to arrive all at once. Most teams should start with a secure harness and a high-quality code-semantic layer. Next, add project-specific tools and guardrails for the workflows that consume the most engineering time. Then connect tickets and internal knowledge, gradually building the graph of relationships. Specialized models can follow once enough labeled history and measurable outcomes exist.</p><p>At every stage, preserve human accountability. Make sources visible, keep agent permissions narrow, log actions, and measure whether the system improves outcomes such as lead time, defect recurrence, review quality, and developer experience.</p><h3>The real shift: context becomes an engineering capability</h3><p>AI in software development will not be defined by who has the most impressive autocomplete. It will be defined by who can make trustworthy context available at the moment work is done.</p><p>An AI-native SDLC combines structured code understanding, organizational memory, focused intelligence, project-aware tools, and a controlled execution harness. The result is a system that can help engineers move faster without asking them to trade away rigor, safety, or the knowledge embedded in how their organization actually builds software.</p><p>That is the opportunity: not to automate engineering away, but to give every engineer better context, better leverage, and more time for the decisions that genuinely require human judgment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4e8a30dc437" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A2UI — A protocol for agent driven interfaces]]></title>
            <link>https://medium.com/@shrirangedgaonkar/a2ui-a-protocol-for-agent-driven-interfaces-b0290257183c?source=rss-23d3d2a35f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0290257183c</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[a2ui]]></category>
            <dc:creator><![CDATA[Shrirang Edgaonkar]]></dc:creator>
            <pubDate>Sat, 05 Sep 2026 11:18:10 GMT</pubDate>
            <atom:updated>2026-09-05T11:18:10.742Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A2UI — A protocol for agent driven interfaces</strong></p><p>As agentic applications have made progress, most of them provide a chat interface to the end users. These chat interfaces need prompts to interact with the underlying tools and model in order to get the output. Primarily it is a text input and a text output. Of course multimodal prompts are possible as well but we are more concerned with text based interactions here.</p><p>Text output responses are becoming increasing boring as they dont provide a visual interface and reading a long text is not intuitive as well. The model reasons beautifully, calls three tools, and then has to <em>tell you something</em>. So it prints a paragraph. If it needs a decision from you, it prints a paragraph with numbered options and asks you to type “2”.</p><p>That is the last-mile problem. The agent is smart, and the surface it talks through is a teletype. The obvious fix — let the agent generate HTML and JavaScript — is the reason nobody has shipped it. The moment a client executes model output, every prompt injection in every retrieved document becomes a code-execution path on someone’s machine. We have different tech stacks and the HTML, CSS and Javascript for each tech stack could be different depending on the library with which it was built.</p><p>A2UI takes a third route. The agent streams a <em>declarative description</em> of the interface as JSON. The client reads the description and draws it using widgets it already had. Nothing the agent sends is ever executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a6b3aso6X2kDgQBwqjSsig.png" /><figcaption>Fig 1 — Plain text is safe but dead. Generated code is alive but dangerous. A2UI sends component <em>names</em>, which the client looks up in an allow-list it controls.</figcaption></figure><p>That gate in the third lane is the whole idea. It is called a <strong>catalog</strong>, and everything else in the protocol follows from it.</p><h3>Five nouns</h3><p>Before the message flow, five words. They are the entire vocabulary.</p><p><strong>Surface</strong> — One addressable region of UI, identified by a surfaceId. An agent can have several open at once.</p><p><strong>Catalog</strong> — A JSON Schema document listing (from fig. 1 above) every component the agent may name — Text, Row, Column, Card, Button, TextField, Slider, Tabs, Modal, List — and every function it may call. The client publishes it; the agent is bound by it. A name that isn’t in the catalog is an error, with no fallback to smuggle one in.</p><p><strong>Component</strong> — One node: an id, a component type, some props, and references to child ids.</p><p><strong>Data model</strong> — One JSON tree per surface, addressed by JSON Pointer (/user/name, /cart/items/0/price). Components hold <em>pointers into it</em>, not copies of values. This data model will be filled up at the client side.</p><p><strong>Action</strong> — The message that travels back the other way when the user actually does something.</p><h3>The protocol in eight steps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hLkl2kJxPgveKeiouY53GA.png" /><figcaption>Fig 2 — The full round trip. Steps 2–4 build the surface once; steps 5–8 are the loop it lives in.</figcaption></figure><p><strong>The user asks for something</strong></p><p>An ordinary prompt. The agent decides a UI is the better answer than a paragraph.</p><p><strong>createSurface</strong></p><p>The agent opens a surface and names the catalog it intends to draw from. This must come first for that surfaceId; anything addressed to a surface that doesn’t exist is an error.</p><p><strong>updateComponents</strong></p><p>Components stream out as a flat list, not a nested tree — parent–child links are id references. This is the most consequential design choice in the protocol for anyone generating UI with an LLM: the model never has to close a deep bracket structure correctly, components may arrive in any order, and one that references a child which hasn’t arrived yet renders a placeholder instead of throwing. Half a stream still draws half a screen.</p><p><strong>updateDataModel</strong></p><p>The state the components point at. Upsert semantics — creates if absent, updates if present, null deletes.</p><p><strong>The renderer assembles</strong></p><p>It resolves id references into a tree, resolves JSON Pointers into values, and maps each component name to <em>its own</em> native widget. The same agent output renders as React on the web, Flutter on mobile, native controls on desktop — and inherits the host app’s theme, because the host owns the widgets.</p><p><strong>The user interacts — and the agent is not involved</strong></p><p>Typing into a bound TextField updates the renderer’s local copy of the data model immediately. Validation checks run locally; a Button whose checks fail disables itself. Not one network round trip per keystroke, and no model tokens burned on a form the user is still filling in.</p><p><strong>action</strong></p><p>Only when the user commits — a click, a submit — does anything cross the wire. The renderer resolves the pointers named in the action’s context and sends the values.</p><p><strong>The agent patches</strong></p><p>It replies with updateDataModel or updateComponents against the same surface, and we are back at step 5. deleteSurface ends it.</p><p>The shape worth noticing: the agent builds the UI once and edits state thereafter. Steps 5–8 can run for minutes on a few dozen bytes.</p><h3>Structure and state arrive separately</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dQdcdmsW03bkbBEFK9mVuw.png" /><figcaption>Fig 3 — Two independent inputs, joined late at the renderer. This is why an update costs one line instead of a re-render.</figcaption></figure><p>This separation is what makes the protocol cheap to run. A naive “agent generates UI” approach regenerates markup on every change, so the model re-emits the whole screen — slow, expensive, and visibly flickery.</p><p>In A2UI, structure and state are different messages against different addresses. Change a value and you send one JSON Pointer patch. Every component bound to that pointer updates. Nothing else moves.</p><p>And because two components can point at the same path, they cannot disagree — the input that writes /user/name and the text that reads it are looking at one slot, not at two copies somebody has to keep in sync.</p><h3>Three examples, static to live</h3><blockquote>One — A read-only card</blockquote><h4>Prompt: What’s happening with order 4417?</h4><p>Agent → client · JSONL, one message per line</p><pre>{&quot;version&quot;:&quot;v1.0&quot;,&quot;createSurface&quot;:{<br>  &quot;surfaceId&quot;:&quot;order_4417&quot;,<br>  &quot;catalogId&quot;:&quot;https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json&quot;}}<br><br>{&quot;version&quot;:&quot;v1.0&quot;,&quot;updateComponents&quot;:{&quot;surfaceId&quot;:&quot;order_4417&quot;,&quot;components&quot;:[<br>  {&quot;id&quot;:&quot;root&quot;,   &quot;component&quot;:&quot;Card&quot;,   &quot;child&quot;:&quot;body&quot;},<br>  {&quot;id&quot;:&quot;body&quot;,   &quot;component&quot;:&quot;Column&quot;, &quot;children&quot;:[&quot;title&quot;,&quot;status&quot;,&quot;eta&quot;]},<br>  {&quot;id&quot;:&quot;title&quot;,  &quot;component&quot;:&quot;Text&quot;,   &quot;text&quot;:&quot;Order #4417&quot;, &quot;variant&quot;:&quot;h3&quot;},<br>  {&quot;id&quot;:&quot;status&quot;, &quot;component&quot;:&quot;Text&quot;,   &quot;text&quot;:{&quot;path&quot;:&quot;/order/status&quot;}},<br>  {&quot;id&quot;:&quot;eta&quot;,    &quot;component&quot;:&quot;Text&quot;,   &quot;text&quot;:{&quot;path&quot;:&quot;/order/eta&quot;}, &quot;variant&quot;:&quot;caption&quot;}<br>]}}<br><br>{&quot;version&quot;:&quot;v1.0&quot;,&quot;updateDataModel&quot;:{&quot;surfaceId&quot;:&quot;order_4417&quot;,&quot;value&quot;:{<br>  &quot;order&quot;:{&quot;status&quot;:&quot;Out for delivery&quot;,&quot;eta&quot;:&quot;Arriving Tuesday, 8 Sep&quot;}}}}</pre><p>What renders</p><pre>┌──────────────────────────────┐<br>│  Order #4417                 │<br>│  Out for delivery            │<br>│  Arriving Tuesday, 8 Sep     │<br>└──────────────────────────────┘</pre><p>Note what is <em>not</em> here: no colours, no fonts, no spacing values. Card, Column and variant: &quot;h3&quot; are semantic requests. The client decides what an h3 looks like, which is why one message looks right in a dark-mode desktop app and on a light-mode phone.</p><p>Twenty minutes later the courier arrives. The agent does not redraw the card:</p><pre>{&quot;version&quot;:&quot;v1.0&quot;,&quot;updateDataModel&quot;:{<br>  &quot;surfaceId&quot;:&quot;order_4417&quot;,&quot;path&quot;:&quot;/order/status&quot;,&quot;value&quot;:&quot;Delivered&quot;}}</pre><p>One line. The status Text re-renders; nothing else is touched.</p><blockquote>Two — An interactive form, with the round trip</blockquote><h4>Prompt: I need to change my delivery address.</h4><p>Agent → client</p><pre>{&quot;version&quot;:&quot;v1.0&quot;,&quot;createSurface&quot;:{<br>  &quot;surfaceId&quot;:&quot;addr_edit&quot;,<br>  &quot;catalogId&quot;:&quot;https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json&quot;,<br>  &quot;sendDataModel&quot;:true}}<br><br>{&quot;version&quot;:&quot;v1.0&quot;,&quot;updateComponents&quot;:{&quot;surfaceId&quot;:&quot;addr_edit&quot;,&quot;components&quot;:[<br>  {&quot;id&quot;:&quot;root&quot;,&quot;component&quot;:&quot;Card&quot;,&quot;child&quot;:&quot;col&quot;},<br>  {&quot;id&quot;:&quot;col&quot;,&quot;component&quot;:&quot;Column&quot;,&quot;children&quot;:[&quot;h&quot;,&quot;street&quot;,&quot;zip&quot;,&quot;save&quot;]},<br><br>  {&quot;id&quot;:&quot;h&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:&quot;Update delivery address&quot;,&quot;variant&quot;:&quot;h4&quot;},<br><br>  {&quot;id&quot;:&quot;street&quot;,&quot;component&quot;:&quot;TextField&quot;,<br>   &quot;label&quot;:&quot;Street address&quot;,<br>   &quot;value&quot;:{&quot;path&quot;:&quot;/addr/street&quot;},<br>   &quot;checks&quot;:[{&quot;condition&quot;:{&quot;call&quot;:&quot;required&quot;,&quot;args&quot;:{&quot;value&quot;:{&quot;path&quot;:&quot;/addr/street&quot;}}},<br>              &quot;message&quot;:&quot;Street address is required&quot;}]},<br><br>  {&quot;id&quot;:&quot;zip&quot;,&quot;component&quot;:&quot;TextField&quot;,<br>   &quot;label&quot;:&quot;Postal code&quot;,<br>   &quot;value&quot;:{&quot;path&quot;:&quot;/addr/zip&quot;},<br>   &quot;checks&quot;:[{&quot;condition&quot;:{&quot;call&quot;:&quot;regex&quot;,&quot;args&quot;:{&quot;value&quot;:{&quot;path&quot;:&quot;/addr/zip&quot;},<br>                                                  &quot;pattern&quot;:&quot;^[0-9]{6}$&quot;}},<br>              &quot;message&quot;:&quot;Enter a 6-digit postal code&quot;}]},<br><br>  {&quot;id&quot;:&quot;save&quot;,&quot;component&quot;:&quot;Button&quot;,&quot;variant&quot;:&quot;primary&quot;,&quot;child&quot;:&quot;save_label&quot;,<br>   &quot;action&quot;:{&quot;event&quot;:{&quot;name&quot;:&quot;saveAddress&quot;,<br>     &quot;context&quot;:{&quot;street&quot;:{&quot;path&quot;:&quot;/addr/street&quot;},<br>                &quot;zip&quot;:   {&quot;path&quot;:&quot;/addr/zip&quot;}}}}},<br>  {&quot;id&quot;:&quot;save_label&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:&quot;Save address&quot;}<br>]}}<br><br>{&quot;version&quot;:&quot;v1.0&quot;,&quot;updateDataModel&quot;:{&quot;surfaceId&quot;:&quot;addr_edit&quot;,&quot;value&quot;:{<br>  &quot;addr&quot;:{&quot;street&quot;:&quot;12 Baner Road&quot;,&quot;zip&quot;:&quot;411045&quot;}}}}</pre><p>What renders</p><pre>┌────────────────────────────────────┐<br>│  Update delivery address           │<br>│                                    │<br>│  Street address                    │<br>│  ┌──────────────────────────────┐  │<br>│  │ 12 Baner Road                │  │<br>│  └──────────────────────────────┘  │<br>│  Postal code                       │<br>│  ┌──────────────────────────────┐  │<br>│  │ 411045                       │  │<br>│  └──────────────────────────────┘  │<br>│                                    │<br>│         [  Save address  ]         │<br>└────────────────────────────────────┘</pre><p>Now the user clears the postal code and types 4110. The renderer writes &quot;4110&quot; to /addr/zip, runs the regex check, fails it, shows <em>“Enter a 6-digit postal code”</em> under the field, and disables the button. The agent has heard nothing. No tokens, no latency, no round trip — the rule was declared once and lives on the client.</p><p>They fix it to 411057 and click Save. <em>Now</em> one message goes back:</p><p>Client → agent</p><pre>{&quot;version&quot;:&quot;v1.0&quot;,&quot;action&quot;:{<br>  &quot;surfaceId&quot;:&quot;addr_edit&quot;,<br>  &quot;event&quot;:{&quot;name&quot;:&quot;saveAddress&quot;,<br>           &quot;context&quot;:{&quot;street&quot;:&quot;12 Baner Road&quot;,&quot;zip&quot;:&quot;411057&quot;}}}}</pre><p>The {&quot;path&quot;: …} references have been resolved into values. And because the surface was created with sendDataModel: true, the complete data model rides along in the transport metadata — so the agent sees the whole state of the form, not only the fields it thought to ask for.</p><p>The agent writes to the database and confirms, again without redrawing anything:</p><pre>{&quot;version&quot;:&quot;v1.0&quot;,&quot;updateComponents&quot;:{&quot;surfaceId&quot;:&quot;addr_edit&quot;,&quot;components&quot;:[<br>  {&quot;id&quot;:&quot;col&quot;,&quot;component&quot;:&quot;Column&quot;,&quot;children&quot;:[&quot;h&quot;,&quot;street&quot;,&quot;zip&quot;,&quot;save&quot;,&quot;done&quot;]},<br>  {&quot;id&quot;:&quot;done&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:&quot;✓ Saved&quot;,&quot;variant&quot;:&quot;caption&quot;}<br>]}}</pre><p>Re-sending col with a longer children array is enough — components are upserted by id.</p><blockquote>Three — A result list with a map beside it</blockquote><h4>Prompt: Show me vegetarian restaurants in Indiranagar Bangalore.</h4><p>The agent does the real work first: geocode Indiranagar, query a places API, filter to vegetarian. That is MCP’s job. A2UI starts when there are results and they have to be <em>shown</em>.</p><p><strong>First problem: </strong>there is no Map component</p><p>The basic catalog stops at Text, Row, Column, Card, List, Image, Button and the input widgets. There is no map in it, and no way to smuggle one in — an agent that emits &quot;component&quot;:&quot;Map&quot; against the basic catalog gets an error. That is the allow-list from Figure 1 doing precisely what it is for.</p><p>A map means a custom catalog. Here is the entire extension — three components and two functions. Everything else on this screen stays basic-catalog. ($refs to the shared type definitions are abbreviated as … for readability.)</p><pre>{<br>  &quot;$schema&quot;:&quot;https://json-schema.org/draft/2020-12/schema&quot;,<br>  &quot;$id&quot;:&quot;https://acme.example.com/catalogs/places.json&quot;,<br>  &quot;protocolVersion&quot;:&quot;1.0&quot;,<br>  &quot;catalogId&quot;:&quot;https://acme.example.com/catalogs/places.json&quot;,<br>  &quot;title&quot;:&quot;Places&quot;,<br>  &quot;instructions&quot;:&quot;Put Map as the second child of a Row so the list sits on the left. Give every result a MapMarker. Keep markers under 25 — beyond that, cluster server-side.&quot;,<br><br>  &quot;components&quot;:{<br>    &quot;Map&quot;:{<br>      &quot;type&quot;:&quot;object&quot;,<br>      &quot;properties&quot;:{<br>        &quot;component&quot;:{&quot;const&quot;:&quot;Map&quot;},<br>        &quot;centerLat&quot;:{&quot;$ref&quot;:&quot;…#/$defs/DynamicNumber&quot;},<br>        &quot;centerLng&quot;:{&quot;$ref&quot;:&quot;…#/$defs/DynamicNumber&quot;},<br>        &quot;zoom&quot;:{&quot;$ref&quot;:&quot;…#/$defs/DynamicNumber&quot;},<br>        &quot;children&quot;:{&quot;$ref&quot;:&quot;…#/$defs/ChildList&quot;}},<br>      &quot;required&quot;:[&quot;component&quot;,&quot;centerLat&quot;,&quot;centerLng&quot;,&quot;children&quot;],<br>      &quot;allowedChildren&quot;:[&quot;MapMarker&quot;]},<br><br>    &quot;MapMarker&quot;:{<br>      &quot;type&quot;:&quot;object&quot;,<br>      &quot;properties&quot;:{<br>        &quot;component&quot;:{&quot;const&quot;:&quot;MapMarker&quot;},<br>        &quot;lat&quot;:{&quot;$ref&quot;:&quot;…#/$defs/DynamicNumber&quot;},<br>        &quot;lng&quot;:{&quot;$ref&quot;:&quot;…#/$defs/DynamicNumber&quot;},<br>        &quot;label&quot;:{&quot;$ref&quot;:&quot;…#/$defs/DynamicString&quot;},<br>        &quot;selected&quot;:{&quot;$ref&quot;:&quot;…#/$defs/DynamicBoolean&quot;},<br>        &quot;action&quot;:{&quot;$ref&quot;:&quot;…#/$defs/Action&quot;}},<br>      &quot;required&quot;:[&quot;component&quot;,&quot;lat&quot;,&quot;lng&quot;],<br>      &quot;allowedParents&quot;:[&quot;Map&quot;]},<br><br>    &quot;SelectableCard&quot;:{<br>      &quot;type&quot;:&quot;object&quot;,<br>      &quot;properties&quot;:{<br>        &quot;component&quot;:{&quot;const&quot;:&quot;SelectableCard&quot;},<br>        &quot;selected&quot;:{&quot;$ref&quot;:&quot;…#/$defs/DynamicBoolean&quot;},<br>        &quot;action&quot;:{&quot;$ref&quot;:&quot;…#/$defs/Action&quot;},<br>        &quot;child&quot;:{&quot;$ref&quot;:&quot;…#/$defs/ComponentId&quot;}},<br>      &quot;required&quot;:[&quot;component&quot;,&quot;child&quot;]}<br>  },<br><br>  &quot;functions&quot;:{<br>    &quot;select&quot;:{<br>      &quot;returnType&quot;:&quot;void&quot;,<br>      &quot;allowedCallers&quot;:&quot;rendererOnly&quot;,<br>      &quot;properties&quot;:{&quot;call&quot;:{&quot;const&quot;:&quot;select&quot;},<br>        &quot;args&quot;:{&quot;type&quot;:&quot;object&quot;,&quot;required&quot;:[&quot;id&quot;],<br>                &quot;properties&quot;:{&quot;id&quot;:{&quot;$ref&quot;:&quot;…#/$defs/DynamicString&quot;}}}}},<br><br>    &quot;isSelected&quot;:{<br>      &quot;returnType&quot;:&quot;boolean&quot;,<br>      &quot;allowedCallers&quot;:&quot;rendererOrAgent&quot;,<br>      &quot;properties&quot;:{&quot;call&quot;:{&quot;const&quot;:&quot;isSelected&quot;},<br>        &quot;args&quot;:{&quot;type&quot;:&quot;object&quot;,&quot;required&quot;:[&quot;id&quot;],<br>                &quot;properties&quot;:{&quot;id&quot;:{&quot;$ref&quot;:&quot;…#/$defs/DynamicString&quot;}}}}}<br>  }<br>}</pre><p>Two details in there carry real weight.</p><p>select is declared rendererOnly. It writes /ui/selectedId on the client, and the agent can never invoke it — a callRendererFunction naming select comes back as INVALID_FUNCTION_CALL. The agent can populate the map; it cannot reach in and move the user’s cursor around it.</p><p>MapMarker declares allowedParents: [&quot;Map&quot;]. A model that reasonably-but-wrongly puts a marker inside the Column gets UNALLOWED_PARENT from the renderer instead of a marker floating in the sidebar.</p><p>Note also instructions — free prose aimed at the LLM generating the UI. It ships inside the schema, so the guidance and the constraint can’t drift apart.</p><p><strong>The surface</strong></p><pre>{&quot;version&quot;:&quot;v1.0&quot;,&quot;createSurface&quot;:{<br>  &quot;surfaceId&quot;:&quot;veg_indiranagar&quot;,<br>  &quot;catalogId&quot;:&quot;https://acme.example.com/catalogs/places.json&quot;,<br>  &quot;sendDataModel&quot;:true,<br><br>  &quot;components&quot;:[<br>    {&quot;id&quot;:&quot;root&quot;,&quot;component&quot;:&quot;Column&quot;,&quot;children&quot;:[&quot;hd&quot;,&quot;sub&quot;,&quot;chips&quot;,&quot;split&quot;]},<br>    {&quot;id&quot;:&quot;hd&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:&quot;Vegetarian · Indiranagar&quot;,&quot;variant&quot;:&quot;h4&quot;},<br>    {&quot;id&quot;:&quot;sub&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:{&quot;path&quot;:&quot;/meta/summary&quot;},&quot;variant&quot;:&quot;caption&quot;},<br><br>    {&quot;id&quot;:&quot;chips&quot;,&quot;component&quot;:&quot;Row&quot;,&quot;justify&quot;:&quot;start&quot;,&quot;children&quot;:[&quot;c_all&quot;,&quot;c_jain&quot;,&quot;c_south&quot;]},<br>    {&quot;id&quot;:&quot;c_all&quot;,&quot;component&quot;:&quot;Button&quot;,&quot;variant&quot;:&quot;secondary&quot;,&quot;child&quot;:&quot;c_all_t&quot;,<br>     &quot;action&quot;:{&quot;event&quot;:{&quot;name&quot;:&quot;filterBy&quot;,&quot;context&quot;:{&quot;tag&quot;:&quot;all&quot;}}}},<br>    {&quot;id&quot;:&quot;c_all_t&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:&quot;All&quot;},<br>    {&quot;id&quot;:&quot;c_jain&quot;,&quot;component&quot;:&quot;Button&quot;,&quot;variant&quot;:&quot;secondary&quot;,&quot;child&quot;:&quot;c_jain_t&quot;,<br>     &quot;action&quot;:{&quot;event&quot;:{&quot;name&quot;:&quot;filterBy&quot;,&quot;context&quot;:{&quot;tag&quot;:&quot;jain&quot;}}}},<br>    {&quot;id&quot;:&quot;c_jain_t&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:&quot;Jain&quot;},<br>    {&quot;id&quot;:&quot;c_south&quot;,&quot;component&quot;:&quot;Button&quot;,&quot;variant&quot;:&quot;secondary&quot;,&quot;child&quot;:&quot;c_south_t&quot;,<br>     &quot;action&quot;:{&quot;event&quot;:{&quot;name&quot;:&quot;filterBy&quot;,&quot;context&quot;:{&quot;tag&quot;:&quot;south_indian&quot;}}}},<br>    {&quot;id&quot;:&quot;c_south_t&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:&quot;South Indian&quot;},<br><br>    {&quot;id&quot;:&quot;split&quot;,&quot;component&quot;:&quot;Row&quot;,&quot;align&quot;:&quot;stretch&quot;,&quot;children&quot;:[&quot;listcol&quot;,&quot;map&quot;]},<br><br>    {&quot;id&quot;:&quot;listcol&quot;,&quot;component&quot;:&quot;Column&quot;,&quot;children&quot;:[&quot;list&quot;]},<br>    {&quot;id&quot;:&quot;list&quot;,&quot;component&quot;:&quot;List&quot;,&quot;direction&quot;:&quot;vertical&quot;,<br>     &quot;children&quot;:{&quot;path&quot;:&quot;/results&quot;,&quot;componentId&quot;:&quot;card&quot;}},<br><br>    {&quot;id&quot;:&quot;card&quot;,&quot;component&quot;:&quot;SelectableCard&quot;,&quot;child&quot;:&quot;card_row&quot;,<br>     &quot;selected&quot;:{&quot;call&quot;:&quot;isSelected&quot;,&quot;args&quot;:{&quot;id&quot;:{&quot;path&quot;:&quot;id&quot;}}},<br>     &quot;action&quot;:{&quot;functionCall&quot;:{&quot;call&quot;:&quot;select&quot;,&quot;args&quot;:{&quot;id&quot;:{&quot;path&quot;:&quot;id&quot;}}}}},<br>    {&quot;id&quot;:&quot;card_row&quot;,&quot;component&quot;:&quot;Row&quot;,&quot;justify&quot;:&quot;spaceBetween&quot;,&quot;align&quot;:&quot;center&quot;,<br>     &quot;children&quot;:[&quot;thumb&quot;,&quot;info&quot;,&quot;dirs&quot;]},<br>    {&quot;id&quot;:&quot;thumb&quot;,&quot;component&quot;:&quot;Image&quot;,&quot;url&quot;:{&quot;path&quot;:&quot;photo&quot;},&quot;fit&quot;:&quot;cover&quot;},<br>    {&quot;id&quot;:&quot;info&quot;,&quot;component&quot;:&quot;Column&quot;,&quot;children&quot;:[&quot;nm&quot;,&quot;mt&quot;,&quot;tg&quot;]},<br>    {&quot;id&quot;:&quot;nm&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:{&quot;path&quot;:&quot;name&quot;},&quot;variant&quot;:&quot;h5&quot;},<br>    {&quot;id&quot;:&quot;mt&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;variant&quot;:&quot;caption&quot;,<br>     &quot;text&quot;:&quot;${rating} ★ · ₹${costForTwo} for two · ${distanceKm} km&quot;},<br>    {&quot;id&quot;:&quot;tg&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:{&quot;path&quot;:&quot;cuisine&quot;},&quot;variant&quot;:&quot;caption&quot;},<br>    {&quot;id&quot;:&quot;dirs&quot;,&quot;component&quot;:&quot;Button&quot;,&quot;variant&quot;:&quot;secondary&quot;,&quot;child&quot;:&quot;dirs_t&quot;,<br>     &quot;action&quot;:{&quot;functionCall&quot;:{&quot;call&quot;:&quot;openUrl&quot;,&quot;args&quot;:{&quot;url&quot;:&quot;${mapUrl}&quot;}}}},<br>    {&quot;id&quot;:&quot;dirs_t&quot;,&quot;component&quot;:&quot;Text&quot;,&quot;text&quot;:&quot;Directions&quot;},<br><br>    {&quot;id&quot;:&quot;map&quot;,&quot;component&quot;:&quot;Map&quot;,<br>     &quot;centerLat&quot;:{&quot;path&quot;:&quot;/map/lat&quot;},<br>     &quot;centerLng&quot;:{&quot;path&quot;:&quot;/map/lng&quot;},<br>     &quot;zoom&quot;:{&quot;path&quot;:&quot;/map/zoom&quot;},<br>     &quot;children&quot;:{&quot;path&quot;:&quot;/results&quot;,&quot;componentId&quot;:&quot;pin&quot;}},<br><br>    {&quot;id&quot;:&quot;pin&quot;,&quot;component&quot;:&quot;MapMarker&quot;,<br>     &quot;lat&quot;:{&quot;path&quot;:&quot;lat&quot;}, &quot;lng&quot;:{&quot;path&quot;:&quot;lng&quot;},<br>     &quot;label&quot;:{&quot;call&quot;:&quot;@index&quot;,&quot;args&quot;:{&quot;offset&quot;:1}},<br>     &quot;selected&quot;:{&quot;call&quot;:&quot;isSelected&quot;,&quot;args&quot;:{&quot;id&quot;:{&quot;path&quot;:&quot;id&quot;}}},<br>     &quot;action&quot;:{&quot;functionCall&quot;:{&quot;call&quot;:&quot;select&quot;,&quot;args&quot;:{&quot;id&quot;:{&quot;path&quot;:&quot;id&quot;}}}}}<br>  ],<br><br>  &quot;dataModel&quot;:{<br>    &quot;meta&quot;:{&quot;summary&quot;:&quot;6 places within 1.5 km · open now&quot;},<br>    &quot;map&quot;:{&quot;lat&quot;:12.9784,&quot;lng&quot;:77.6408,&quot;zoom&quot;:15},<br>    &quot;ui&quot;:{&quot;selectedId&quot;:null},<br>    &quot;results&quot;:[<br>      {&quot;id&quot;:&quot;r1&quot;,&quot;name&quot;:&quot;Halli Mane Tiffin Room&quot;,&quot;rating&quot;:4.4,&quot;costForTwo&quot;:350,<br>       &quot;distanceKm&quot;:0.4,&quot;cuisine&quot;:&quot;South Indian · Pure veg&quot;,&quot;lat&quot;:12.9761,&quot;lng&quot;:77.6371,<br>       &quot;photo&quot;:&quot;https://cdn.example.com/r1.jpg&quot;,&quot;mapUrl&quot;:&quot;https://maps.example.com/?q=r1&quot;},<br>      {&quot;id&quot;:&quot;r2&quot;,&quot;name&quot;:&quot;Rasavathi Jain Kitchen&quot;,&quot;rating&quot;:4.6,&quot;costForTwo&quot;:600,<br>       &quot;distanceKm&quot;:0.9,&quot;cuisine&quot;:&quot;North Indian · Jain · No onion-garlic&quot;,<br>       &quot;lat&quot;:12.9812,&quot;lng&quot;:77.6402,<br>       &quot;photo&quot;:&quot;https://cdn.example.com/r2.jpg&quot;,&quot;mapUrl&quot;:&quot;https://maps.example.com/?q=r2&quot;},<br>      {&quot;id&quot;:&quot;r3&quot;,&quot;name&quot;:&quot;The Green Fig&quot;,&quot;rating&quot;:4.2,&quot;costForTwo&quot;:900,<br>       &quot;distanceKm&quot;:1.2,&quot;cuisine&quot;:&quot;Continental · Vegetarian&quot;,&quot;lat&quot;:12.9799,&quot;lng&quot;:77.6455,<br>       &quot;photo&quot;:&quot;https://cdn.example.com/r3.jpg&quot;,&quot;mapUrl&quot;:&quot;https://maps.example.com/?q=r3&quot;},<br>      {&quot;id&quot;:&quot;r4&quot;,&quot;name&quot;:&quot;Satvik Bhojanalaya&quot;,&quot;rating&quot;:4.3,&quot;costForTwo&quot;:420,<br>       &quot;distanceKm&quot;:1.4,&quot;cuisine&quot;:&quot;Gujarati thali · Jain&quot;,&quot;lat&quot;:12.9738,&quot;lng&quot;:77.6418,<br>       &quot;photo&quot;:&quot;https://cdn.example.com/r4.jpg&quot;,&quot;mapUrl&quot;:&quot;https://maps.example.com/?q=r4&quot;}<br>    ]}}}</pre><p>What renders</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJQp_MRlxqFjrjvPFcBO-Q.png" /><figcaption>Fig 3— One Row, two children. Both iterate the same /results array, so the cards and the pins can never disagree about what is on screen. Listings are invented for the example.</figcaption></figure><p>The List and the Map sit side by side and never reference each other. They are siblings in a Row that happen to iterate the same path. That is the entire integration.</p><p>Note label: {&quot;call&quot;:&quot;@index&quot;,&quot;args&quot;:{&quot;offset&quot;:1}} on the marker — @index is the basic catalog’s universal function for a row’s position in its collection, and the offset turns 0-based into the 1, 2, 3, 4 you see on the pins and in the card badges. The agent never numbered anything.</p><p>Tapping a pin never reaches the agent</p><p>The user taps pin 2 — or card 2, it makes no difference. The renderer runs select, which writes &quot;r2&quot; to /ui/selectedId. Then:</p><ul><li>every card’s selected prop re-evaluates isSelected against its own row — row 2 turns true, and that card gets the highlighted treatment;</li><li>every pin’s selected re-evaluates the same way — pin 2 grows and opens its callout.</li></ul><p>One write to one path, two components in two different subtrees, redrawn in sync. Not a byte crosses the network, and select being rendererOnly means the agent could not have been told even if it wanted to be.</p><p>This is Figure 3’s claim doing real work. The list and the map are coupled <em>only</em> through a JSON Pointer. Had the agent been holding the selection state, every tap would be a round trip — and on a flaky connection in a moving auto-rickshaw, a map whose pins highlight 800 ms after you tap them is a broken map.</p><p>Filtering <em>does</em> reach the agent</p><p>Tapping Jain is a different kind of act: the client cannot filter the array itself, because it doesn’t know what “Jain” means. So the chip carries an event :</p><pre>{&quot;version&quot;:&quot;v1.0&quot;,&quot;action&quot;:{<br>  &quot;surfaceId&quot;:&quot;veg_indiranagar&quot;,<br>  &quot;event&quot;:{&quot;name&quot;:&quot;filterBy&quot;,&quot;context&quot;:{&quot;tag&quot;:&quot;jain&quot;}}}}</pre><p>Note the literal &quot;jain&quot; in context. Dynamic* properties accept a literal, a path, or a function call, so a chip can name its own meaning without first parking it in the data model.</p><p>The agent re-queries and patches two paths:</p><pre>{&quot;version&quot;:&quot;v1.0&quot;,&quot;updateDataModel&quot;:{&quot;surfaceId&quot;:&quot;veg_indiranagar&quot;,&quot;path&quot;:&quot;/results&quot;,<br> &quot;value&quot;:[<br>   {&quot;id&quot;:&quot;r2&quot;,&quot;name&quot;:&quot;Rasavathi Jain Kitchen&quot;,&quot;rating&quot;:4.6,&quot;costForTwo&quot;:600,<br>    &quot;distanceKm&quot;:0.9,&quot;cuisine&quot;:&quot;North Indian · Jain · No onion-garlic&quot;,<br>    &quot;lat&quot;:12.9812,&quot;lng&quot;:77.6402,<br>    &quot;photo&quot;:&quot;https://cdn.example.com/r2.jpg&quot;,&quot;mapUrl&quot;:&quot;https://maps.example.com/?q=r2&quot;},<br>   {&quot;id&quot;:&quot;r4&quot;,&quot;name&quot;:&quot;Satvik Bhojanalaya&quot;,&quot;rating&quot;:4.3,&quot;costForTwo&quot;:420,<br>    &quot;distanceKm&quot;:1.4,&quot;cuisine&quot;:&quot;Gujarati thali · Jain&quot;,&quot;lat&quot;:12.9738,&quot;lng&quot;:77.6418,<br>    &quot;photo&quot;:&quot;https://cdn.example.com/r4.jpg&quot;,&quot;mapUrl&quot;:&quot;https://maps.example.com/?q=r4&quot;}]}}<br><br>{&quot;version&quot;:&quot;v1.0&quot;,&quot;updateDataModel&quot;:{&quot;surfaceId&quot;:&quot;veg_indiranagar&quot;,<br> &quot;path&quot;:&quot;/meta/summary&quot;,&quot;value&quot;:&quot;2 Jain-friendly places · open now&quot;}}</pre><p>The cards drop to two and the pins drop to two, from a message that never mentions the map. Both children of the Row iterate /results; patch the array and they move together. Roughly 600 bytes, and not one of the twenty component definitions was re-sent.</p><p>Compare an agent regenerating HTML for the same interaction: header, chips, four card blocks, map container, marker markup and the styling for all of it — every time someone taps a filter.</p><p>Directions</p><pre>&quot;action&quot;:{&quot;functionCall&quot;:{&quot;call&quot;:&quot;openUrl&quot;,&quot;args&quot;:{&quot;url&quot;:&quot;${mapUrl}&quot;}}}</pre><p>functionCall actions execute on the renderer and never reach the agent at all. openUrl is a basic-catalog function; the client resolves ${mapUrl} against that row and hands it to the OS. No hop, no tokens, no latency — and because openUrl had to be declared in a catalog with an allowedCallers value, the agent could not have pointed it anywhere the client hadn’t already sanctioned.</p><h3>What v1.0 adds</h3><p>The four messages above — createSurface, updateComponents, updateDataModel, deleteSurface — are the protocol as of v0.9.1, the current stable spec.</p><p>v1.0, a candidate at the time of writing, makes the channel symmetric. Either side can now call a function on the other and wait for a result: the agent sends callRendererFunction and gets back rendererFunctionResponse; the renderer sends callAgentFunction and gets back agentFunctionResponse. Calls correlate by functionCallId.</p><p>Every function in a catalog declares an allowedCallers value — rendererOnly, agentOnly, or rendererOrAgent — and a call that violates it returns INVALID_FUNCTION_CALL rather than executing. The allow-list principle from Figure 1, applied to behaviour as well as to components.</p><p>v1.0 also lets a surface be instantiated in a single message (components and data inline on createSurface), drops some hardcoded branding properties, and enforces UAX #31 naming for all identifiers.</p><p>Further reading</p><ul><li><a href="https://a2ui.org/introduction/what-is-a2ui/">What is A2UI?</a></li><li><a href="https://a2ui.org/specification/v1.0-a2ui/">v1.0 specification</a> · <a href="https://a2ui.org/specification/v0.9.1-a2ui/">v0.9.1, current stable</a></li><li><a href="https://a2ui.org/concepts/data-binding/">Concepts: data binding</a> · <a href="https://a2ui.org/reference/components/">Component reference</a></li><li><a href="https://a2ui.org/guides/defining-your-own-catalog/">Defining your own catalog</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0290257183c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Performance techniques in DB2]]></title>
            <link>https://medium.com/@shrirangedgaonkar/sql-performance-techniques-in-db2-f44954ef67e2?source=rss-23d3d2a35f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/f44954ef67e2</guid>
            <category><![CDATA[sql-performance-tuning]]></category>
            <category><![CDATA[db2]]></category>
            <dc:creator><![CDATA[Shrirang Edgaonkar]]></dc:creator>
            <pubDate>Sun, 22 Sep 2024 13:31:23 GMT</pubDate>
            <atom:updated>2024-09-22T13:31:23.401Z</atom:updated>
            <content:encoded><![CDATA[<p>SQL performance tuning in DB2 is crucial to ensure efficient query execution and to optimize the performance of database applications. Here are several techniques with examples and explanations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*gcVJTJVkIO0K3M1HrMnYuQ.png" /></figure><h3>1. Indexing</h3><ul><li><strong>Technique</strong>: Create indexes on columns that are frequently used in WHERE, JOIN, or GROUP BY clauses.</li><li><strong>Explanation</strong>: Indexes speed up data retrieval by reducing the number of rows DB2 has to scan. However, over-indexing can degrade performance during INSERT or UPDATE operations because indexes need to be updated.</li><li><strong>Example</strong>:</li></ul><pre>CREATE INDEX idx_employee_name ON employee (last_name);</pre><ul><li><strong>Use Case</strong>: If a query frequently searches for employees by their last name, creating an index on the last_name column will speed up such queries.</li></ul><h3>2. Optimize SQL Queries</h3><ul><li><strong>Technique</strong>: Rewrite inefficient SQL queries to minimize processing.</li><li><strong>Explanation</strong>: Optimizing SQL queries involves simplifying complex queries, avoiding unnecessary subqueries, and ensuring proper usage of joins.</li><li><strong>Example</strong>:</li></ul><p>Inefficient query</p><pre>SELECT * FROM employee WHERE salary &gt; (SELECT AVG(salary) FROM employee);</pre><p>Optimized query</p><pre>WITH avg_salary AS (SELECT AVG(salary) AS avg_sal FROM employee)<br>SELECT * FROM employee WHERE salary &gt; (SELECT avg_sal FROM avg_salary);</pre><p><strong>Use Case</strong>: The optimized query reduces the need to repeatedly calculate the average salary for each row.</p><h3>3. Proper Use of Joins</h3><ul><li><strong>Technique</strong>: Use appropriate join types and filter early using WHERE clauses.</li><li><strong>Explanation</strong>: Joining large tables can be resource-intensive. DB2 optimizes join operations, but using the correct join type (INNER JOIN, LEFT JOIN, etc.) and applying filters as early as possible in the query can improve performance.</li><li>Example:</li></ul><pre>SELECT e.employee_id, e.last_name, d.department_name<br>FROM employee e<br>INNER JOIN department d ON e.department_id = d.department_id<br>WHERE e.salary &gt; 50000;</pre><p><strong>Use Case</strong>: By filtering rows with the WHERE clause, fewer rows need to be processed in the join.</p><h3>4. Runstats and Reorg</h3><ul><li><strong>Technique</strong>: Use the RUNSTATS and REORG utilities regularly to maintain up-to-date statistics and reorganize table data.</li><li><strong>Explanation</strong>: DB2 uses table statistics to determine the most efficient execution plans. Outdated statistics or fragmented tables can lead to suboptimal query performance. RUNSTATS collects statistics, and REORG physically reorganizes tables to optimize space usage.</li><li>Example:</li></ul><pre>RUNSTATS ON TABLE employee;<br>REORG TABLE employee;</pre><p><strong>Use Case</strong>: Running RUNSTATS after large data changes ensures that the optimizer has the latest data distribution statistics, improving query execution.</p><h3>5. Limit Result Set Size</h3><ul><li><strong>Technique</strong>: Use the FETCH FIRST N ROWS ONLY clause to limit the result set size.</li><li><strong>Explanation</strong>: Fetching large volumes of data can be expensive. If you don’t need all rows, fetching only the required number can reduce query execution time and memory usage.</li><li><strong>Example</strong>:</li></ul><pre>SELECT * FROM employee ORDER BY hire_date DESC FETCH FIRST 10 ROWS ONLY;</pre><p><strong>Use Case</strong>: This query fetches only the top 10 most recently hired employees, reducing the processing time for larger result sets.</p><h3>6. Avoiding SELECT * (Only Retrieve Needed Columns)</h3><ul><li><strong>Technique</strong>: Avoid using SELECT * and instead select only the necessary columns.</li><li><strong>Explanation</strong>: Fetching all columns when only a few are needed increases data transfer and memory usage.</li><li>Example:</li></ul><p>Inefficient query</p><pre>SELECT * FROM employee;</pre><p>Optimized query</p><pre>SELECT employee_id, last_name, hire_date FROM employee;</pre><p><strong>Use Case</strong>: By selecting only the necessary columns, the query retrieves less data, improving performance.</p><h3>7. Query Parallelism</h3><ul><li><strong>Technique</strong>: Enable query parallelism to split the execution of complex queries across multiple processors.</li><li><strong>Explanation</strong>: DB2 can split large queries into smaller pieces that run simultaneously on multiple CPUs, speeding up query execution.</li></ul><p>Example</p><pre>SET CURRENT DEGREE = &#39;ANY&#39;;</pre><p><strong>Use Case</strong>: For long-running queries or queries that involve large tables, enabling parallelism can significantly reduce execution time.</p><h3>8. Use Appropriate Data Types</h3><ul><li><strong>Technique</strong>: Use the most appropriate and smallest data types possible.</li><li><strong>Explanation</strong>: Smaller data types reduce memory and storage requirements, speeding up query processing. Avoid using VARCHAR when CHAR or INT can be used.</li></ul><p>Example</p><pre>CREATE TABLE employee (<br>    employee_id INT,<br>    first_name VARCHAR(50),<br>    last_name VARCHAR(50),<br>    hire_date DATE<br>);</pre><p><strong>Use Case</strong>: Defining the correct data type helps DB2 optimize storage and processing resources.</p><h3>9. Use DB2 Hints</h3><ul><li><strong>Technique</strong>: Use optimization hints to influence the query execution plan.</li><li><strong>Explanation</strong>: DB2 offers hints that you can use to instruct the optimizer to choose a specific access path, such as using an index instead of a table scan.</li></ul><p>Example</p><pre>SELECT * FROM employee WHERE employee_id = 100 /*+ INDEX(employee idx_employee_id) */;</pre><p><strong>Use Case</strong>: In cases where the optimizer doesn’t select the best access path, hints can override default behavior.</p><h3>10. Buffer Pool Tuning</h3><ul><li><strong>Technique</strong>: Optimize buffer pools for frequently accessed data.</li><li><strong>Explanation</strong>: The buffer pool is where DB2 caches data in memory. Ensuring that the buffer pool size is large enough to store frequently accessed data can significantly reduce I/O operations.</li></ul><p>Example</p><pre>ALTER BUFFERPOOL bp1 SIZE 1000000;</pre><p><strong>Use Case</strong>: Tuning the buffer pool can improve performance by reducing the need for disk I/O.</p><h3>11. Longer IN clause</h3><p>When a query uses an IN clause with a large number of values, it can become slower because the database engine has to evaluate the membership of each value in the IN list for each row. Here are some strategies to optimize queries that have large IN clauses:</p><h4>Example:</h4><p>Instead of this:</p><pre>SELECT * <br>FROM employee <br>WHERE employee_id IN (1, 2, 3, ..., 10000);</pre><p>Create a temporary table:</p><pre>CREATE TEMPORARY TABLE temp_ids (id INT);<br>INSERT INTO temp_ids (id) VALUES (1), (2), (3), ..., (10000);</pre><p>Then use a JOIN:</p><pre>SELECT e.* <br>FROM employee e<br>INNER JOIN temp_ids t ON e.employee_id = t.id;</pre><p>This can significantly improve performance because the database can perform a more efficient join than evaluating a long list in the IN clause.</p><h3>Conclusion</h3><p>While not strictly mandatory, creating an <strong>index on columns used in a JOIN</strong> can greatly improve performance, especially for large tables. By indexing the columns used in the join condition, you reduce the need for full table scans, making the query run faster. However, you should balance the use of indexes with the potential overhead on INSERT, UPDATE, and DELETE operations, and consider whether the benefit justifies the cost based on the specific use case.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f44954ef67e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Akaike & Bayesian Information Criterion]]></title>
            <link>https://medium.com/@shrirangedgaonkar/akaike-bayesian-information-criterion-fc92b9060481?source=rss-23d3d2a35f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc92b9060481</guid>
            <category><![CDATA[aic-bic]]></category>
            <dc:creator><![CDATA[Shrirang Edgaonkar]]></dc:creator>
            <pubDate>Tue, 20 Aug 2024 07:27:37 GMT</pubDate>
            <atom:updated>2024-08-20T07:30:05.247Z</atom:updated>
            <content:encoded><![CDATA[<h3>AIC (Akaike Information Criterion)</h3><ul><li><strong>Intuition</strong>: AIC is a metric used to compare different statistical models. It estimates the quality of each model, considering both the goodness of fit and the complexity of the model. The lower the AIC, the better the model balances fit and complexity.</li><li><strong>Example</strong>: Suppose you’re fitting linear regression models to predict house prices. You have three different models: one with just the number of bedrooms, one with the number of bedrooms and the square footage, and one with those two plus the age of the house. AIC helps you choose the best model by penalizing overly complex models that don’t significantly improve fit.</li></ul><h3>BIC (Bayesian Information Criterion)</h3><ul><li><strong>Intuition</strong>: BIC is similar to AIC but places a stronger penalty on model complexity. It’s also used to compare models, with the lower BIC indicating a better model. BIC generally favors simpler models more than AIC, especially as the sample size increases.</li><li><strong>Example</strong>: Continuing the house price prediction example, if you have a large dataset, BIC might suggest a simpler model (e.g., only using the number of bedrooms) compared to AIC, which might suggest a slightly more complex model (e.g., including square footage as well).</li></ul><p>Let’s use a hypothetical dataset to explain these concepts with examples. We’ll consider a dataset where we’re trying to predict house prices based on three features: SquareFootage, NumberOfBedrooms, and HouseAge.</p><h3>Dataset Example</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5fwtk_TsEbS4KuloUMhpKA.png" /></figure><p>Now, let’s fit a few linear regression models to this data and apply the concepts:</p><h3>1. AIC (Akaike Information Criterion)</h3><ul><li><strong>Example</strong>: Let’s say we fit three different linear regression models:</li></ul><ol><li><strong>Model 1</strong>: Price ~ SquareFootage</li><li><strong>Model 2</strong>: Price ~ SquareFootage + NumberOfBedrooms</li><li><strong>Model 3</strong>: Price ~ SquareFootage + NumberOfBedrooms + HouseAge</li></ol><ul><li><strong>Interpretation</strong>: After fitting these models, we calculate the AIC for each:</li><li><strong>Model 1 AIC</strong>: 100</li><li><strong>Model 2 AIC</strong>: 95</li><li><strong>Model 3 AIC</strong>: 98</li><li>Here, <strong>Model 2</strong> has the <strong>lowest </strong>AIC, meaning it strikes the best balance between goodness of fit and complexity. So, Model 2 might be the best model to use among these.</li></ul><h3>2. BIC (Bayesian Information Criterion)</h3><ul><li><strong>Example</strong>: For the same models, the BIC values might look like this:</li><li><strong>Model 1 BIC</strong>: 105</li><li><strong>Model 2 BIC</strong>: 97</li><li><strong>Model 3 BIC</strong>: 103</li><li><strong>Interpretation</strong>: Again, <strong>Model 2</strong> has the <strong>lowest </strong>BIC, suggesting that it’s the preferred model. Notice that the BIC values are slightly higher than AIC values, reflecting the stronger penalty for complexity. In larger datasets, this difference would become more pronounced, often favoring simpler models.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc92b9060481" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Difference between Covariance and Correlation]]></title>
            <link>https://medium.com/@shrirangedgaonkar/difference-between-covariance-and-correlation-64b79eaebae5?source=rss-23d3d2a35f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/64b79eaebae5</guid>
            <category><![CDATA[covariance]]></category>
            <category><![CDATA[correlation]]></category>
            <dc:creator><![CDATA[Shrirang Edgaonkar]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 06:33:18 GMT</pubDate>
            <atom:updated>2024-08-16T06:33:18.563Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9fCKkOmX6-1z3tB5axaeYg.png" /></figure><p>Correlation and covariance are both statistical measures used to describe the relationship between two variables. However, they differ in their interpretation, scale, and the kind of information they provide. Here are the key differences between the two:</p><h3>1. Definition</h3><ul><li><strong>Covariance</strong>:</li><li>It measures the joint variability of two random variables. Essentially, it tells us how much the variables change together. The covariance value can be positive, negative, or zero.</li><li>A positive covariance indicates that the two variables tend to increase or decrease together.</li><li>A negative covariance indicates that as one variable increases, the other decreases, and vice versa.</li><li>Zero covariance means that the variables are linearly independent.</li><li><strong>Correlation</strong>:</li><li>It measures the strength and direction of the linear relationship between two variables. It is the standardized form of covariance.</li><li>Correlation values are standardized between −1 and 1, where:</li><li>1 indicates a perfect positive linear relationship,</li><li>−1 indicates a perfect negative linear relationship,</li><li>0 indicates no linear relationship.</li></ul><h3>2. Scale</h3><ul><li><strong>Covariance</strong>:</li><li>The value of covariance is not standardized, meaning it can range from −∞ to +∞. Its magnitude depends on the units of the variables and can be difficult to interpret directly.</li><li>Example: The covariance between height (measured in meters) and weight (measured in kilograms) would be different from the covariance between height (measured in inches) and weight (measured in pounds).</li><li><strong>Correlation</strong>:</li><li>The correlation is unitless and always ranges between −1 and 1. This standardization makes it easier to interpret and compare across different datasets or variables.</li><li>Example: A correlation of 0.80 indicates a strong positive relationship, regardless of the units of the variables.</li></ul><h3>3. Interpretation</h3><ul><li><strong>Covariance</strong>:</li><li>Covariance provides information on the direction of the relationship but not the strength or consistency of the relationship.</li><li>The value alone may not be meaningful without context or additional information.</li><li><strong>Correlation</strong>:</li><li>Correlation provides information on both the direction and the strength of the relationship.</li><li>A correlation close to 1or −1 indicates a strong relationship, while a correlation close to 0 indicates a weak relationship.</li></ul><h3>4. Conclusion</h3><p>While both covariance and correlation are useful in understanding relationships between variables, correlation provides a more standardized and interpretable measure. Covariance is useful for understanding the direction of the relationship and the co-movement of variables, but correlation is more effective for comparing the strength of relationships across different datasets or variables.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64b79eaebae5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Covariance, Auto-covariance and Cross-covariance]]></title>
            <link>https://medium.com/@shrirangedgaonkar/covariance-auto-covariance-and-cross-covariance-2483f7b4a412?source=rss-23d3d2a35f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/2483f7b4a412</guid>
            <category><![CDATA[cross-covariance]]></category>
            <category><![CDATA[auto-covariance]]></category>
            <category><![CDATA[covariance]]></category>
            <dc:creator><![CDATA[Shrirang Edgaonkar]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 05:17:27 GMT</pubDate>
            <atom:updated>2024-08-16T13:19:33.405Z</atom:updated>
            <content:encoded><![CDATA[<p>Following is the difference in a snapshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XRuA9XoXjN1BCI_m0duVZg.png" /></figure><h3>Covariance</h3><h4>Definition</h4><ul><li><strong>Covariance</strong> is a measure of how two variables move together. It tells us the direction of the linear relationship between the two variables.</li><li>If the covariance is positive, it means that the two variables tend to increase or decrease together.</li><li>If the covariance is negative, it means that one variable tends to increase when the other decreases, and vice versa.</li><li>A covariance of zero implies no linear relationship between the variables.</li></ul><h4>Example</h4><p>Consider two variables: the amount of rainfall and the sale of umbrellas. If rainfall increases and umbrella sales also increase, the covariance between these two variables would be positive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*00N3U5KsA-A1rQa33my_XQ.png" /></figure><h3>Auto-covariance</h3><h4>Definition</h4><ul><li><strong>Auto-covariance</strong> is the covariance of a time series with itself at different time lags. It measures how a variable is correlated with its past values.</li><li>It’s useful for identifying the degree of similarity between different parts of the same time series.</li></ul><h4>Example</h4><p>Suppose you have a time series of daily temperatures. The auto-covariance at lag 1 would measure the relationship between temperatures on consecutive days. A high positive auto-covariance would indicate that if one day is warm, the next day is likely to be warm as well.</p><h3>Cross-covariance</h3><h4>Definition</h4><ul><li><strong>Cross-covariance</strong> measures the covariance between two different time series at various time lags. It helps in understanding how two time series are related over time.</li><li>Unlike auto-covariance, which deals with one series, cross-covariance deals with two series.</li></ul><h4>Example</h4><p>Consider two time series: the daily amount of rain and the daily amount of water flowing in a river. The cross-covariance at lag 2 would measure the relationship between the rain on a particular day and the river’s water flow two days later.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2483f7b4a412" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Additive and Multiplicative Time-Series]]></title>
            <link>https://medium.com/@shrirangedgaonkar/additive-and-multiplicative-time-series-df8ce74fa711?source=rss-23d3d2a35f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/df8ce74fa711</guid>
            <dc:creator><![CDATA[Shrirang Edgaonkar]]></dc:creator>
            <pubDate>Sun, 11 Aug 2024 13:21:28 GMT</pubDate>
            <atom:updated>2024-08-26T04:11:23.610Z</atom:updated>
            <content:encoded><![CDATA[<p>In time series analysis, the concepts of <strong>additive</strong> and <strong>multiplicative</strong> models are used to describe how the different components of a time series combine to form the observed data. These components typically include the trend, seasonality, and residuals (noise or irregular fluctuations).</p><p>Understanding these models is crucial for decomposing time series data and building accurate forecasting models. Here’s a detailed explanation of both additive and multiplicative time series models:</p><h3>Additive Time Series Model</h3><p><strong>Formula</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*MovX0gSNBku1dX1stTMrHg.png" /></figure><p>Where:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*eK5xvi_vUw2P9tFsNgzkZw.png" /></figure><p><strong>Characteristics</strong>:</p><ol><li><strong>Constant Seasonal Effect</strong>: In the additive model, the seasonal effect is constant over time. For example, if the seasonal effect adds 10 units to the data every December, it will add exactly 10 units every year, regardless of the trend or overall level of the series.</li><li><strong>Linearity</strong>: The components are combined linearly. Each component simply adds or subtracts from the observed value.</li><li><strong>Suitable for</strong>: Time series data where the magnitude of seasonal fluctuations and random noise does not change with the level of the series. This model is typically used when the seasonal variation is relatively stable over time.</li></ol><p><strong>Example</strong>: Imagine a time series representing monthly sales for a store. The trend component might show a steady increase in sales over the years, the seasonal component might capture the increase in sales every holiday season, and the residual component would account for random fluctuations in sales that are not explained by the trend or seasonality.</p><p><strong>Example Data</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RuLwyjpHqOsVx04dwu7R7Q.png" /></figure><h3>Multiplicative Time Series Model</h3><p><strong>Formula</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*T9yj2MmRpEicQ6CvQz4i5g.png" /></figure><p>Where:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*31Xwnad5VlXvxKgO3Vo1DA.png" /></figure><p><strong>Characteristics</strong>:</p><ol><li><strong>Variable Seasonal Effect</strong>: In the multiplicative model, the seasonal effect varies with the level of the series. For example, if the series is increasing over time, the seasonal effect will also increase proportionally. This means that the seasonal fluctuations become more pronounced as the level of the series rises.</li><li><strong>Non-Linearity</strong>: The components are combined non-linearly. Each component multiplies with the others, affecting the overall magnitude of the observed values.</li><li><strong>Suitable for</strong>: Time series data where the magnitude of seasonal fluctuations and random noise changes with the level of the series. This model is used when the seasonal effect is more pronounced at higher levels of the series.</li></ol><p><strong>Example</strong>: Consider a time series of monthly electricity consumption. The trend component might show an overall increase in consumption due to population growth. The seasonal component might capture the higher consumption during summer months. In this model, as the total consumption increases, the seasonal spikes during the summer also become larger, reflecting a multiplicative effect.</p><p><strong>Example Data</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cHqoBtiPcPFzTmpf8fLoyg.png" /></figure><h3>Choosing Between Additive and Multiplicative Models</h3><p>The choice between additive and multiplicative models depends on the nature of the time series data:</p><ol><li><strong>Visual Inspection</strong>: Plot the time series and observe the pattern of seasonal variations. If the seasonal fluctuations are roughly constant in size, use an additive model. If the fluctuations increase or decrease with the level of the series, a multiplicative model is more appropriate.</li><li><strong>Statistical Tests</strong>: Perform statistical tests like the <strong>Box-Cox transformation</strong> to determine the best model. The Box-Cox transformation can help stabilize variance and make the series more suitable for additive models.</li><li><strong>Domain Knowledge</strong>: Use your understanding of the data and the underlying process to choose the model. For example, in financial data, multiplicative models are often preferred due to the compounding nature of growth and fluctuations.</li><li><strong>Logarithmic transformation</strong>:</li></ol><ul><li>If you suspect that the time series is multiplicative, take the logarithm of the series. A multiplicative series can be transformed into an additive one by applying a log transformation:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*iZ-WTJBQhpkaSIxZ24tVEA.png" /></figure><ul><li>After taking the log, the series should behave additively, meaning the seasonal pattern should become constant in magnitude.</li><li>If the log-transformed series behaves like an additive model, then the original series is likely multiplicative.</li></ul><h3>Decomposition of Time Series</h3><p>Time series decomposition is a method used to separate a time series into its components:</p><ul><li><strong>Additive Decomposition</strong>: This involves estimating the trend, seasonal, and residual components in a linear fashion. The observed values are broken down by subtracting the trend and seasonal components from the observed data.</li><li><strong>Multiplicative Decomposition</strong>: In this method, the observed values are divided by the trend component, and the seasonal component is then extracted by analyzing the ratio of the detrended data to the original series.</li></ul><h3>Example of Time Series Decomposition</h3><p>Suppose you have monthly sales data for a product over several years. You can decompose this data as follows:</p><ol><li><strong>Additive Model Decomposition</strong>:</li></ol><ul><li><strong>Trend Component</strong>: Estimated using a moving average or regression line.</li><li><strong>Seasonal Component</strong>: Calculated by averaging the deviations of the data from the trend line over each season.</li><li><strong>Residual Component</strong>: The remaining fluctuations after removing the trend and seasonal components.</li></ul><ol><li><strong>Multiplicative Model Decomposition</strong>:</li></ol><ul><li><strong>Trend Component</strong>: Estimated as in the additive model.</li><li><strong>Seasonal Component</strong>: Calculated by dividing the observed data by the trend component and then averaging over each season.</li><li><strong>Residual Component</strong>: The ratio of the observed data to the product of the trend and seasonal components.</li></ul><h3>Conclusion</h3><p>Understanding the differences between additive and multiplicative models is essential for accurate time series analysis and forecasting. By selecting the appropriate model, analysts can better capture the underlying patterns in the data and make more reliable predictions. The choice of model should be based on a combination of visual inspection, statistical testing, and domain knowledge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df8ce74fa711" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intuition of stationarity]]></title>
            <link>https://medium.com/@shrirangedgaonkar/intuition-of-stationarity-f3457904c95a?source=rss-23d3d2a35f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3457904c95a</guid>
            <category><![CDATA[intuition]]></category>
            <category><![CDATA[stationarity]]></category>
            <dc:creator><![CDATA[Shrirang Edgaonkar]]></dc:creator>
            <pubDate>Sat, 10 Aug 2024 13:15:33 GMT</pubDate>
            <atom:updated>2024-08-11T06:26:06.241Z</atom:updated>
            <content:encoded><![CDATA[<p>To provide an intuition on the use of stationarity, let’s approach the topic by using real-world analogies and examples to illustrate why stationarity is crucial in time series analysis and how it benefits various analytical and forecasting methods.</p><p>Intuitive Explanation</p><p>1. Consistency Over Time :</p><ul><li>Analogy: Think of a stationary time series like the heartbeat of a healthy person at rest. The heart rate stays relatively constant over time, making it easier for doctors to predict and analyze.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*8tH1f0x_oJhYGhQHTZNN3Q.png" /></figure><p>- Intuition: In a similar way, a stationary time series has a consistent mean, variance, and autocorrelation over time. This consistency allows analysts to make predictions and draw conclusions without worrying about changing trends or patterns.</p><p>2. Reducing Complexity :</p><ul><li>Analogy: Imagine trying to navigate a city with constantly changing traffic laws. It would be confusing and difficult to make accurate decisions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*E6giFELQGo3SjGEe87EuQw.png" /></figure><p>- Intuition: A non-stationary time series is like that city; the underlying patterns change over time, making it hard to model and predict accurately. Stationarity simplifies the problem by removing trends, seasonality, and other variations, allowing analysts to focus on the core behavior of the data.</p><p>3. Avoiding False Signals :</p><p>- Analogy: If you were looking at a thermometer that not only measured temperature but also fluctuated randomly due to a faulty sensor, you might incorrectly conclude that the temperature is changing when it’s not.</p><p>- Intuition: Similarly, non-stationary time series can produce misleading results. Spurious relationships might appear significant due to underlying trends or seasonal effects, but they might not represent any real connection between the variables. Stationarity helps ensure that the relationships you identify are meaningful.</p><p>4. Model Reliability and Predictability :</p><ul><li>Analogy : Consider a weather forecast model that performs well in predicting rain in the summer but fails in the winter due to changing weather patterns. This model lacks stability across different conditions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mr0VDIUTuIrwfhEhPOxNzA.png" /></figure><p>- Intuition : Stationary models remain reliable and predictable because they are based on stable statistical properties. A model built on stationary data is less likely to be swayed by transient trends or seasonal effects, leading to more reliable predictions.</p><p>5. Enabling Effective Use of Statistical Tools :</p><ul><li>Analogy: Using statistical tools on non-stationary data is like using a ruler with changing markings. Measurements won’t be accurate or reliable.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*9UHFJEIRXj0inN2ykukdrQ.png" /></figure><p>- Intuition: Many statistical tools and tests assume that the data is stationary. By ensuring stationarity, you can apply these tools confidently and get accurate results.</p><h3>Practical Example</h3><p>Example 1: Stock Prices</p><p>Imagine you are analyzing the stock prices of a company over several years. The data shows a clear upward trend because the company is growing and becoming more profitable.</p><p>- Non-Stationary Series: The stock prices themselves are non-stationary due to the upward trend. Any model built on this data might focus too much on the trend and fail to capture the underlying market behavior.</p><p>- Stationary Series: By transforming the data (e.g., using differencing to remove the trend), you get a stationary series. Now, the model can focus on the fluctuations around the trend, such as market sentiment or economic factors, leading to better insights and predictions.</p><p>Example 2: Sales Data</p><p>Consider a retailer analyzing monthly sales data over several years. The data exhibits a seasonal pattern, with higher sales during the holiday season.</p><p>- Non-Stationary Series: The raw sales data is non-stationary due to the seasonal pattern. Analyzing this data directly might lead to incorrect conclusions about long-term trends or relationships with other variables.</p><p>- Stationary Series: By removing the seasonal effect (e.g., using seasonal decomposition), the retailer gets a stationary series. This allows them to analyze the underlying sales behavior without the confounding effect of seasonality.</p><p>Summary</p><p>Stationarity is a crucial concept in time series analysis because it provides consistency, reduces complexity, avoids false signals, enhances model reliability, and enables effective use of statistical tools. By transforming a non-stationary series into a stationary one, analysts can focus on the core behavior of the data, leading to more accurate and meaningful insights and predictions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3457904c95a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[History of AI in an anti-virus software]]></title>
            <link>https://medium.com/@shrirangedgaonkar/history-of-ai-in-an-anti-virus-software-3d2dd265e578?source=rss-23d3d2a35f38------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d2dd265e578</guid>
            <category><![CDATA[quick-heal-antivirus]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Shrirang Edgaonkar]]></dc:creator>
            <pubDate>Fri, 09 Aug 2024 16:48:27 GMT</pubDate>
            <atom:updated>2024-08-09T16:52:32.338Z</atom:updated>
            <content:encoded><![CDATA[<p>Once we start studying a subject it occurs everywhere in our daily lives. I was watching the exhilarating journey of owners of Quick Heal Antivirus. The journey described a typical use case of generalisation that is typically implemented in Artificial Intelligence. But this kind of development has happened around 1990 when the term AI and its concepts were absent. There are lacs of viruses and to cater to all of them using software programs is next to impossible. It is like writing some piece of software for a particular virus. Even if there are minor changes, one still needs to write conditional statements to cover other scenarios. Does’nt this look like a decision tree ? As described in the video, some anti virus companies employed loads of developers to write the anti-virus software. While the founders of Quick Heal found out that that this was not feasible. They describe another company closing down since fixing all the viruses that are similar of the same family through software development was next to impossible. This is the time when they came up with self learning algorithm which can learn similar virus patterns and write anti virus software for them. So this is a generalization of the anti virus software by way of generating one. Of course all this must have happened in C, C++. We can understand the depth of the software then knowing the data crunching one does using pandas and keras libraries. The real use cases of Artificial Intelligence had already starting emerging then. As we speak there does’nt seem any bounds to the possibilities of AI now. Lets hope humanity gets the best benefit in the near future.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fy1IlehKA6ds%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dy1IlehKA6ds&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fy1IlehKA6ds%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b7a702c816dab9f1894c2ce417769ce/href">https://medium.com/media/2b7a702c816dab9f1894c2ce417769ce/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d2dd265e578" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>