<?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 Bani Mehdi on Medium]]></title>
        <description><![CDATA[Stories by Bani Mehdi on Medium]]></description>
        <link>https://medium.com/@banii.mehdie?source=rss-e4427e85871a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*V9lCbj47YOrVk_gz_BNDzg.jpeg</url>
            <title>Stories by Bani Mehdi on Medium</title>
            <link>https://medium.com/@banii.mehdie?source=rss-e4427e85871a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 23:26:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@banii.mehdie/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Next Revolution in AI: From Codebreakers to Autonomous Agents]]></title>
            <link>https://medium.com/@banii.mehdie/the-next-revolution-in-ai-from-codebreakers-to-autonomous-agents-b0d31d5c19a1?source=rss-e4427e85871a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0d31d5c19a1</guid>
            <dc:creator><![CDATA[Bani Mehdi]]></dc:creator>
            <pubDate>Fri, 10 Oct 2025 07:53:19 GMT</pubDate>
            <atom:updated>2025-10-10T07:55:02.315Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Unprecedented capabilities in Foundation Models are making autonomous, intelligent agents our next assistants, coworkers, and coaches finally possible.</strong></p><h3>Introduction: The Journey to Autonomous Intelligence</h3><p>The world of Artificial Intelligence is experiencing a fundamental shift. We are moving rapidly beyond static large language models (LLMs) and into the age of <strong>Intelligent Agents</strong>. This journey traces an incredible arc: starting with the statistical analysis of wartime codebreakers, and leading us to the development of sophisticated, multimodal AI systems that can reason, plan, and act autonomously.</p><p>The unprecedented capabilities of foundation models have opened the door to agentic applications that were previously unimaginable. These new capabilities make it finally possible to develop autonomous, intelligent agents to act as our assistants, coworkers, and coaches.</p><p>In this deep dive, we will dissect this revolution, following the progression of the AI stack:</p><ol><li><strong>The Foundation:</strong> How language models evolved from simple statistics to massive, multimodal models.</li><li><strong>The Structure:</strong> Defining the architecture of an intelligent agent — the true extension of the LLM.</li><li><strong>The Reality Check:</strong> Why many enterprises fail when jumping onto the AI agent bandwagon.</li></ol><h3>Part I: The Foundation From Statistical Models to Foundation Models</h3><p>The bedrock of today’s AI revolution is the <strong>Language Model (LM)</strong>.</p><h3>1. The Historical Roots of Language Modeling</h3><p>A Language Model encodes statistical information about one or more languages. Intuitively, this information tells us how likely a word is to appear in a given context. For example, given the context “My favorite color is ___”, a language model that encodes English should predict “blue” more often than “car.”</p><p>In its early days, a language model involved one and only one language.</p><ul><li><strong>The Detective’s Code:</strong> In the 1905 story <em>“The Adventure of the Dancing Men”</em>, Sherlock Holmes leveraged simple statistical information of English to decode sequences of mysterious stick figures. Since the most common letter is ‘E’, Holmes deduced that the most common stick figure must stand for ‘E’.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pEqGlgXDA5gqwaFQz9JrlA.png" /></figure><ul><li><strong>The Statistical War:</strong> This actually refers to the first part of our title, “War.” Claude Shannon used more sophisticated statistics to decipher enemies’ messages during the Second World War. His work on how to model English was published in his 1951 landmark paper <em>“Prediction and Entropy of Printed English.”</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wzwAM5WbDZrYePR0z3XeA.png" /></figure><h3>2. The Mechanics: Encoding Language with Transformers</h3><p>I mentioned the word “encoding” twice. So, what does encoding mean? The <strong>encoder</strong> is built on top of <strong>Transformers</strong>.</p><p>A Transformer consists of three main parts that convert human language into a machine-readable format:</p><ol><li><strong>Tokenization:</strong> The process of converting words into small units called <strong>tokens</strong>. These tokens might be words, subwords, or even single characters.</li><li><strong>Embedding:</strong> The process of converting those tokens into <strong>vector representations</strong> (numbers, typically floats, stored in a vector).</li><li><strong>Attention Mechanism:</strong> This is the core component that gives context and adds semantic meaning, defining the relationships between words to make the text understandable by the model.</li></ol><p>Finally, the <strong>encoder</strong> is a model that converts a sequence of words into an embedding. The <strong>decoder</strong> is a model that takes a sequence of words (or embeddings) and outputs the next word.</p><h3>3. From Language Models to Large Language Models (LLMs)</h3><p>Nowadays, a language model can involve multiple languages, but they still operate on the principle of prediction.</p><p>There are two main types of language models. They differ based on what information they can use to predict a token</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*WhomGd9VTaovGXmyR4GBCg.jpeg" /></figure><h4>How the Context Defines the Capability</h4><p>The context rule dictates the model’s strengths and core use cases:</p><p><strong>. Autoregressive Models</strong> (like the GPT series) are inherently <strong>unidirectional</strong> (left-to-right). They are designed for <strong>generation</strong>, mimicking how a human writes or speaks: by modeling the next logical token given all that has been said before.</p><p><strong>In the example:</strong> When predicting the word following “…cross the,” the model relies <em>only</em> on the sequence “Why does the chicken cross the” to generate the conclusion, typically yielding “road.” This sequential nature is why they excel at tasks like <strong>story writing, drafting emails, code completion, and powering chatbots.</strong></p><p><strong>. Masked Models</strong> (like BERT) are <strong>bidirectional</strong>. By masking a word and having access to both the beginning (“Why does the”) and the end (“cross the road”), the model develops a richer, deeper <strong>understanding</strong> of the entire sentence’s meaning and context.</p><p><strong>In the example:</strong> The model uses the surrounding context of the sentence to infer the most probable word that fits the gap. This comprehensive view makes them perfect for <strong>analysis and extraction</strong> tasks, such as <strong>sentiment analysis, text categorization, named entity recognition, and extractive question answering.</strong></p><h4>The Size Explosion: Large or Tiny?</h4><p>How large does a model have to be considered “large”? The term is constantly being redefined. A model’s size is typically measured by its number of <strong>parameters</strong> (the variables within a model that are updated through training, mostly weights).</p><ul><li><strong>GPT-1 (June 2018):</strong> Released with <strong>117 million parameters</strong>. This was considered <em>very large</em>. [Visual: GPT-1 — June 2018 with 117M parameters].</li><li><strong>GPT-2 (February 2019):</strong> Released just six months later with <strong>1.5 billion parameters</strong>. Suddenly, 117M was considered small. [Visual: GPT-2 — February 2019 with 1.5 billion parameters].</li></ul><h3>4. From LLMs to Multimodal Foundation Models</h3><p>While language models are capable of incredible tasks, they’re limited to text. As humans, we perceive the world not just via language but also through vision, hearing, and touch. Being able to process data beyond text is crucial for AI to operate in the real world.</p><p>For this reason, language models are being extended to incorporate more <strong>data modalities</strong>:</p><ul><li><strong>Multimodal Models:</strong> Models like GPT-4V, GPT-5V, and Claude 4.5 Sonnet can understand image and text at the same time.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*0l4IvxnQYI1Fpo8z9d56Vg.jpeg" /></figure><ul><li><strong>Advanced Modalities:</strong> Some other models can understand videos (like Veo, Sora, Wan), 3D assets, and protein structures.</li></ul><p>This expansion led to the term <strong>Foundation Models</strong>, which signifies both the importance of these models in AI applications and the fact that they can be built upon for different purposes.</p><p>Finally, we can define the term AI Engineering which refers to the process of building applications on top of foundation models.</p><h3>Part II: The Agentverse Intelligent Agents and the AI Stack for 2025</h3><p>Now, moving on to the <strong>agentverse</strong>.</p><h3>1. What Defines an Agent?</h3><p>The term agent has been used in many different engineering contexts (software agent, conversational agent, reinforcement learning agent).</p><p>An agent is anything that can <strong>perceive its environment</strong> and <strong>act upon that environment</strong>. This means an agent is characterized by:</p><ul><li><strong>The Environment:</strong> The setting it operates in, defined by its use case. If it plays a game, the game is its environment. If it scrapes the internet, the internet is its environment. If it’s a cooking robot, the kitchen is its environment.</li><li><strong>The Set of Actions:</strong> The specific things it is empowered to do in that environment.</li></ul><h3>2. The Agent Environment and Tool Use</h3><p>To make it simple: an agent is an <strong>extension of a language model</strong>. It contains <strong>tools</strong> and <strong>memory</strong>, which make it stand out.</p><p>As an example, consider the <strong>SWE-agent</strong> built on top of GPT-4 by OpenAI:</p><ul><li><strong>Environment:</strong> Consists of the Computer, the Terminal, and the File Directory (e.g., sklearn/examples/README.rst).</li><li><strong>Actions (LM-friendly commands):</strong> The actions it can operate in include:</li><li>Navigate repo</li><li>View files</li><li>Search files</li><li>Edit lines</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*bNPuqq1RP1uZY5RcHxeR3g.jpeg" /></figure><h3>3. The Engine Room: AI Techniques for 2025</h3><p>For enterprises, building AI is about moving beyond prototypes to production systems that are durable, governable, and reliable at scale. The following six terms reflect the underlying architecture behind enterprise grade AI:</p><h3>1. Agentic AI: The Self-Directed System</h3><p>Agentic AI moves beyond simple request-response to implement a <strong>closed-loop system</strong> capable of self-directed execution. It’s an architectural pattern where a system <strong>plans steps, uses external tools, and dynamically course-corrects</strong> based on real-time feedback until a defined objective is met.</p><p><strong>Deployment Strategy:</strong></p><ul><li><strong>Start Bounded:</strong> Confine initial deployments to specific, well-defined processes (e.g., classifying support tickets, enriching new leads).</li><li><strong>Selective Memory:</strong> Integrate memory storage only for necessary state tracking (e.g., maintaining a history of steps or escalations).</li><li><strong>Control Costs:</strong> Implement strict runtime and resource constraints to prevent execution loops from becoming unpredictable or costly.</li></ul><p><strong>📍 In Action (IT Operations):</strong></p><p>An autonomous agent takes ownership of an incident by initiating a <strong>root-cause analysis loop</strong>. It integrates with observability platforms for verification, proposes a technical fix, and then submits the plan to an engineer for final human approval.</p><h3>2. Multi-Agent Orchestration: Distributed Intelligence</h3><p>Complex business problems require <strong>distributed intelligence</strong>. This involves designing a network of specialized, collaborating agents, each assigned a distinct, narrow role (e.g., Planner, Executor, Verifier) and coordinated through defined <strong>communication protocols</strong>.</p><p><strong>Deployment Strategy:</strong></p><ul><li><strong>Role-Based Decomposition:</strong> Clearly assign responsibilities (e.g., Planning Agent, Data Fetcher Agent, Compliance Critic).</li><li><strong>Orchestration Backbone:</strong> Utilize advanced frameworks like <strong>LangGraph, AgentOS, or Swarm</strong> to manage handoffs and state.</li><li><strong>Auditing:</strong> Enforce the use of universal <strong>trace IDs and timeouts</strong> to ensure every interaction and decision within the network is fully auditable.</li></ul><p><strong>📍 In Action (Financial Services):</strong></p><p>A central <strong>Planning Agent</strong> breaks down a complex quarterly reporting task. It delegates data retrieval to an <strong>Executor Agent</strong> connected to the SAP system, and finally passes the output to a <strong>Compliance Agent</strong> for mandatory formatting and regulatory verification.</p><h3>3. Mixture of Experts (MoE): Specialized Scaling</h3><p>MoE is a technique for intelligent model scaling. Instead of using one massive model for every task, a <strong>router dynamically activates only the necessary specialized sub-models (experts)</strong> per input token. This drastically <strong>saves compute costs</strong> while allowing for high-quality, domain-specific specialization.</p><p><strong>Deployment Strategy:</strong></p><ul><li><strong>Targeted APIs:</strong> Leverage MoE-backed models for tasks that benefit from deep, distinct specialization (e.g., multilingual translation or niche technical domains like legal coding).</li><li><strong>Bottleneck Monitoring:</strong> Carefully track expert routing patterns to identify and resolve “hotspot” experts that may become performance bottlenecks.</li></ul><p><strong>📍 Example (Global Customer Support):</strong></p><p>A global support team utilizes MoE to immediately route inquiries to the best expert for the job, <strong>such as a language specialist for translation or a regional expert for policy advice.</strong> This ensures high service quality and maximizes cost efficiency.</p><h3>4. Next-Generation Retrieval (Self-RAG &amp; Agentic RAG)</h3><p>The evolution of Retrieval-Augmented Generation (RAG) moves from simple data stuffing to <strong>intelligent, verified information integration.</strong></p><ul><li><strong>Self-RAG:</strong> The model autonomously determines <em>when</em> and <em>how</em> to perform a retrieval based on the prompt’s context, making the process dynamic.</li><li><strong>Agentic RAG:</strong> Retrieval becomes a <strong>deliberate, planned action</strong> within a self-correction or reasoning loop, enabling cross-referencing and validation against multiple sources before generating an answer.</li></ul><p><strong>Deployment Strategy:</strong></p><ul><li><strong>Self-RAG for Speed:</strong> Use for general, dynamic Q&amp;A against internal knowledge bases or wikis.</li><li><strong>Agentic RAG for Verification:</strong> Deploy for high-stakes tasks like policy enforcement, research synthesis, or technical troubleshooting where every claim requires verifiable citation.</li><li><strong>Verification Layer:</strong> Implement a dedicated “critic” or “verifier” layer to explicitly check the veracity of citations before trusting the final output.</li></ul><p><strong>📍 Example (Pharmaceutical Research):</strong></p><p>An <strong>Agentic RAG</strong> system compiles regulatory reports by pulling raw trial data, cross-checking it against global regulatory standards, and providing verifiable, multi-sourced citations for every claim in the final document.</p><h3>5. Autonomous Workflows: State and Durability</h3><p>Most high-value enterprise work consists of <strong>long-running, multi-stage processes</strong> that require state management, retries, escalations, and human checkpoints. Autonomous workflows provide the necessary <strong>durability and resilience</strong> to run AI-driven operations reliably over extended periods.</p><p><strong>Deployment Strategy:</strong></p><ul><li><strong>Stateful Orchestration:</strong> Use workflow orchestrators like <strong>Temporal, Airflow, or LangGraph</strong> to manage the long-running state of agents.</li><li><strong>Human Gates (HITL):</strong> Insert mandatory Human-in-the-Loop (HITL) approval gates at points of high risk or high cost.</li><li><strong>Fault Tolerance:</strong> Implement “saga patterns” and backoff/retry logic to ensure graceful recovery from external system failures.</li></ul><p><strong>📍 In Action (Insurance Claims):</strong></p><p>The claims process runs as a single, durable autonomous workflow: initial intake → automated document verification → fraud check assessment → human approval/escalation → final payout recommendation.</p><h3>6. Trust Layers: Governance and Compliance</h3><p><strong>Core Concept:</strong> Governance is the true bottleneck for enterprise AI adoption. <strong>Trust Layers</strong> are non-negotiable architectural components that bake safety, identity management, policy enforcement, and observability directly into the stack, ensuring all operations are <strong>safe, auditable, and compliant.</strong></p><p><strong>Deployment Strategy:</strong></p><ul><li><strong>Tool Access Control (ACLs):</strong> Implement strict, per-tool Access Control Lists (ACLs) so that agents can only call tools relevant to their mandate.</li><li><strong>Full Trace Logging:</strong> Log every prompt, tool call, external output, and decision point with detailed <strong>trace IDs</strong> for complete auditability.</li><li><strong>Pre-Execution Policy Check:</strong> Enforce data redaction (PII/PHI) and policy checks <em>before</em> the model or agent executes the task, not just after the fact.</li></ul><p><strong>📍 In Action (Healthcare):</strong></p><p>A healthcare system uses <strong>Trust Layers</strong> to automatically redact Protected Health Information (PHI) before any retrieval-augmented generation occurs and logs the source of every retrieved data point to maintain strict adherence to HIPAA compliance standards.</p><p>Part III: The Reality Check — Why AI Agents Fail in the Enterprise</p><p>Everyone wants to visit the promised land of AI agents… Until they realize what is actually waiting at the gate.</p><p>The unprecedented capabilities of foundation models have been heavily hyped, often overshadowing the real-world challenges of deployment. This is the reality check most companies face after jumping on the AI agent bandwagon:</p><ul><li><strong>“Wait, do I need more people? Aren’t agents supposed to replace people?”</strong></li><li><strong>“Why does it cost so much? Do I need clean data? A strategy? An infrastructure? Why is this thing hallucinating?”</strong></li></ul><p>Here’s the thing: building effective agents is hard, really hard. Especially when you’re dealing with complex tools and frameworks like LangGraph or LangChain, where even finding talent is a challenge.</p><p><strong>And the surprise?</strong> Your agents are only as smart as your data is clean. <strong>No data, no value. No investments, no results. No pain, no gain.</strong></p><h3>Failure of Agentic Apps:</h3><h3>The Unseen Challenges: When AI Agents Go Wrong</h3><p>While the potential of intelligent agents is immense, it’s equally important to acknowledge their limitations and potential failure modes. Just like any complex system, AI agents can go astray. Understanding these challenges is crucial for building robust and reliable AI.</p><p>This diagram vividly illustrates the various ways AI agents can fail in real-world scenarios, categorizing them into four main areas:</p><ol><li><strong>Reasoning Failures:</strong> When the AI’s internal “thought process” goes awry, leading to hallucinations, getting stuck in loops, or pursuing incorrect objectives.</li><li><strong>System Failures:</strong> Problems related to the AI’s operational aspects, such as misusing tools, memory overload, or simply being too slow.</li><li><strong>Interaction Failures:</strong> Issues arising from how the AI communicates and understands its human users or the environment, like misunderstanding input or losing context.</li><li><strong>Deployment Failures:</strong> Problems encountered when integrating the AI into existing systems, including integration bugs, setup mistakes, or security vulnerabilities.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ozpUSqf1IGTdc2_PjU1XXw.png" /></figure><p>These categories highlight that building effective agents isn’t just about advanced algorithms; it’s about meticulous engineering, robust error handling, and understanding the complex interplay between the AI, its tools, its environment, and human users. Addressing these potential pitfalls upfront is critical for successful deployment.</p><h3>Conclusion:</h3><p>The development of autonomous, intelligent agents is indeed the next great frontier in AI. They will fundamentally change how we work, travel, and solve problems.</p><p>However, before booking your ticket to the AI agent utopia, make sure you’ve packed the essentials. Success in the agentverse doesn’t come from a brilliant model alone; it comes from solid engineering and strategy:</p><ul><li>A solid <strong>AI strategy</strong>.</li><li>Quality <strong>data and infrastructure</strong>.</li><li>Realistic <strong>expectations</strong>.</li><li>And yes, a clear <strong>budget</strong>.</li></ul><p>==&gt; The future isn’t just about training bigger models; it’s about engineering intelligent systems capable of autonomous action.</p><p>By Mehdi Bani.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0d31d5c19a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>