Thursday, August 20, 2026

Loop Engineering: Designing the Systems That Prompt Your Agents

Loop Engineering

For the last couple of years, the core skill in working with AI was writing a good prompt. You'd craft careful instructions, send them off, read the response, and decide what to ask next. You were the loop — the human sitting between every action the model took.

That's starting to change. As models have gotten reliably good at using tools, reading their own output, and correcting course, the interesting engineering problem has moved up a level. It's no longer just "what do I say to the model right now?" It's "what system keeps this agent moving toward a goal, on its own, without me typing the next instruction?"

That discipline has a name now: loop engineering. This article walks through what it actually means — from the vocabulary that surrounds it, to the anatomy of a single loop, to the building blocks you assemble one out of, to the different kinds of loops that show up in production systems.

1. Prompt Engineering, Context Engineering, Harness Engineering, and Loop Engineering

These four terms get used almost interchangeably in casual conversation, but they describe different layers of the same stack. It helps to think of them as concentric circles, each one wrapping around the last.

Concentric layers of AI engineering Four concentric layers representing prompt engineering, context engineering, harness engineering, and loop engineering, with loop engineering as the outermost layer. Prompt Engineering Context Engineering Harness Engineering Loop Engineering

Figure 1.1 The four layers of AI engineering, with loop engineering forming the outermost layer.

Prompt engineering is the practice of shaping the words you send to a model to get a better single response. It's about phrasing, examples, formatting, and instructions for one turn of conversation. A good prompt fixes that one exchange — it says nothing about what happens next, when the task is actually done, or who checks the work.

Context engineering is the practice of deciding what information the model actually sees at any given moment — not just the instruction, but the surrounding files, memory, tool outputs, retrieved documents, and conversation history that get assembled into the model's working context. Where prompt engineering asks "how do I word this?", context engineering asks "what does the model need in front of it right now to do this well, and what should I leave out so it doesn't get lost or drown in irrelevant detail?" This becomes critical the moment a task spans more than one turn, because context windows fill up fast and stale or bloated context degrades performance.

Harness engineering is the practice of building the environment a single agent runs inside: its tools, its permissions, its guardrails, its verification step, and the scaffolding that tells it how to structure its thinking. A harness is the floor the agent stands on — things like a build-and-test setup a cold agent can use from a clean checkout, a written-down definition of "done," bounded cost and blast radius, and a place for project-specific knowledge to live so the agent isn't re-guessing intent on every run.

Loop engineering is the outermost layer, and the one that ties the rest together. It's the practice of designing the system that repeatedly acts, observes, and decides what to do next — on a schedule or in response to events — instead of a human supplying the next prompt by hand. A loop uses good context engineering at every step, runs inside a harness, and often issues many individual prompts along the way. If prompt engineering optimizes one turn and context engineering optimizes what the model can see, loop engineering optimizes the entire system that keeps turns happening until a goal is actually met.

Put simply: you engineer a prompt, you engineer the context around it, you engineer the harness it runs in, and then you engineer the loop that drives all of it forward without you.

2. Agentic Loop Stages: Goal, Action, Observation, Adjustment

Strip away the tooling and vocabulary, and every agentic loop is running the same basic cycle underneath. It shows up under different names in different frameworks — Reason/Act/Observe, Perceive/Plan/Act/Observe — but the core shape is consistent:

Agentic loop stages A cyclical process consisting of Goal, Action, Observation, and Adjustment, returning to the next Action cycle. Goal Action Observation Adjustment Repeat until a stopping condition fires

Figure 2.1 The fundamental Goal → Action → Observation → Adjustment cycle of an agentic loop.

Goal. The loop starts with something concrete to aim at. Not "improve the dashboard," but a specific, checkable target — "reduce initial dashboard load time while keeping existing filters working." A vague goal produces a vague loop; a testable goal gives the agent something it can actually verify against.

Action. The agent takes one bounded step toward that goal — it calls a tool, edits a file, runs a command, queries an API, or delegates to another agent. Good loops favor small, reversible actions over large, sweeping ones, because small actions are easier to evaluate and easier to undo if they're wrong.

Observation. The agent looks at what actually happened. This might be a test result, a stack trace, a file diff, an API response, or a screenshot. The quality of the whole loop depends heavily on the quality of this observation — an agent that can't clearly see the outcome of its own action can't meaningfully learn from it.

Adjustment. Based on the observation, the agent updates its plan — try again with a different approach, move on to the next step, escalate to a human, or decide the goal has been met and stop. This is also where the loop's "memory" matters: without some record of what's already been tried, an agent can fall into repeating the same failing action over and over.

Then it repeats — Goal stays fixed (or gets explicitly revised), and Action → Observation → Adjustment cycles again, until a stopping condition fires.

3. Agentic Loop Anatomy: Goal, Tool Set, Context Management, Explicit Termination/Escalation Logic, Error Handling

If the four stages above describe what happens on each turn of a loop, the anatomy below describes what you have to design to make a loop trustworthy enough to run unattended. A well-built loop has five load-bearing parts:

Part Purpose
Goal The goal needs a testable termination condition baked in, not just a description of the desired end state.
Tool set Defines the concrete actions the agent is allowed to take and the ceiling of what it can accomplish or accidentally break.
Context management Keeps the agent's working context useful over many iterations rather than allowing it to balloon or go stale.
Explicit termination/escalation logic Provides safety rails and defined ways to stop or hand off to a human.
Error handling Determines what happens when an action fails, a tool errors out, or an observation is ambiguous.

Goal. As above, but from a design perspective: the goal needs a testable termination condition baked in, not just a description of the desired end state. "All tests in the auth suite pass and lint is clean" is a goal a system can check automatically. "Make the auth code better" is not.

Tool set. The concrete set of actions the agent is allowed to take — read/write file access, shell commands, test runners, search, API calls, or other agents it can delegate to. The tool set defines the ceiling of what the loop can accomplish and, just as importantly, the ceiling of what it can accidentally break.

Context management. How the loop keeps the agent's working context useful over many iterations, rather than letting it balloon or go stale. This includes deciding what gets summarized, what gets dropped, and what gets re-injected at every step — for example, keeping the original goal visible in every observation so the agent doesn't quietly drift onto an adjacent task by iteration five.

Explicit termination/escalation logic. The safety rails. A loop needs a defined way to stop: the goal check passes, a maximum number of iterations is hit, a time or cost budget runs out, or the agent hits something it shouldn't handle alone and needs to hand off to a human. Without at least one explicit stop rule, a loop can keep running indefinitely, burning time and budget without making real progress — this is one of the most common production failure modes.

Error handling. What the loop does when an action fails, a tool errors out, or an observation is ambiguous. Good error handling produces a genuine adjustment — a different approach, a narrower next step, a request for help — rather than a blind retry of the exact thing that just failed.

Together, these five pieces are what separate a loop you can trust to run overnight from one that quietly spins in circles or does something you didn't want.

4. Primitives of Loop Engineering

If the anatomy above is the blueprint, the primitives are the actual parts you assemble a loop out of. Most modern agent platforms converge on a similar set, even though they use different names for them:

  • Autonomy / Scheduling. The mechanism that starts a loop without a human typing a prompt — a recurring cadence, a cron-style schedule, a background routine that survives a restart, or a trigger tied to some external event. This is what turns a one-off session into something that actually recurs.
  • Hooks. Small pieces of logic — often shell commands or scripts — that fire automatically at specific points in the agent's lifecycle: before an action runs, after a tool completes, when the loop is about to terminate. Hooks are how you bolt on guardrails and side effects without rewriting the agent's core instructions every time you learn something new.
  • Context Engineering. As described above, but as a primitive it's the ongoing discipline of curating what the agent sees at each iteration — trimming, summarizing, and re-injecting so the loop stays coherent instead of drowning in its own history.
  • Tool Access. The specific tools and permissions granted to the agent for this loop — file access, code execution, search, external APIs, connectors into real systems like issue trackers or chat tools. Scoping tool access tightly is one of the simplest ways to bound how much damage a misbehaving loop can do.
  • Worktrees. Isolated working copies — most commonly git worktrees — that let multiple agents (or multiple iterations of the same agent) operate on the same underlying project without colliding. When more than one loop is touching a codebase at once, isolation stops simultaneous edits from clobbering each other, the same way it would for two engineers working the same lines without talking.
  • Skills. Packaged, reusable, task-specific knowledge — instructions, conventions, examples — that an agent can reference for a recurring job instead of having that context re-explained (or re-guessed) on every run. Skills are how project-specific know-how survives across loop iterations without bloating every prompt.
  • Subagents. Separate agent instances spun up to handle a bounded piece of work, often with their own tools, instructions, and context. A common pattern splits "maker" from "checker" — one agent drafts a change, an independent agent reviews it — because a model checking its own work tends to be a weaker safeguard than a separate one doing the checking.
  • Spine. The durable, on-disk record of state that persists between iterations and between runs — what's been tried, what passed, what's still open. The spine is what lets a loop pick up tomorrow morning exactly where it left off last night, instead of starting cold and repeating mistakes it already made.

None of these primitives does much on its own. What makes a loop reliable is composing them: scheduling triggers the run, the spine tells it what's already been done, tool access and worktrees define what it's allowed to touch and how it stays isolated, skills give it the knowledge it needs, subagents split the work and check it, and hooks enforce the guardrails around all of it.

5. Types of Loops in Production Systems

Once a loop is running in production rather than in a single session, it tends to stack into several distinct layers, each solving a different problem. A useful way to break these down is into four levels:

Four levels of production loops Four stacked levels: Agent Loop, Verification Loop, Event-Driven Loop, and Hill Climbing Loop. Agent Loop Verification Loop Event-Driven Loop Hill Climbing Loop

Figure 5.1 Four stacked levels of loops in production systems.

Agent Loop. The innermost loop — the one described in Section 2. A model calls tools, observes results, and keeps going until a task is complete or a limit is hit. This is the loop that does the actual work.

Verification Loop. A layer wrapped around the agent loop that grades its output against a rubric or test suite and sends it back for another pass if it doesn't hold up, rather than trusting the agent's own judgment that it's done. This costs extra latency and compute, but for most production use cases where quality matters more than raw speed, it's worth it — and it's often where a human acts as the grader for judgment calls a script can't make.

Event-Driven Loop. The layer that connects an agent to the systems around it. Instead of being invoked manually, the agent sits inside a larger system and runs when something happens — a new document lands, a schedule fires, a webhook arrives, a message posts in a chat channel. This is what turns an agent from something you have to remember to run into something that's simply present in your workflow. It also introduces its own challenge: event streams like chat threads or email chains can bloat the context window over time, which is where the context-management discipline from Section 4 becomes essential again.

Hill Climbing Loop. The outermost, slowest-moving loop, and arguably the one with the most long-term leverage. Every run of the loops above produces a trace — a record of what the agent did, which tools it used, how it was graded. The hill climbing loop feeds those traces into an analysis process that looks for systemic problems — a prompt that keeps failing, a tool that keeps erroring — and updates the harness configuration in response. Each iteration of this outer loop makes the inner loops more effective, which is what makes it self-improving rather than just self-running.

Stacked together, these four levels form a pattern where automation and improvement compound on each other: the agent loop does work, the verification loop keeps that work honest, the event-driven loop keeps the whole thing running without a human remembering to kick it off, and the hill climbing loop steadily makes all three of the others better. Human judgment doesn't disappear from this picture — it just moves up a level, from approving individual actions to approving harness changes and reviewing what the system as a whole is learning to do.

Closing Thought

The shift loop engineering describes isn't that models got better at following instructions — it's that they got reliable enough that the interesting design problem moved from what do I tell it to do to what system decides what it does next, and when it should stop. Prompt engineering is still part of that system. So is context engineering and harness design. Loop engineering is what holds all of it together and lets it run without you standing in the middle of every cycle.

Generative and Agentic AI now introduces two more debts : Comprehension (or Cognitive) Debt and Intent Debt

Comprehension Debt, Intent Debt, and Cognitive Surrender

Comprehension debt, intent debt, and cognitive surrender are three closely linked concepts in software engineering. They define how the widespread use of generative AI and agentic coding tools changes software risk from being a problem with the code to being a problem with human understanding.

Popularised by software leaders like Addy Osmani and researchers like Margaret-Anne Storey in the Triple Debt Model, these terms describe what happens when AI-generated code moves faster than human oversight.


🧠 1. Cognitive Surrender: The Behavioral Trigger

Cognitive surrender is the human action—or lack of action—that starts the cycle. It is the mental posture where a developer stops critically evaluating or constructing solutions from scratch, choosing instead to blindly trust the AI's output.

The Mechanism: Instead of reasoning through a bug or an architecture layout, a developer lets an AI tool generate the code and immediately merges it because "the tests passed."

Examples: Approving a 600-line Pull Request without checking the logic, or asking an agent to patch a complex stack trace without knowing why it failed in the first place.

The Danger: You take on the AI’s high confidence without doing any of the underlying critical thinking.

📉 2. Comprehension Debt: The Mental Bill

Comprehension debt (frequently called cognitive debt) is the hidden tax you pay for cognitive surrender. It is the widening gap between how much code is running in a system and how much of it any human actually understands.

The Paradox: Traditional technical debt shows up as brittle code and slow tests. Comprehension debt is insidious because your codebase looks perfectly clean, and your velocity charts look immaculate—right up until something breaks and no one on the team can read the stack trace.

The Reality: Making code cheap to generate does not make understanding it cheap to skip.

The Cost: When teams drop deep into AI generation, their ability to reason, debug, and reconstruct their own work from first principles drops significantly.

🎯 3. Intent Debt: The Missing "Why"

Intent debt is the absence of documented reasons, constraints, and business goals that explain why the software was built a certain way. It is the most dangerous debt because it is the one type of debt that an AI agent cannot pay down for you.

The Reality: An AI assistant can easily refactor messy code (fixing technical debt) or read a block of code and explain it back to you (repaying comprehension debt). But an AI cannot guess why a previous developer chose a specific database structure or a 300ms delay. It will simply make up a confident, plausible-sounding guess.

The Impact: When developers write code manually, intent is recorded in documentation, PR reviews, and commit messages. When ephemeral AI prompts generate code, that context evaporates. Without externalised intent, future AI agents or engineers will make code changes that break broader system logic.

Summary of the Triple Debt Model

Debt Type Where It Lives What It Restricts Can AI Fix It?
Technical Debt In the code How easily systems can change Yes. AI can refactor bad patterns quickly.
Cognitive / Comprehension Debt In the people How easily teams can reason about systems Partially. AI can explain code to rebuild your mental model.
Intent Debt In the artifacts / docs Knowing what the system was built for No. Only humans can provide original intent.

Loop Engineering

1. Loop Engineering vs. Prompt Engineering

The shift from prompt engineering to loop engineering represents a move from static instruction to autonomous systems.

Feature Prompt Engineering Loop Engineering
Human Role Writes and refines prompts manually for every turn. Sets the final goal and creates the automated environment.
System Flow Linear: Input → Output. Cyclical: Plan → Act → Verify → Iterate.
Error Handling Human must notice errors and prompt the AI to fix them. System feeds compiler errors/test failures directly back to the AI.
Scalability Low: Bottlenecked by human typing and oversight. High: Can run hundreds of iterations independently in minutes.

2. Guardrails and Stop Rules

Because loops run automatically, they require strict operational boundaries to prevent runaway processing, high API costs, and unintended system modifications.

  • Iteration limits: Hard caps on the number of attempts (e.g., maximum 5 or 10 loops) to solve a specific problem.
  • Token and cost ceilings: Budget controls that automatically terminate the loop if it exceeds a specified dollar amount or token count.
  • Independent verification: Never letting the agent decide on its own if it has finished. A deterministic "judge" (like a test runner or a rigid string matcher) must confirm success.
  • Human-in-the-loop (HITL): A safety trigger that pauses the loop and requests human approval if the agent attempts high-risk actions, like deleting data or deploying code to production.

3. Practical Tools and Protocols

Building loop engineering workflows relies on open frameworks that give AI agents structured ways to talk to computers and external data.

  • Model Context Protocol (MCP): An open standard created by Anthropic that provides a uniform way for developers to securely expose data sources and local tools to AI models.
  • LangGraph & AutoGen: Frameworks designed specifically for stateful, multi-agent systems where agents can hand tasks off to one another inside structured loops.
  • Code Sandboxes: Isolated execution environments (like Docker containers or E2B) where the agent can run code, view terminal errors, and iterate safely without harming the host system.

Real-World Applications of Loop Engineering

The primary real-world sectors and specific workflows actively utilizing loop engineering include:

1. Autonomous Software Engineering & CI/CD

This is the most mature application of loop engineering. Instead of developers using basic chat interfaces, engineering loops are embedded directly into development environments and deployment pipelines. 

Autonomous Bug Fixing: Production CLI tools like Claude Code and IBM Bob use a /goal command. An engineer inputs a goal (e.g., "Fix the broken checkout button"), and the loop reads the code, attempts a fix, triggers a local test suite, reads the compiler errors, and rewrites the code until the tests pass. 

Pre-commit Quality and Security Audits: Organizations use loop frameworks to evaluate newly written code before it is merged. One agent writes a feature, a separate "verifier" agent performs a mock security or performance audit, and if vulnerabilities are found, the code is passed back to the generator agent to fix automatically. 

2. DevOps & Infrastructure Monitoring

Rather than waiting for a human operator to log into a server during an outage, loop engineering structures are applied to system reliability. 

Self-Healing Servers: A monitoring alert (like an AWS CloudWatch error or a server crash log) acts as a webhook trigger to wake up an agent loop. The agent investigates the server logs, devises a safe remediation script, executes it in a test sandbox, verifies the patch works, and applies it to the active container—stopping only when the system health checks report normal status. 

3. High-Scale Content Generation & Editorial Review

In enterprise marketing and content generation, relying on a single prompt often yields generic, unvetted results. 

Multi-Agent Editorial Teams: Modern content pipelines run as automated multi-agent loops. For instance, a research agent gathers data, a drafting agent generates an article, and a strict compliance/editorial agent grades the text against specific criteria (SEO guidelines, brand guidelines, factual checks). If the draft fails any metric, it is kicked back with notes for an iterative rewrite. 

4. Continuous Competitive Intelligence & Market Research

Static scraping scripts break frequently and require constant maintenance. Loop engineering solves this by dynamically adapting to web changes. 

Deep Exploratory Harvesting: A business defines a goal (e.g., "Map out all pricing variations for software X"). The agent explores a target site, notices a wall or an unfamiliar UI, dynamically alters its search strategy, runs an internal evaluation to check if it gathered the correct data points, and pivots its browsing behavior autonomously until the specific quantitative criteria are fulfilled. 

5. Automated Data Cleaning & Financial Reconciliation

Discrepancy Resolution: Accounting and operations teams use loops to match complex ledgers. When an automated system flags a billing discrepancy, the loop takes over to query internal transaction histories, test potential accounting adjustments, run mock balance sheets, and iterate through solutions until the accounts reconcile smoothly.

LLM Post-Training & RLHF Ecosystem

The Reinforcement Learning (RL) landscape is split into two major ecosystems: Classical/Traditional RL (used for robotics, games, and continuous control) and LLM Post-Training / RLHF (used for aligning and training reasoning models like O1 or DeepSeek with GRPO). 

Here is a comprehensive list of the major open-source RL frameworks grouped by their design intent:

1. LLM Post-Training & RLHF Ecosystem

These frameworks are highly optimized for distributed cluster training, decoupling fast token generation (rollouts) from model optimization.

  • Verl (VeRL): A high-performance, flexible RL stack by ByteDance optimizing model placement and prefix-caching.
  • TRL (Transformer Reinforcement Learning): Hugging Face’s popular library supporting SFT, DPO, PPO, and GRPO. Frequently paired with Unsloth RL for memory optimization.
  • OpenRLHF: An early, widely adopted distributed framework supporting Ray, Megatron-LM, and DeepSpeed.
  • AReaL: An asynchronous framework explicitly designed to scale up hardware throughput by splitting actor and learner resources.
  • Slime: An SGLang-native RL framework integrating SGLang inference with Megatron training.
  • NeMo-RL / NeMo Aligner: NVIDIA's massive-scale alignment framework tailored for NeMo-based LLMs.
  • ROLL: Alibaba’s framework focusing on multi-turn agentic conversations and complex reasoning paths.
  • RAGEN: An extension framework built on top of Verl, specifically targeted at agentic training and multi-turn environments. 

2. General-Purpose & Scalable Production Deep RL

Built to handle traditional deep learning architectures for high-throughput and enterprise deployment.

  • Ray RLlib: The dominant framework for distributed computing, natively handling multi-agent workflows and fault-tolerant scaling.
  • Stable-Baselines3 (SB3): The gold standard for PyTorch-based implementations, known for its reliable, plug-and-play code structure.
  • Tianshou: A highly parallelized, modular PyTorch library that stands out for its high performance and native multi-agent support.
  • CleanRL: A lightweight library specializing in single-file implementations of algorithms, making it perfect for rapid prototyping and educational tweaks.
  • TorchRL: PyTorch's official modular foundation library that serves as the base for building low-level custom RL components. 

3. Big Tech Research Frameworks

Frameworks released by core research labs to publish and validate new theoretical algorithms.

  • Acme: DeepMind's flagship library structured around building actor-critic architectures and testing across environments.
  • TF-Agents: Google's structured library designed exclusively for native TensorFlow model integration.
  • Dopamine: Google’s minimalist research framework designed primarily for fast prototyping in Atari-like environments.
  • ReAgent: Meta’s discrete and continuous control platform tailored specifically for real-world production decision systems. 

4. Environments & Toolkits (The Ecosystem Glue)

While not training engines themselves, these provide standard interfaces or simulations required to run any RL algorithm. 

  • Gymnasium: The actively maintained successor to OpenAI’s original Gym, serving as the standard environment API standard.
  • Unity ML-Agents: The standard bridge allowing games and simulations built inside the Unity Engine to behave as RL environments.
  • HUD / Harbor: Frameworks optimized specifically for sandboxing and validating AI code agents against containerized terminals.

Friday, August 14, 2026

MCP 2025-11-25 vs. MCP 2026-07-28

A comparison of the major protocol changes introduced in the MCP 2026-07-28 specification.

The following table compares the earlier MCP protocol (2025-11-25 and earlier) with MCP 2026-07-28, highlighting the architectural changes introduced by the move toward a stateless, request-oriented protocol.

Category Direction Old MCP
(2025-11-25 and earlier)
MCP 2026-07-28
Handshake Client ↔ Server initialize / notifications/initialized; server returns Mcp-Session-Id Removed — version/capabilities travel per-request in _meta. No pinning to a server instance
Session both Mcp-Session-Id header on every request; needs sticky routing Removed — every request self-contained. Any instance can answer any request
Capability probe Client → Server Implicit in initialize server/discover (optional to call, MUST be implemented). Decoupled from a handshake
Routing Client → Server Gateway must parse JSON body Mcp-Method, Mcp-Name headers. Header-based routing without body parsing
Discovery Client → Server tools/list, resources/list, prompts/list — varies per connection Same calls, plus resources/templates/list; now cacheable (ttlMs, cacheScope). Cacheable since results no longer vary per-connection
Core calls Client → Server tools/call, resources/read, prompts/get Same, but can return InputRequiredResult. Adds the MRTR path
Cross-call state Client → Server Implicit via session Explicit server-minted handle passed back as a tool argument (SEP-2567). State made explicit, not connection-bound
Server-initiated input Server → Client sampling/createMessage, elicitation/create, roots/list — server calls back mid-handler Deprecated (SEP-2577)MRTR: server returns InputRequiredResult; client re-issues original call with inputResponses + echoed requestState. True server → client calls replaced by client-driven retries
Subscribe Client → Server resources/subscribe (per URI) / resources/unsubscribe subscriptions/listen with a filter (toolsListChanged, promptsListChanged, resourcesListChanged, resourceSubscriptions: [uris]). One call can cover many watch targets; multiple concurrent listen streams allowed
Subscription push Server → Client notifications/resources/updated, notifications/*/list_changed over the session's GET/SSE connection Same notifications, now tagged with io.modelcontextprotocol/subscriptionId in _meta, delivered only on the stream that requested them. Demultiplexed by subscription, not by session
Subscription teardown Client → Server resources/unsubscribe Close the SSE stream (HTTP) / notifications/cancelled referencing listen ID (stdio); no dedicated unsubscribe RPC. Server holds no state across reconnects — must re-listen after any drop
Progress Server → Client notifications/progress, keyed by progressToken in request _meta Unchanged in spirit — still request-scoped. Same mechanism, explicitly not moved to subscriptions/listen
Logging level Client → Server logging/setLevel (session-scoped) io.modelcontextprotocol/logLevel in per-request _meta. Per-request instead of per-session

Logs are sent in the same open connection, before final response as "notifications/message".
Keepalive both ping Removed — SSE comment-line keepalives on long streams instead. No dedicated RPC
Cancellation Client → Server notifications/cancelled Close the SSE response stream (HTTP); notifications/cancelled now stdio-only. Cancellation piggybacks on stream closure over HTTP
Long-running work Client ↔ Server No first-class support tasks/get, tasks/update, tasks/cancel (extension); tools/call can return a task handle; tasks/list removed. New capability, extension framework
Interactive UI Server → Client Not supported MCP Apps extension (SEP-1865) — sandboxed iframe HTML. New capability
Stream resumability SSE Last-Event-ID allowed reconnect/redelivery Removed — broken stream ⇒ re-issue request with new ID, no redelivery. Simplicity traded for reliability guarantee

Key takeaway: MCP 2026-07-28 moves away from connection- and session-bound behavior toward self-contained, request-scoped interactions, while introducing mechanisms such as MRTR, subscription-based listening, explicit cross-call state, tasks, and MCP Apps.

Thursday, August 13, 2026

MCP v2 changes things a lot for the developer

 As I go deep into MCP v2, overwhelming changes are being noticed:

  • Session is being done away with.
  • If at all server needs to refer to state from previous response,  server appends a requestState in response, which the client must echo in next request.
  • Server will never make a call to client - this is biggest change. Channel must be kept open if you require multiple server responses for one single request. 
    • Elicitation: Client Sends a Request to Server. Server responds to the request, which contains a field called InputRequiredResult. Then client re-issues  the request with inputResponses + requestState
    • For Progress/Notification : 
      • For non-request-scoped notification (.e.g subscription to listChanged events of tools/prompts/resources), client opens one request and that request is kept open forever (till the time required by client).
      • For request-scoped notifications such as progress and logging, the notifications (notification/progress and notification/message) are sent in the same open connection, before the final response "result" to the mcp "tools/call" request is sent. The connection closes after the final response is received by the client from server.
  • Roots is deprecated

Wednesday, August 12, 2026

Mamba

What Mamba Is

Mamba is a new large language model (LLM) architecture introduced in late 2023 by researchers from Carnegie Mellon and Princeton. It’s built on Structured State Space (S4) models and aims to overcome transformers’ inefficiencies on long sequences by using a selective, input-dependent state space mechanism.

Key Innovations

  • Selective State Spaces (SSM): Mamba’s core block dynamically filters information, keeping what’s relevant and discarding the rest as it processes each token.
  • Simplified block design: It replaces the transformer’s heavy attention + MLP blocks with a single, cohesive SSM block, reducing complexity.
  • Hardware-aware parallelism: Uses a parallel scan algorithm tuned for GPUs, optimizing memory usage and throughput.
  • Linear-time scaling: Training and inference scale linearly with sequence length, unlike transformers’ quadratic attention cost.

Architecture Highlights

Mamba introduces a selected SSM layer that:

  • Focuses on relevant info: Weights inputs differently so predictive signals dominate.
  • Adapts to inputs: Parameters change per token (time-varying), enabling flexible sequence modeling.

It’s designed to fit GPU high-bandwidth memory and exploit parallel compute, improving speed and memory efficiency.

Mamba vs Transformers

Transformers Mamba
Attention-based; excellent at capturing global relationships but suffer from high memory/compute as sequences grow (quadratic scaling). SSM-based; uses a fixed-size hidden state that compresses history, enabling much faster inference and lower memory on long contexts.

Trade-offs noted in broader research (and acknowledged in the article’s context): transformers can still outperform on some retrieval/copying tasks and may need less data to learn certain behaviors, despite Mamba’s efficiency gains.

Usage

  • Requirements: Linux, NVIDIA GPU, PyTorch 1.12+, CUDA 11.6+.
  • Install: pip install causal-conv1d (optional) and pip install mamba-ssm from the official repo; can also build from source.
  • Usage: Instantiate a Mamba module with parameters like d_model, d_state, d_conv, and expand, then pass tensors of shape (batch, length, dim) .

Applications

Because it handles long sequences efficiently, Mamba is positioned for:

  • Long-form text analysis and content generation
  • Speech/audio and time-series modeling
  • Real-time translation and chatbots that track long conversations

Domain impacts highlighted include healthcare (genomic data), finance (long-term trends), and customer service (long-context dialogues).

Bottom Line

Mamba reframes sequence modeling by replacing attention with selective state spaces, delivering linear-time scaling and major efficiency gains for long contexts—making it a strong alternative (and potential complement) to transformers in future AI systems.

Loop Engineering: Designing the Systems That Prompt Your Agents

Loop Engineering For the last couple of years, the core skill in working with AI was writing a good prompt. You'd craft careful instru...