<?xml version="1.0" encoding="UTF-8"?>
  <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
      <title>Rajdeep Mondal - Large Language Model Agents</title>
      <link>https://rajdeepmondal.com/series/cs294-llm-agents</link>
      <description>Large Language Model Agents: every entry in the series.</description>
      <language>en-us</language>
      <managingEditor>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</managingEditor>
      <webMaster>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</webMaster>
      <lastBuildDate>Mon, 13 Apr 2026 12:00:00 GMT</lastBuildDate>
      <atom:link href="https://rajdeepmondal.com/series/cs294-llm-agents/feed.xml" rel="self" type="application/rss+xml"/>
      
  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-trustworthy-agents-under-pressure</guid>
    <title>Untrusted Text Stays Evidence</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-trustworthy-agents-under-pressure</link>
    <description>Prompt injection is the native attack on any system that mixes instructions with untrusted text. The defense is architecture that keeps the two channels apart.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>Prompt injection is the native attack on any system that mixes instructions with untrusted text. Every agent in this course mixes them. The model reads a system prompt, a user request, a retrieved page, and a tool result in one window. Nothing in that window says which of them can give orders.</p><p>The release-gate note asked for a measurement that can change a launch decision. The text that arrives after the launch comes from a page the agent opened by itself. Someone wrote that page to reach your tools.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>Trustworthy agents are built as layers: permissions, isolation, monitoring, evaluation, human review, and incident response.</figcaption></figure><h2 id="trust-is-several-properties-that-interact">Trust Is Several Properties That Interact</h2><p>Trust is a set of properties: privacy, behavior under attack, fairness, transparency, accountability, staying on the assigned goal, and resistance to misuse. One score hides which of them broke. For an agent they break through each other.</p><p>Retrieval carries the privacy failure. A hostile webpage breaks the behavior you tested, and tools turn a harmful plan into an executed one. Trust is the operating envelope for autonomy, and the envelope sets how far the agent goes before a human signs.</p><h2 id="agents-leak-through-their-tools">Agents Leak Through Their Tools</h2><p>The leaks stack. A model memorizes pieces of its training data, and a system leaks private context through the window it assembles. An agent adds its own path: a secret handed to a tool, or one user&#x27;s context carried into another user&#x27;s turn.</p><p>State is the safety feature, and a shared context window is shared state. Data minimization does the heavy work, because an agent cannot leak a record it never reached.</p><p>Access control per user, redaction on the way out, and isolation between sessions hold the rest. Logs name which tool touched what data. Tests that deliberately try to extract sensitive information tell you whether the posture holds.</p><h2 id="prompt-injection-is-the-native-agent-attack">Prompt Injection Is the Native Agent Attack</h2><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>The instruction channel stays small, every other source enters as evidence, and the sensitive action waits for a human.</figcaption></figure><p>Hostile text arrives on a webpage, inside a retrieved document, or in a tool result. A user probing the policy is the mild case. The hard case is text written for the agent and never shown to the human.</p><p>The loop note named five steps: observe, decide, act, examine, remember. Injection enters at observe, and the damage lands at act. Between those two steps, nothing asks who wrote the sentence the agent is following.</p><p>System instructions, developer policy, user intent, retrieved documents, webpages, emails, and tool outputs are different kinds of text. An agent that flattens them into one stream obeys whichever sentence arrived last.</p><div class="v-decision"><span class="kicker">Security rule</span><div class="body">The system, the developer, and the user can instruct. Every other source enters as evidence and stays evidence. That one boundary removes a large class of failures.</div></div><ul><li>Quote and summarize untrusted content as evidence, with its source label attached.</li><li>Tools declare their permissions and side effects before the agent calls them.</li><li>A sensitive action stops for confirmation at the moment it runs.</li><li>Logs keep a record of which instruction source caused which decision.</li></ul><p>A suite built from normal prompts passes without touching any of this. The risk appears when the agent reads hostile text while holding tools, memory, private context, and authority to act.</p><h2 id="the-same-capability-serves-both-sides">The Same Capability Serves Both Sides</h2><p>A model that finds a bug for you finds one for an attacker. Defenders get bug discovery, alert triage, and automated response. Attackers get phishing, reconnaissance, exploit generation, and social engineering in volume.</p><p>The net effect depends on capability, access, monitoring, policy, and the speed of defensive adoption. The last term is the one your team sets.</p><h2 id="a-trustworthy-agent-hands-you-evidence">A Trustworthy Agent Hands You Evidence</h2><p>The agent earns trust with a record: what it read, what it did, what it refused, what it doubts, and what needs a human signature. Tone proves nothing.</p><p>The workflow note called this a tape: what the agent relied on, what it changed, and how you undo it. Injection makes the tape load-bearing, because the tape holds the sentence that redirected the run. A more capable agent raises the value of an inspectable trail.</p><p>Safety measured as refusal behavior measures the wrong surface. The dangerous failures come from allowed actions: weak evidence, stale context, poisoned instructions, or a stop that came too early.</p><h2 id="policy-needs-evidence-that-maps-to-harms">Policy Needs Evidence That Maps to Harms</h2><p>Policy has to be science-based and evidence-based, and the phrase carries work. Written from vibes, it lags reality. Written from benchmark theater, it overfits the wrong signal, and it does that with a chart.</p><p>The evaluation that counts maps to an actual harm and an actual mitigation. An injection evaluation clears that bar when a failed run costs the agent a tool permission.</p><h2 id="the-builder-test">The Builder Test</h2><p>Take one agent you run and list every text source it reads.</p><ul><li>Mark which sources can instruct the loop, and which stay evidence for the whole run.</li><li>List the tools that reach private data, and the ones that run without a permission check.</li><li>Name the actions that stop for a human, and the uncertainty that forces escalation.</li><li>Write down how the system fails, and where that failure becomes visible to a person.</li></ul><p>Then poison a page yourself, point the agent at it, and read which label failed.</p><div class="v-decision"><span class="kicker">Mission rule</span><div class="body">Do not let text the agent found on the way rewrite the mission it was sent to complete.</div></div><h2 id="what-carries">What Carries</h2><p>Every note in this course repaired one joint of the loop. Reasoning sharpened decide and tools built act. Grounding and the tape held examine and remember, and the release gate decided whether the loop ships at all.</p><p>The boundary between instructions and evidence guards observe. An outsider can write to that step, and a poisoned observation spends your tools. Agent safety starts when you decide what text can control the loop. Decide it before a webpage decides it for you.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Mon, 13 Apr 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>trustworthy-ai</category><category>privacy</category><category>robustness</category><category>security</category><category>policy</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-responsible-scaling-needs-measurement</guid>
    <title>Responsible Scaling Needs Measurement</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-responsible-scaling-needs-measurement</link>
    <description>Governance works when a measurement can change a launch decision. A gate needs an eval, a threshold, a required mitigation, and an owner who can refuse.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>Governance works at one moment: a measurement crosses a threshold and the release stops. Models keep scaling and the risks scale with them, so build that moment before you write another line of policy.</p><h2 id="you-cannot-govern-a-capability-you-cannot-elicit">You Cannot Govern a Capability You Cannot Elicit</h2><p>You cannot govern a capability you cannot elicit, measure, and track. A weak scaffold hides capability, and so does a lazy prompt. The model keeps what the test missed, and the first person outside your team with a better scaffold finds it.</p><p>Start by naming the dangerous capability in plain words. A vague worry has no eval and no threshold, so it never reaches a decision. Name the capability, then name how you elicit it.</p><p>Order decides whether the policy does any work. A policy written after the technical plan is fixed can only describe the plan. The measurement has to arrive early enough to change what ships.</p><p>Anthropic&#x27;s Responsible Scaling Policy ties safety levels to capability thresholds and to the safeguards each level needs. The rule is a procedure: measure the capability, map it to a risk level, add the safeguards it needs. The threshold defines what changes behavior, and the mitigations must exist before deployment continues.</p><h2 id="elicitation-is-a-stress-test">Elicitation Is a Stress Test</h2><p>A weak evaluation misses a real capability because it asks badly. Strong elicitation gives the model its best reasonable shot: better prompts, more attempts, and expert-designed tasks. Tool access goes in when the task needs it.</p><p>A comfortable safety test measures your prompt. A strong one measures the model. You look for what the system can do before the world finds it for you.</p><p>The reasoning note kept verification outside the model. Elicitation is that verification, aimed at the ceiling of the model rather than at a single answer.</p><h2 id="measure-the-model-and-the-deployed-system">Measure the Model and the Deployed System</h2><p>A model can be capable of a dangerous action and still be unlikely to take it inside a locked-down product. The same model can look harmless in a chat window and turn risky the moment you hand it tools.</p><p>So the policy carries two numbers. One is raw capability. The other is what the deployed system permits. That number moves with the scaffold, the permissions, the policy layer, the monitoring, and the human review path.</p><p>Tools move both numbers at once. Tool access raises what elicitation can show, and it raises what the product lets the model do. Hold both numbers, or you are guessing.</p><h2 id="a-gate-has-four-pieces">A Gate Has Four Pieces</h2><p>A working gate has four pieces: a capability eval, a threshold, a mitigation, and an owner who can refuse. Take away the threshold and the measurement becomes trivia. A threshold with no required mitigation is theater. Without an owner, nobody pays a cost when someone says ship anyway.</p><p>I do not trust a gate until I can name the person who can refuse. The four pieces only work as a path, and the path ends at that name.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>A crossed threshold runs one path: the owner hears it, the required mitigation lands, and the owner decides.</figcaption></figure><h2 id="agents-turn-a-bad-answer-into-a-bad-sequence">Agents Turn a Bad Answer Into a Bad Sequence</h2><p>A chat model produces a bad answer. An agent produces a bad sequence. It gathers information, calls tools, makes irreversible changes, and adapts around weak guardrails.</p><p>So the safety review covers the whole sequence. You check four things in the trajectory: approval points, tool boundaries, stop conditions, and logs a human can follow. The stop condition carries the most weight, because uncertainty rises inside a run and the agent keeps acting.</p><p>Those logs carry the replayable trail from the enterprise note. The trail holds what the agent relied on, what it changed, and how a person undoes it. Without that trail, an incident review has nothing to replay.</p><p>Computer-use agents turn language into action on a screen, which is where the stakes rise. The capability and the risk come from the same mechanism. A gate for that system prices actions.</p><div class="v-decision"><span class="kicker">Agent safety</span><div class="body">When a model can act, measure what it can cause. Name the tool calls that are irreversible and make the agent stop before them.</div></div><h2 id="governance-needs-layers-because-any-single-test-bends">Governance Needs Layers Because Any Single Test Bends</h2><p>Manual review alone cannot cover every release, so governance needs benchmarks. People can game a fully automated eval, and an automated eval can miss the risk that matters. Each test bends in a different direction, which is the argument for stacking them.</p><p>The working stack is automated benchmarks, red-team exercises, expert review, staged deployment, monitoring, and stop conditions a person can trigger. One decision procedure ties them to deployment limits, independent review, incident response, and public commitments.</p><p>Every layer produces a score, and the score expires. Treat a score as permanent and you are governing an old model. Capability moves with fine-tuning, tools, scaffolds, prompts, deployment context, and user incentives.</p><p>So write retest triggers into the policy. A new tool, a fine-tune, or a wider deployment voids the last score, and someone runs the eval again.</p><h2 id="the-builder-test">The Builder Test</h2><p>Trace the stop path on a system you run now.</p><ul><li>Pick one eval whose result can stop your next release.</li><li>A result crosses the threshold. Write down who hears about it first.</li><li>Say which mitigation becomes mandatory before the release moves again.</li><li>List what you examine a second time after the mitigation lands.</li><li>Put a name on the person who can refuse, and say what refusing costs that person.</li></ul><p>An empty line names the missing piece of your gate. Fill it before the model or the deployment changes again.</p><h2 id="what-carries">What Carries</h2><p>Elicit hard, measure the model and the product it lives inside, then give one threshold authority over the release date. Everything else is documentation around a launch path someone already chose.</p><p>A gate decides what ships. The last note in this series meets the text that arrives after it ships.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Sat, 11 Apr 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>responsible-scaling</category><category>ai-safety</category><category>capability-evaluation</category><category>governance</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-open-models-need-open-science</guid>
    <title>Open Models Need Open Science</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-open-models-need-open-science</link>
    <description>Two teams can run the same model and report different scores. The scaffold is part of the result, which makes disclosure part of the science.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>Two teams can run the same model and report different scores. The scaffold around the model produced the gap. That makes the scaffold part of the result, and disclosure part of the science.</p><p>The scaffold is the loop from the agent-loop note. It runs observe, decide, act, examine, then remember. Every joint in it moves a score, and a leaderboard shows none of them.</p><h2 id="three-levels-of-access-and-one-supports-science">Three Levels of Access, and One Supports Science</h2><p>Open covers three kinds of release, and they differ by what an outsider can inspect.</p><ul><li>Black-box API. A user calls the model and cannot inspect the weights or the training process.</li><li>Open weights. A user runs and adapts the weights, while the data and the training details stay closed.</li><li>Fully open release. Weights, data, code, recipes, and reporting are public enough for outside scrutiny.</li></ul><p>Open weights help a team run and adapt a model. The data shows what shaped it, and the recipe lets a stranger repeat the run. Published evaluations let an outsider prove the claim instead of trusting the release note.</p><p>A model can be useful to run and still be hard to audit or repeat. Treating open release as a slogan blurs five separate things. Reproducible science, useful artifacts, commercial reuse, safety review, and downstream accountability each need a different layer.</p><h2 id="agents-add-a-second-black-box">Agents Add a Second Black Box</h2><p>An agent is a system. When the model is closed and the scaffold is closed, a benchmark compares two products. The number ranks the products and leaves the mechanism unnamed.</p><p>An open system lets a researcher ask a sharper question. Which part helped: the model, the tool interface, the retrieval source, the scoring code, or the search budget? Each answer sends the team to different work.</p><p>The reasoning note drew a line: reflection lives inside the model, and verification lives outside it. A closed scaffold pulls verification back inside the vendor, where no outsider repeats it.</p><h2 id="for-agents-openness-has-more-layers-than-weights">For Agents, Openness Has More Layers Than Weights</h2><p>Sort what a release can disclose into four groups.</p><ul><li>Model. Weights, tokenizer, architecture, and the training recipe where a team can publish it.</li><li>Data. Pretraining data, instruction data, filtering choices, and known contamination checks.</li><li>Scaffold. Prompt, tool definitions, memory policy, retrieval corpus, retries, action budget, stopping rule, and the code that runs the loop.</li><li>Evaluation. Task set, environment version, scoring code, and failure analysis.</li></ul><p>The scaffold row is where an agent score moves. Tool definitions are the action interface, and the memory policy is the state the loop carries. The stopping rule decides when a run ends.</p><p>One release can be open for use, closed for provenance, strong for adaptation, and weak for accountability at once. A score reported without those four groups is hard to read.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>Each layer opens on its own, and the scaffold layer splits two teams on the same weights into two scores.</figcaption></figure><h2 id="two-teams-one-model-different-scores">Two Teams, One Model, Different Scores</h2><p>With a plain model, a team compares prompt in and answer out. With an agent, the scaffold joins the measured system.</p><p>The gap between two labs on the same weights comes from five knobs. Tool surface, attempts, context budget, retrieval, and environment each move the number. A cleaner browser interface and a hidden retrieval source both show up as model quality. None of the five touches the weights.</p><p>A team that states the knobs publishes evidence. A team that hides them publishes a product claim. Both ran the same model, and only one said what else it ran.</p><p>The demo-thinking note named the quiet version of this. A human supplied the missing state, and the system took the credit. An undisclosed scaffold does the same thing on a leaderboard.</p><h2 id="opacity-slows-the-field-down">Opacity Slows the Field Down</h2><p>Two costs land right away. A team repeats a mistake because the recipe stayed private. A benchmark drifts into marketing because hidden details decided the result.</p><p>The third cost lands on safety. An agent acts through tools, so its trail matters more than the trail of a model that only answers. An outsider cannot audit what a release does not show.</p><p>The enterprise-agent note made every action name what it relied on, what it changed, and how to undo it. A release owes an outsider the same three answers.</p><div class="v-decision"><span class="kicker">Scientific standard</span><div class="body">Open science is how a field compounds knowledge instead of rediscovering its own footnotes.</div></div><p>The honest trade runs between scientific inspectability, competitive advantage, misuse risk, and privacy. Serious people draw that line in different places. A team that closes a layer and names it stays honest.</p><h2 id="the-builder-test">The Builder Test</h2><p>Ask what a stranger can prove without help from the team that shipped the model.</p><ul><li>Run the model from the released artifact alone.</li><li>Inspect the data: what went in, what got filtered out, which contamination checks ran.</li><li>Repeat the recipe closely enough that the numbers land in the same place.</li><li>Compare evaluations: task set, environment version, scoring code, and the failure cases.</li><li>Read the license and the safety report, then name what each one forbids.</li></ul><div class="v-constraint"><div class="kicker">Audit question</div><div class="body">The real openness level is whatever a serious outsider can reproduce, inspect, or falsify.</div></div><p>Whatever fails that list is the part of the release that only the team can vouch for. Add one line to the release note: who maintains this, and for how long.</p><h2 id="what-carries">What Carries</h2><p>Openness is a stack of evidence. One label on a release tells a reader nothing about which layer opened.</p><p>Calling an API and reproducing a result are different claims. Both can be true, and only the second one lets the field build on the work.</p><p>Disclosure tells an outsider what happened. A release gate decides whether it happens at all.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Thu, 09 Apr 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>open-source</category><category>foundation-models</category><category>evaluation</category><category>science</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-embodied-agents-need-a-data-pyramid</guid>
    <title>Embodied Agents Need a Data Pyramid</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-embodied-agents-need-a-data-pyramid</link>
    <description>A robot motion has no undo. An embodied agent needs a data pyramid, a simulator for cheap failure, and feedback that reports what changed.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>A robot motion has no undo. That one constraint reorganizes everything the earlier notes in this unit built. Three parts carry the weight: a data pyramid, a simulator for cheap failure, and feedback that reports what changed.</p><p>The overview note drew the agent as five steps: observe, decide, act, examine, remember. Robotics keeps all five steps and makes the act step irreversible.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>Embodied agents need a data pyramid, a simulator, and real-world feedback because the body makes mistakes expensive.</figcaption></figure><h2 id="a-robot-motion-has-no-undo">A Robot Motion Has No Undo</h2><p>You can undo a browser click. A robot motion can break an object, hurt a person, or damage the robot itself. That changes the engineering.</p><p>A bad plan shows up as a missed grasp, a spilled object, an unsafe motion, or a broken recovery. A text agent is wrong on a screen. A robot is wrong in the room.</p><p>The embodied stack must turn high-level intent into low-level control under uncertainty. A language model can read &quot;pick up the cup&quot;. The controller decides grip, force, trajectory, timing, contact, and recovery.</p><h2 id="the-generalist-robot-needs-more-than-a-language-model">The Generalist Robot Needs More Than a Language Model</h2><p>The target is one system that understands instructions, perceives the world, plans actions, and controls a body across many tasks.</p><p>That needs perception, control, simulation, imitation, reinforcement learning, and a way to move behavior from synthetic worlds onto real hardware. Foundation agents put broad priors and task-specific adaptation in one stack. It is the foundation-model bet with physics in the loop.</p><p>The agent-loop note put the rule as the weakest interface setting the ceiling. Here the weakest interface is a hand closing on a real object. A better language model does not close a gripper more gently.</p><h2 id="every-level-of-the-data-pyramid-pays-for-something-else">Every Level of the Data Pyramid Pays for Something Else</h2><p>The pyramid sorts training data by cost. At the base sits a large amount of cheap synthetic or weak data. Higher up the volume drops and the realism rises. At the top sit expensive real-world demonstrations.</p><p>The pyramid answers where the data comes from, and four sources fill it.</p><ul><li>Web video gives breadth.</li><li>Simulation gives cheap variation.</li><li>Human demonstrations give intent.</li><li>Robot trajectories give contact, timing, and failure.</li></ul><p>Real data is precious, and simulation is how you multiply it. Language and video data supply the broad priors under both. A robotics system uses every level to survive the gap between language and action.</p><h2 id="simulation-is-a-rehearsal-room">Simulation Is a Rehearsal Room</h2><p>A simulator lets the agent fail for free. Reinforcement learning shapes whole-body control, and imitation learning copies demonstrations. Domain randomization makes a policy less brittle when reality stops matching the simulator.</p><p>The failure mode is trust in a clean simulator. A policy can score well there and fall apart when lighting, friction, object shape, camera angle, or timing changes. Sim-to-real is the bridge between cheap practice and useful action.</p><div class="v-constraint"><div class="kicker">Sim-to-real rule</div><div class="body">Treat the simulator as a rehearsal room. Aim for enough variation that the real world stops being a surprise. Real hardware still needs calibration, safety limits, feedback, and recovery.</div></div><h2 id="language-says-what-matters-control-does-the-work">Language Says What Matters, Control Does the Work</h2><p>Language earns its place as the interface for goals, instructions, explanations, memory, and compositional tasks.</p><p>A low-level controller moves a gripper. A language-conditioned agent ties that motion to &quot;clear the table, but leave the medicine bottle where it is&quot;. That is the jump from control policy to useful assistant.</p><p>The exception must live in state, not in the prompt. The agent-loop note called state the safety feature, and a medicine bottle is what that means with a body attached. If the constraint lives only in the sentence, the controller has nothing to check before it closes on the bottle.</p><p>Language tells the system what matters. The controller still owns everything below the sentence. The shallow read imagines instruction following as the hard part. The danger is a stack that treats a good instruction as a solved control problem.</p><h2 id="the-builder-test">The Builder Test</h2><p>Name what the robot can examine after each action. A system that cannot tell whether the drawer opened, the object moved, or the grip failed cannot recover.</p><p>For a reversible action the examine step follows the act step. For an irreversible one it must come first. A safety check that runs after the motion is a log entry.</p><p>Separate perception, world state, planning, control, feedback, latency, and safety margin. On real hardware the agent survives noisy sensors, delayed feedback, irreversible actions, and an environment that changes after each move.</p><p>Four checks before the policy leaves the simulator:</p><ul><li>Name which state the robot senses and which state it infers.</li><li>Name the actions that cannot be recovered from.</li><li>Show how you tested the shift out of simulation.</li><li>Point at the line where the safety constraint is enforced.</li></ul><h2 id="what-carries">What Carries</h2><p>Embodied intelligence is perception, action, feedback, and correction under real constraints. Action becomes part of the data distribution. A language plan is one component inside a closed loop.</p><aside class="rm-takeaways" aria-label="The physical loop"><div class="rm-takeaways-title">The physical loop</div><ul><li>Perceive the state.</li><li>Choose an action.</li><li>Measure what changed.</li><li>Recover when the world disagrees.</li></ul></aside><p>Every claim in this unit rests on somebody being able to check it. The last three notes ask who checks yours.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Tue, 07 Apr 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>robotics</category><category>embodied-agents</category><category>simulation</category><category>project-groot</category><category>reinforcement-learning</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-neural-symbolic-planning-is-the-escape-hatch</guid>
    <title>Language for Ambiguity, Solvers for Commitments</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-neural-symbolic-planning-is-the-escape-hatch</link>
    <description>Language handles messy intent and a solver handles exact constraints. The translation between them is the step that breaks, so expose the formal problem before the solver commits.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>Language handles messy intent. A solver handles exact constraints. The translation between them is the step that breaks. A solver can be perfectly wrong about a badly stated problem.</p><p>Language models are not good at every kind of planning. They sound coherent and violate constraints in the same paragraph.</p><h2 id="one-missed-constraint-kills-the-plan">One Missed Constraint Kills the Plan</h2><p>Travel planning makes the failure obvious. One plan must satisfy dates, budgets, locations, preferences, availability, and ordering at the same time. Miss one and the itinerary is impossible to execute, however well it reads.</p><p>A plan that reads well and breaks one rule is worse than a plan that fails on its face. The first one gets executed.</p><h2 id="three-ways-out-and-one-works-now">Three Ways Out, and One Works Now</h2><p>Researchers take three routes out of this.</p><ul><li>Make the language model better at planning on its own.</li><li>Combine the language model with a symbolic solver.</li><li>Train models so that symbolic structure emerges inside the network.</li></ul><p>The middle route is the one a team can build this quarter. Route one waits for a better model, and route three waits for a training run. The middle route needs an interface between two components you already have.</p><h2 id="a-solver-holds-every-constraint-at-once">A Solver Holds Every Constraint at Once</h2><p>A symbolic solver is boring in the best way. Formalize the constraints correctly and the solver does not drop one because that sentence sat far away in the prompt. It searches the space with rules.</p><p>The split is clean. The model translates natural language into a structured problem. The solver searches that space and returns a valid plan. The model translates the result back into language a person can act on.</p><p>The reasoning note put reflection inside the model and verification outside it. The solver is that outside check, aimed at constraints instead of arithmetic.</p><div class="v-decision"><span class="kicker">Hybrid rule</span><div class="body">Do not ask a language model to be a calculator, database, planner, and narrator at the same time. Split the job.</div></div><h2 id="formalization-is-the-fragile-step">Formalization Is the Fragile Step</h2><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>The solver enforces whatever it is handed, so the translation step decides whether the plan is right.</figcaption></figure><p>The hard part is the translation from messy language into the correct formal problem. A user asks for something cheap but not terrible. The system must decide what cheap means and what terrible means. The system must also decide whether either one is a hard constraint or a soft preference.</p><p>A solver enforces whatever it is handed. Nothing inside it knows the difference between a constraint the user meant and one the model invented.</p><p>The tools note said it plainly: the weakest interface sets the ceiling. Here the weakest interface is the sentence that becomes a constraint list.</p><p>The model still earns its place at that boundary. It handles the ambiguity and asks the question that settles it. Then it hands over a structure the solver can search.</p><p>I review the constraint list, not the plan. Expose the structured object before the solver runs. Show the list in the user&#x27;s own words, and mark each constraint hard or soft. Let a person or a test reject a malformed structure before any action runs.</p><p>Catch a wrong list and the fix costs one sentence. Miss it and the fix costs whatever the plan already committed.</p><h2 id="solver-traces-teach-the-search-path">Solver Traces Teach the Search Path</h2><p>The third route becomes practical here. SearchFormer and DualFormer-style work trains on solver traces, and uses search dynamics and reasoning traces to teach better planning behavior.</p><p>The model sees more than the final answer. It sees the path that a stronger search process took.</p><p>A hybrid system writes those traces while it runs. The training data for route three is a by-product of route two.</p><h2 id="use-the-pattern-where-correctness-is-checkable">Use the Pattern Where Correctness Is Checkable</h2><p>Use the hybrid pattern when correctness depends on constraints you can examine. Schedules, routes, resource allocation, budgets, dependencies, access policies, inventory, and proof-like structure all qualify.</p><p>Skip it when the real problem is taste, strategy, judgment, or open-ended synthesis. Solvers can help at the edges there, and they will not define the target for you.</p><p>The pattern also gets thin when you ask the model to reason through everything in prose. That breaks when the environment has hard rules, long horizons, or costly invalid actions.</p><h2 id="the-builder-test">The Builder Test</h2><p>Take one task you own this week and draw it. Label the part that reads ambiguity and the part that searches or plans. A single component doing both is the joint that fails first.</p><p>Name the part of that task that must be exact. Put it behind a tool, solver, verification step, or safety gate. Do not hope that the model stays careful.</p><ul><li>List the constraints that cannot be violated, before anything is generated.</li><li>Name the one place where learned ranking beats a rule, and give the ranker only that job.</li><li>Write down the point where the plan becomes an action, and put the gate there.</li><li>Make the symbolic layer report the constraint it failed to satisfy, and never swallow it.</li></ul><p>A step that needs a guarantee belongs to a planner, a verifier, a controller, or a policy gate. Compose learned judgment and explicit constraints on purpose. Otherwise you ship a system where nobody can name the part that decided.</p><h2 id="what-carries">What Carries</h2><p>Use language where language is strong. Use external structure where language is weak. Inspect the handoff between them, because by default that boundary has no owner.</p><p>Every mistake in this note is a wrong plan on a screen, and a screen has an undo. Fix the handoff while that is still true. The next note puts this loop inside a body, and the undo goes away.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Sun, 05 Apr 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>planning</category><category>neural-symbolic</category><category>solvers</category><category>search</category><category>decision-making</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-enterprise-workflows-need-state</guid>
    <title>A Workflow Agent Needs a Tape</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-enterprise-workflows-need-state</link>
    <description>Models solve single steps and lose the thread once the steps compose. A replayable tape buys more reliability than a better prompt.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>Models solve single steps and lose the thread once the steps compose. A replayable tape buys more reliability than a better prompt. A workplace agent runs across APIs, forms, browsers, tickets, calendars, documents, and business rules. The hard part is holding state across that mess, where one wrong action corrupts the task.</p><p>Without a tape, the agent becomes a run of tool calls and confident summaries. It clicks, updates records, and moves on, and nobody can tell afterward whether it helped.</p><h2 id="api-agents-and-web-agents-fail-differently">API Agents and Web Agents Fail Differently</h2><p>API agents act through structured calls. The action space is named and small, and the system knows the schema.</p><p>Web agents act through pages. They handle visual layout, hidden state, DOMs that change under them, and buttons whose labels are ambiguous. People built those workflows for people, and nobody rewrote them for a model.</p><p>A rejected call reports its own error. A wrong click can leave a page that looks correct and a record that is now wrong.</p><p>Enterprises carry both. The APIs exist, and real work still leaks through browser screens. The note on software agents made the interface the part you build. Here you inherit the interface.</p><h2 id="tapeagents-treats-the-trajectory-as-an-object">TapeAgents Treats the Trajectory as an Object</h2><p>TapeAgents keeps the trajectory as an object. The tape records thoughts, actions, observations, and decisions in the order they happened. It also holds what the user asked for, what failed, and what is still blocked.</p><p>By replayable I mean the tape alone reconstructs the run, with the agent switched off. You debug by replaying and finding the step where it turned. You improve the agent from the same tape, because it is data about its own behavior.</p><p>A tape that records only call payloads goes blind where the web agent works. Page observations belong on it too.</p><div class="v-decision"><span class="kicker">Audit rule</span><div class="body">An enterprise agent that cannot replay its own run does not belong in a workflow that matters.</div></div><p>The grounding note asked one question of every answer: which shelf did this come from. A workflow adds two more: what did you change, and how does a person undo it. The tape answers all three.</p><h2 id="models-solve-steps-and-lose-the-composition">Models Solve Steps and Lose the Composition</h2><p>WorkArena-style benchmarks measure common knowledge work. The agent must work inside enterprise software, satisfy constraints, and finish a task that takes many steps.</p><p>The benchmarks expose a common weakness. Models solve isolated steps and struggle once those steps compose. The failure sits in planning, memory, interface interpretation, and error recovery more often than in missing knowledge.</p><p>Each of those is a state problem. Planning needs the goal and the list of finished subtasks. Error recovery needs what the agent already tried and what failed. Both live outside the model.</p><p>A demo hides all of this. The person driving supplies the missing state between steps, and the overview note called that demo thinking. In production nobody holds the thread, so the agent must carry it.</p><h2 id="state-is-the-safety-feature">State Is the Safety Feature</h2><p>The system must know what it read, what it changed, and what still needs approval. It must also tell which assumptions came from the user and which came from a tool.</p><p>Drop that state and the failures are ordinary. The agent repeats steps, forgets constraints, submits half-finished forms, and treats a stale observation as current truth.</p><p>The tape is the file. The four states are its columns, written at every step and readable at any row. Remember is the loop step that fills them.</p><ul><li>Task state: the goal in play, and the subtasks already finished.</li><li>World state: what the agent saw, and when that observation was valid.</li><li>Permission state: which actions need a confirmation or a human approval.</li><li>Evidence state: which sources justify the current answer or action.</li></ul><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>Each row is one step, and every step carries its four state values plus any approval it needed.</figcaption></figure><p>Permission state has to sit apart from task state. An agent that infers permission from its own progress approves itself.</p><p>Write the workflow as states, transitions, roles, evidence, approvals, deadlines, and exceptions before you assign a model anything. Then give the model a job inside it: see, draft, classify, route, or act. Start with the model and you get generated messages chained through a process. That breaks at the first exception that needs a role, a deadline, or a human decision.</p><h2 id="ask-a-human-at-decision-boundaries">Ask a Human at Decision Boundaries</h2><p>An agent that asks a precise question is safer than one that guesses. The design job is to make those interruptions rare, specific, and worth the user&#x27;s attention.</p><p>Approval on every step is a failure with a friendly face. The user does the task twice, once by watching and once by clicking. The approvals become a reflex, and the one that mattered goes through unread.</p><p>The interrupt fires when the agent spends money, changes records, contacts people, deletes data, or acts on uncertain information. Everything else it does without asking.</p><p>That rule lives in the permission column, and the tape records who approved what. A workflow can run end to end and still need approval gates and rollback points.</p><h2 id="the-builder-test">The Builder Test</h2><p>Replay one finished task from the tape with another person reading over your shoulder. They must see every observation, action, result, permission state, and approval without asking you a question.</p><p>Where they have to ask, the tape is thin at that step. Repair the tape there before you widen what the agent is allowed to touch.</p><h2 id="what-carries">What Carries</h2><p>Judge workflow quality after the task finishes, by whether a person trusts the path. A finished task proves the agent moved. A replayable tape proves someone can follow every step, resume the task, and undo it.</p><p>A tape records what happened. Some tasks need a component that refuses to let the wrong thing happen at all.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Fri, 03 Apr 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>enterprise-workflows</category><category>web-agents</category><category>workarena</category><category>tapeagents</category><category>api-agents</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-coding-agents-live-or-die-by-their-interface</guid>
    <title>Coding Agents Live or Die by Their Interface</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-coding-agents-live-or-die-by-their-interface</link>
    <description>Better commands and clearer observations improved SWE-agent results with the base model unchanged. The interface is the part you build, and SWE-bench still passes patches that miss the intent.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>The interface is the part of a coding agent that a team builds, and it sets the ceiling on the model inside it. SWE-agent showed the mechanism: better commands and clearer observations improved results while the base model stayed fixed.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>The interface around the model decides what a coding agent can do with a repository.</figcaption></figure><h2 id="code-has-an-oracle">Code Has an Oracle</h2><p>Coding agents are the easiest agents to overrate and the easiest to check. Code has tests. The agent can claim it fixed the bug, and the test suite gets the last word.</p><p>Autocomplete suggests and an assistant answers. An agent inspects the repository, edits files, runs commands, reads the failure, and tries again. Each rung takes more responsibility, and only the last one runs the code.</p><h2 id="the-agent-sees-the-repo-through-its-tools">The Agent Sees the Repo Through Its Tools</h2><p>A coding agent sees the repository through a narrow surface: search, open file, edit, run tests, read output. Everything it knows about the code arrives through that surface. In a real repository the same channel carries linters, type errors, and version-control state. When those tools are clumsy, the agent makes worse decisions with less to go on.</p><p>SWE-agent gave that surface a name, the agent-computer interface, and treated it as the variable to move. Command design, observation format, and file localization are edits a team makes without touching a weight.</p><p>The loop note made the same argument for a browser agent, where the action space decides how much the model must infer. Code shows it first because a failing test names the line that broke.</p><h2 id="a-bad-action-space-gives-too-little-power-or-too-much-rope">A Bad Action Space Gives Too Little Power or Too Much Rope</h2><p>A bad action space fails in two directions. An agent that reads one terminal line at a time burns its context on noise. Hand it the power to rewrite the repository with no guardrails and the patch comes back too big for anyone to review.</p><p>The surface that works copies how a careful engineer already moves. Search symbols, read the nearby code and its style, and make one narrow change. Run the smallest test that applies, and widen the change only when the evidence demands it.</p><ul><li>Search must return ranked, structured context, never a wall of text.</li><li>Edits must be patch-shaped, easy to review and easy to revert.</li><li>Test output must come back summarized, with the failing line kept intact.</li><li>Every command must carry a cost label: cheap, expensive, risky, or destructive.</li></ul><h2 id="file-localization-is-half-the-battle">File Localization Is Half the Battle</h2><p>Most coding tasks start as a search problem: which file owns the behavior, which function matters, which test describes the failure.</p><p>The agent that reads everything loses. The agent that narrows fast wins. Localization is the first engineering act in a run, and every later step inherits it.</p><div class="v-constraint"><div class="kicker">Repo rule</div><div class="body">A good coding agent goes wide and cheap first, then deep only when the search space is small.</div></div><h2 id="the-best-runs-are-boring">The Best Runs Are Boring</h2><p>A serious coding agent lives inside one cycle: orient, hypothesize, edit, run the test, read the failure, repeat. The best runs feel boring because every step has evidence behind it.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>The search narrows before the patch, and the test failure decides what the next patch touches.</figcaption></figure><p>The overview drew that shape as observe, decide, act, examine, remember. A coding agent fills the examine step with a command that returns a verdict.</p><p>An agent can jump from the issue text to a confident patch. When it cannot show how it localized the behavior, it skipped the step where most engineering judgment lives.</p><h2 id="swe-bench-still-passes-patches-that-miss-the-intent">SWE-bench Still Passes Patches That Miss the Intent</h2><p>SWE-bench asks agents to fix real GitHub issues, which puts it closer to real work than multiple choice. The scoring stays messy anyway.</p><p>Tests flake, issue descriptions arrive incomplete, and dependencies stay hidden. A patch passes the suite, misses the intent, and the benchmark marks it solved.</p><p>The reasoning note put the verifier outside the model. A test that passes while the intent fails is a weak verifier. The agent cannot see that gap from inside its own loop.</p><p>Read the final report against the diff. That check catches the loud failures: the wrong file changed, unrelated work overwritten, success declared before the code ran. The other check is whether the tests exercised the changed behavior. A green suite that never ran the new path proves nothing.</p><h2 id="the-builder-test">The Builder Test</h2><p>Ask what the agent learns after a failed test. Take one run, stop at the first red test, and read what the agent does next.</p><p>A loop that cannot turn failure output into a smaller, better patch is not a coding workflow yet. The next patch must be narrower than the last one, and the failing line must explain why.</p><div class="v-decision"><span class="kicker">Engineering bar</span><div class="body">A coding agent is done when it can name what it changed and which evidence passed. Anything short of that is text.</div></div><h2 id="what-carries">What Carries</h2><p>Carry the edit-test loop. A test run is the oracle that tells the agent whether the patch touched reality. The interface decides whether the agent can reach that oracle and read what it says.</p><p>Code gets that oracle for the price of a command. Most workplace tasks have no oracle at all. The record of what the agent did is the only thing left to read, so build the record before you need it.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Wed, 01 Apr 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>coding-agents</category><category>swe-agent</category><category>openhands</category><category>software-engineering</category><category>evaluation</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-compound-ai-systems-and-dspy</guid>
    <title>A Prompt You Cannot Score Is a Preference</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-compound-ai-systems-and-dspy</link>
    <description>DSPy replaces prompt tweaking with a signature and a metric. The metric you pick becomes the system you get, so design the metric before the pipeline.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>DSPy replaces prompt tweaking with a signature and a metric. The metric you pick becomes the system you get. Treat every model call as a module inside a program. Then optimize the program against a number you chose on purpose.</p><h2 id="real-tasks-need-more-than-one-call">Real Tasks Need More Than One Call</h2><p>One model call is convenient and narrow. A real task needs retrieval, decomposition, ranking, verification, tool calls, and retries, and none of that lives inside the call. A compound AI system is what you build around the model to cover the rest.</p><p>The compound system can beat the model alone because it adds structure. It decides what context to retrieve, how to ask, how to combine outputs, and how to examine them.</p><p>The overview note gave the alternative a name: demo thinking. A person supplies the missing state between steps, and the demo works because of the person. One giant prompt has the same shape, with the state buried in a paragraph nobody can score.</p><h2 id="dspy-turns-prompting-into-programming">DSPy Turns Prompting Into Programming</h2><p>DSPy reframes prompting as programming. A signature says what goes in and what must come out. Modules compose into a pipeline. An optimizer then searches for instructions, demonstrations, or parameters that move the metric you chose.</p><div class="codeblock"><pre><code class="language-text">question -&gt; retrieve passages -&gt; draft answer -&gt; verify against passages -&gt; revise -&gt; final answer with citations</code></pre></div><p>Each arrow in that line is a place to measure. Most prompt work never gets that far. You change a sentence, look at the output, and hope it generalizes to the next question.</p><p>Define the task, define the metric, run the optimizer, then compare results. Comparison is the step that turns a change into evidence.</p><h2 id="the-signature-is-the-quiet-win">The Signature Is the Quiet Win</h2><p>The signature is the part people skim. It forces you to name what information enters the module and what shape the module must return.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>A signature fixes the edges of a module so the optimizer can change everything inside it.</figcaption></figure><p>A signature turns &quot;ask the model nicely&quot; into a contract. With a contract you can test the module and swap it. You can also reason about how it composes with the modules on either side.</p><p>Ownership starts at the contract. When a run goes wrong, you want one question answered: which module owns the failure? Without named inputs and outputs, the answer is the whole pipeline, which is the same as no answer.</p><h2 id="the-optimizer-gives-you-exactly-what-you-measure">The Optimizer Gives You Exactly What You Measure</h2><p>Optimization helps when the pipeline and the metric match the real job. Aim the optimizer at a cheap proxy and you get a system that is excellent at the proxy.</p><p>Metric overfitting is the standard failure. The optimizer moves whatever the score rewards, and the score climbs while the product gets worse.</p><ul><li>Reward answer length and the optimizer learns verbosity.</li><li>Count citations on the surface and the system learns to cite without understanding.</li><li>Leave latency and cost out of the score and the optimizer can build something impressive and unusable.</li></ul><div class="v-decision"><span class="kicker">Metric first</span><div class="body">Write the metric before the pipeline, and put latency and cost inside it. The optimizer spends whatever the metric ignores.</div></div><p>Bad tests produce bad software. Bad evals produce bad agents. The reasoning note drew the line: reflection happens inside the model, and verification happens outside it. A metric is that outside signal written down, and a weak metric is reflection with a number attached.</p><p>An evaluator decides whether a change improved the system or only made one demo prettier. Someone has to design that evaluator, so judgment moves earlier, into the metric and the module boundaries. That work happens before the first tuning run, and it is the expensive part.</p><h2 id="agents-have-programmable-insides">Agents Have Programmable Insides</h2><p>An agent looks like an open-ended loop from the outside. The inside is a set of modules you can program and score. Retrieval, tool choice, answer synthesis, and verification each take a named input and return a named output.</p><p>Teams add prompt steps until the examples look better. Without module-level evidence, the system gets slower and harder to debug while the real bottleneck stays untouched.</p><p>Attach examples and a metric at each interface, and a regression gets a return address. Keep the examples that expose regressions, and run them against every tuned version. Then you can show which component changed when the score improved.</p><p>The move is to replace vibes with interfaces. A coding agent needs files, tests, commands, and patches. A workflow agent needs state, permissions, rollback, and logs.</p><p>The agent-loop note put the rule plainly: the weakest interface sets the ceiling. A compound system makes those interfaces visible enough to rank.</p><h2 id="the-builder-test">The Builder Test</h2><p>Take a system you run this week. List its interfaces: the tool schema, the retrieval quality, the state format, the evaluator, and the permission boundary.</p><p>Rank them by what a bad version of each costs you. The lowest one sets your ceiling, and prompt work does not raise it. I start at the evaluator, because a broken evaluator hides every other problem on the list.</p><p>Then write down which module owned your last bad output. If nobody can name it, name the interfaces before you tune anything else. Read the tuned program afterward. A pipeline no one on the team can follow is a black box you now own.</p><h2 id="what-carries">What Carries</h2><aside class="rm-takeaways" aria-label="The four names"><div class="rm-takeaways-title">The four names</div><ul><li>Name the module.</li><li>Write down its input and its output.</li><li>Pick the metric that decides better.</li><li>Optimize against the metric rather than taste.</li></ul></aside><p>A metric is only as good as the oracle behind it. Code carries the strongest oracle in this unit, because a test suite answers without an opinion. Take your weakest module to a task where the oracle runs itself, and find out whether your metric survives contact.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Mon, 30 Mar 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>dspy</category><category>compound-ai-systems</category><category>prompt-optimization</category><category>rag</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-enterprise-agents-need-grounding-not-demos</guid>
    <title>Enterprise Agents Need Grounding</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-enterprise-agents-need-grounding-not-demos</link>
    <description>A larger context window holds more noise as easily as more truth. Grounding shows which shelf the answer came from, and enterprise work runs on that difference.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>A larger context window holds more noise as easily as more truth. Grounding shows which shelf the answer came from. That difference separates a demo answer from an answer someone acts on inside a business process.</p><h2 id="enterprise-work-has-a-different-failure-budget">Enterprise Work Has a Different Failure Budget</h2><p>A model can be fluent and fast and still be unusable inside a company. One wrong answer that a person acts on costs more than one right answer earns. That asymmetry is the failure budget.</p><p>By usable I mean four things. The answer grounds every claim in company data. Access controls bind the agent the way they bind a person. Messy workflows do not break it, and the output leaves a trail an auditor can follow.</p><p>That budget changes the question. One impressive run shows the model can do the task once. A company asks whether the system helps it make fewer bad decisions.</p><h2 id="enterprise-work-arrives-as-slides-tickets-and-screenshots">Enterprise Work Arrives as Slides, Tickets, and Screenshots</h2><p>Clean text is rare. Real work shows up as slides, PDFs, spreadsheets, logs, screenshots, emails, charts, database rows, tickets, and meetings.</p><p>A useful agent moves across those forms. It reads, compares, extracts, summarizes, and acts. Flattening them into text too early destroys the structure the answer depends on. A spreadsheet turned into a paragraph loses the row and the column that carried the number.</p><p>Form decides what a citation can point at. You can cite a row, a cell, or a ticket. A paragraph that was once a table gives a reader nothing to check.</p><h2 id="long-context-is-room-grounding-is-knowing-the-shelf">Long Context Is Room, Grounding Is Knowing the Shelf</h2><p>Long context helps, and it stops short of an answer you can defend. Put more tokens into the prompt and three failures remain. The model misses the one detail that mattered. Two documents disagree and nothing in the system settles which one wins. The answer arrives with no way to show where it came from.</p><p>Teams list access control and provenance as two separate requirements, and they are two ends of one path. The permission check decides what enters retrieval. The citation proves what came out.</p><p>A document that slips past the permission check contaminates every answer built on it. Nobody can examine an answer that cites nothing. Grounding also means the system refuses to treat stale or unauthorized text as instruction.</p><p>The reasoning note drew the same line. Reflection happens inside the model. Verification happens outside it, and a citation is verification a company can run without trusting the model.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>Every arrow on this path is a place where an answer can lose the evidence behind it.</figcaption></figure><h2 id="production-rewards-repeatability">Production Rewards Repeatability</h2><p>Most demos work because a person supplied the missing state, which is the trap the loop note named. Production removes that person, and every gap the person filled becomes a defect. A demo can sound correct and still read the wrong document. It can ignore permissions, miss a newer record, or take an action nobody can audit.</p><p>When I evaluate an enterprise agent, I ignore the first beautiful answer. I watch the tenth messy run and check five things.</p><ul><li>Give the agent only the documents and tools this user can open.</li><li>Make every claim that matters point back to a source, a row, a ticket, or a tool result.</li><li>Name the one place the system changes when the business process changes.</li><li>Decide which tasks you measure offline, which you watch live, and what failure rate you accept.</li><li>Route low confidence to a pause, a question, a human, or a refusal.</li></ul><p>Irreversible actions get their own gate. An agent must pause before any step that can cost money or trust, and a person must approve that step.</p><h2 id="the-intern-with-a-badge">The Intern With a Badge</h2><p>A new intern reads fast and writes well. Nobody hands that intern every file cabinet, every customer record, and the power to approve invoices on day one. The intern gets a badge, a checklist, a manager, and a logbook.</p><p>Enterprise AI has the same shape. The workplace decides what the agent can see and what the agent can do. It also decides how everyone else inspects the result.</p><p>A conversation about productivity skips the parts that decide the outcome. It leaves out data access, permissions, compliance records, and the case where the agent is persuasive and wrong. Walk one task through the control surface instead.</p><ul><li>Record which identity performs each action.</li><li>List the data that identity can open, and stop retrieval at that boundary.</li><li>Assign one person to review exceptions.</li><li>Pick the business metric that proves the workflow improved.</li></ul><p>An enterprise agent earns trust when it becomes an accountable participant in the control systems the company already runs.</p><h2 id="the-builder-test">The Builder Test</h2><p>Take one answer your agent produced and walk it backward to evidence. Write down which records the permission check allowed, which of those retrieval returned, and which ones the answer cited. Find the place where two sources disagreed and say what settled it. Name the action that waited for a human approval.</p><p>Any step you cannot fill in is a step the system does not have.</p><h2 id="what-carries">What Carries</h2><p>A user must be able to ask what the agent relied on, what it changed, and how to undo it. An agent that cannot answer all three is not ready for a workplace. Those three answers are the product.</p><p>Grounding is a promise about evidence. The next note makes that promise scoreable.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Sat, 28 Mar 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>enterprise-ai</category><category>grounding</category><category>gemini</category><category>multimodal</category><category>rag</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-frameworks-are-coordination-machines</guid>
    <title>Frameworks Are Coordination Machines</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-frameworks-are-coordination-machines</link>
    <description>A framework earns its keep when it makes a hidden decision explicit: who owns state, who calls tools, and what ends the loop.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>A framework earns its keep when it makes a hidden decision explicit: who owns state, who calls tools, and what ends the loop. Those decisions exist whether or not the framework names them. The coordination machine is the part your team writes. It decides who talks, what state the run keeps, which tool the system calls, when the loop stops, and how a person takes control.</p><h2 id="a-second-agent-must-remove-a-bottleneck">A Second Agent Must Remove a Bottleneck</h2><p>The multi-agent pitch is a room of specialists. Planner, coder, critic, researcher, executor. Each has a role, they pass messages, and the work improves.</p><p>Sometimes it does. Sometimes you get a meeting with no manager. The value comes from structure. That structure has clear roles, bounded turns, explicit handoffs, shared state, and a test that decides when the result is good enough.</p><p>The loop note named five steps: observe, decide, act, examine, remember. A role earns its existence by owning one. The planner owns decide, the executor owns act, and the verifier owns examine. A system where all three do the same job has one agent and three labels.</p><p>Add a second agent only when it removes a named bottleneck: different tools, different context, different verification, or different ownership. An agent that shares all four only adds turns.</p><h2 id="autogen-turns-conversation-into-control-flow">AutoGen Turns Conversation Into Control Flow</h2><p>AutoGen made the multi-agent idea concrete by treating conversation as a runtime primitive. You give each agent a role, connect them in a group chat, hand them tools, and set a stop condition. Control flow becomes the question of who speaks next.</p><p>The gain is separation. One monolithic chain runs a single voice through a single context. A group chat runs specialized participants under rules, so the research context stays out of the coding prompt.</p><p>The cost lands on state. In a group chat, the shared state is the transcript. The ReAct note asked you to replay one run from logs and explain every transition, and a transcript does not survive that test. You can read what each agent said, and you cannot recover which fact the system relied on when it acted.</p><h2 id="stateflow-trades-flexibility-for-inspectability">StateFlow Trades Flexibility for Inspectability</h2><p>Free-form conversation is flexible and hard to control. StateFlow puts the run in a named state, and it allows only the transitions on the list. The run stops for a reason the system can print.</p><p>You give up the move where an agent improvises a new step mid-run. You get four answers instead: the current state, the legal transitions, the evidence that moved the task forward, and the reason the run stopped.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>The chat holds what was said, and the state machine holds what the run relied on and why it stopped.</figcaption></figure><p>The state machine is less magical than a group chat, and in production that trade pays. A named state and a stated stop reason let a colleague read a failed run they never watched.</p><h2 id="llamaindex-is-the-catalog-the-agents-read-from">LlamaIndex Is the Catalog the Agents Read From</h2><p>An agent reads from whatever it can reach. It needs data, and data needs structure before retrieval works, so without the catalog and the labels the assistants wander.</p><p>A useful RAG system is a pipeline: ingestion, parsing, indexing, retrieval, reranking, synthesis, citations, and evaluation. The language model is one stage in that list. Multimodal knowledge assistants run on the same stages, and parsing turns mixed documents into something an index can hold.</p><p>Citations are the stage that decides trust. The test is whether the system can name the source of each retrieved fact. A system that retrieves well and cites nothing gives you a confident answer you cannot check.</p><h2 id="a-framework-is-worth-its-weight-when-it-names-the-contract">A Framework Is Worth Its Weight When It Names the Contract</h2><p>Write the contract before you pick the tool. The contract names the owner of each step and the tools each role can call. It also names the context the roles share, the memory the run writes, and the condition that counts as done.</p><p>With the contract on paper, the choice of framework stops being taste. Match the mechanism to the part of the work that needs it.</p><ul><li>Conversation fits the work where roles must negotiate a plan.</li><li>A state machine holds a workflow where correctness outranks flexibility.</li><li>Retrieval belongs wherever an answer must rest on evidence.</li><li>An evaluator turns a run into a score you can improve against.</li></ul><p>Adding a framework layer does not make state clearer by itself. More agents mean more confusion when nobody owns the facts, the tools, the errors, and the final decision.</p><h2 id="the-builder-test">The Builder Test</h2><p>Take a system you run now and draw its contract on one page.</p><ul><li>Name the owner of state, then check that a second engineer can find it without reading the transcript.</li><li>List the tools each role can call, and mark the ones whose actions are expensive to undo.</li><li>Name the evidence the run saves, and make sure each retrieved fact carries its source.</li><li>Write the stop condition, and make it stronger than the model announcing that it is done.</li><li>Name what sends the task to a human, and name the human.</li></ul><p>A field you cannot fill is a decision the framework already made for you. Read the framework code until you find where that decision lives.</p><h2 id="what-carries">What Carries</h2><p>A framework gives you places to define reliability: schemas, permissions, retries, evaluators, logs, and handoff rules. Filling them is your job.</p><p>The lazy choice picks whatever makes the first demo shortest. The bill arrives later, when hidden memory, implicit retries, and an unreadable trace make one production failure impossible to explain.</p><p>A contract inside one team is a design choice. A contract inside a company is a permission boundary.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Thu, 26 Mar 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>autogen</category><category>llamaindex</category><category>multi-agent</category><category>rag</category><category>frameworks</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-the-agent-loop-reason-act-remember</guid>
    <title>Tools Turn Guessing Into Looking</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-the-agent-loop-reason-act-remember</link>
    <description>ReAct alternates thinking with tool calls so the agent gathers what it cannot guess. The action space decides how much guessing is left.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>A model without tools must guess what it does not know. A model with tools can look, calculate, retrieve, run, and adapt. ReAct alternates the two in one loop: think, act, read the result, think again. The action space decides how much guessing is left.</p><p>The overview note drew the agent as five steps: observe, decide, act, examine, remember. The reasoning note bought the model room to think and left the check outside. Act is the step that reaches the check.</p><h2 id="an-agent-interacts-with-an-environment">An Agent Interacts With an Environment</h2><p>An agent acts inside an environment and reads what comes back. The environment is physical for a robot arm and digital for a browser or a terminal. It is human when the user holds context the agent has no way to fetch.</p><p>The human case carries state no tool exposes. A user who answers one question can end a search the agent cannot finish alone.</p><p>A language model agent uses text as the interface for all three. It reads observations in text, writes thoughts in text, emits actions in text, and receives the next observation in text. One channel carries the whole loop. A browser, a shell, and a person sit behind the same interface.</p><h2 id="react-alternates-reasoning-with-action">ReAct Alternates Reasoning With Action</h2><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>Each turn reads the state before it acts and writes the result back, so the next thought starts from evidence.</figcaption></figure><p>The reasoning step keeps the search purposeful. The action step gathers what the model does not hold. Alternating them means each plan gets revised against something that came back from outside.</p><div class="codeblock"><pre><code class="language-text">Thought: I need the current fact, not a memorized answer.
Action: search(query)
Observation: new evidence arrives
Thought: Now update the plan
Action: call_tool(args)
Observation: tool result
Final: answer with evidence</code></pre></div><p>The feedback does the work. A trace can read as coherent while the action it justifies is wrong. The observation is the only part of the turn the model did not write.</p><h2 id="memory-changes-what-the-loop-can-learn">Memory Changes What the Loop Can Learn</h2><p>A context window is short-term memory. It works inside one run and disappears with it. Long-term memory keeps lessons, facts, plans, failures, and skills outside the prompt, then returns them later.</p><p>Voyager stores the code skills its agent learned in Minecraft. Later runs start from earlier solutions. Generative agents let memory logs shape what the agent does next.</p><p>A chatbot is a student with a whiteboard wiped at the end of every class. An agent with memory is a student with a notebook. The notebook adds no intelligence by itself, and it changes what learning can mean.</p><div class="v-constraint"><div class="kicker">Memory test</div><div class="body">Memory earns its place only when retrieval is selective. A notebook that opens to the wrong page is one more distraction.</div></div><h2 id="the-action-space-decides-how-much-the-model-must-infer">The Action Space Decides How Much the Model Must Infer</h2><p>Tool use is more than handing the model an API. The action space fixes what the model sees, what it must infer, and what a bad move costs.</p><p>A web agent that clicks one page at a time drowns in tiny observations. An interface that summarizes candidates, exposes page structure, or searches directly leaves less to infer.</p><p>Grain is a recovery decision. Small actions keep every mistake cheap and every task long. One large action finishes sooner and takes more of the run down with it. Pick the grain by what an undo costs.</p><p>The model sets the floor for a task. The interface it acts through sets the ceiling.</p><h2 id="the-loop-needs-state">The Loop Needs State</h2><p>Memory is what survives the run. State is what survives the step. An agent without state improvises every turn from scratch.</p><p>It can answer well in a short exchange. Long tasks break, because nothing durable holds the goals, decisions, observations, tool results, and constraints.</p><p>State does not need to be fancy. A task list, a scratchpad, or a database row counts. So does browser state, a file diff, a memory record, or an event log. The next action comes from what happened, not from what the model half remembers.</p><p>Replay a failing run step by step. Read the observation, the prompt assembly, the action proposal, the permission check, and the tool result. Then read the state update, the retry, the stop, and the report. You must explain every transition from what the logs recorded.</p><p>Blaming the model is the brittle habit. The real defect is usually an absent transition rule or stale context. A weak stop condition or an unchecked tool result does the same.</p><div class="v-decision"><span class="kicker">Debugging order</span><div class="body">When an agent loops, forgets, or repeats work, read the state before you rewrite the prompt. A prompt rewrite can pass the next test and leave the broken transition in place.</div></div><h2 id="where-the-loop-breaks-today">Where the Loop Breaks Today</h2><p>Four weaknesses stay open, and none of them live in the prompt.</p><ul><li>Training: most base models never saw a long agent rollout.</li><li>Consistency: a real task needs the same result across many runs, and one lucky pass proves nothing.</li><li>Human collaboration: many tasks need a clarifying turn before autonomy.</li><li>Benchmarking: single-shot accuracy misses multi-turn failure modes.</li></ul><p>Pick the one that will bite your task first and instrument it before the next run.</p><h2 id="the-builder-test">The Builder Test</h2><p>Trace one task turn by turn. If you cannot say what the state holds after each action, the loop is not observable enough.</p><ul><li>Name the transition that created the bad state.</li><li>Separate the retry that is safe from the retry that repeats the error.</li><li>Say whether stop meant success or only the absence of a next action.</li></ul><p>A transition you cannot explain from evidence is where the next bad state will start.</p><h2 id="what-carries">What Carries</h2><p>The loop is the unit of reliability. An agent is a repeated interaction with an environment, and every turn writes what the next turn reads. The interface decides what that record can hold.</p><p>One loop with one owner is the simple case. Add a second agent and the first question is who owns the state.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Tue, 24 Mar 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>react</category><category>tool-use</category><category>memory</category><category>agent-loop</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-reasoning-is-a-scaffold-not-a-spell</guid>
    <title>Reasoning Is a Scaffold</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-reasoning-is-a-scaffold-not-a-spell</link>
    <description>Chain-of-thought buys the model room to work, and self-consistency votes across sampled paths. Only a check outside the model can fail a wrong answer.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>Chain-of-thought buys the model room to work. Only a check outside the model turns that room into a correct answer.</p><p>Before an agent touches a tool, it has to work through a hard task without drifting. That is the oldest problem in AI, and tool wiring does not skip it.</p><p>The map note draws the loop in five steps: observe, decide, act, examine, remember. Reasoning improves the decide step, and it leaves the other four alone.</p><h2 id="intermediate-steps-change-the-continuation">Intermediate Steps Change the Continuation</h2><p>A language model is trained to produce a plausible continuation. Truth is not the training target. Intermediate steps change what a plausible continuation has to contain. The model builds the answer across many tokens rather than one.</p><p>The steps are a scaffold. They give the model somewhere to allocate attention and hold partial results.</p><p>Last-letter concatenation shows the flip. Ask for the answer and the model treats the task as a pattern over names. Show the decomposition and the same model runs a sequence of tiny operations. The task goes from brittle to reliable.</p><div class="v-decision"><span class="kicker">Builder rule</span><div class="body">If a task hides its steps, expose them in the prompt. If it hides state, track the state.</div></div><h2 id="self-consistency-is-a-vote-over-paths">Self-Consistency Is a Vote Over Paths</h2><p>Sample many reasoning paths instead of one, then pull the final answer out of each. Let the answers vote and take the winner.</p><div class="uth-essay uth-figure-embed"><div><figure class="fig reveal" id="cs294f1">
  
  <div class="fig-head">
    <span class="fig-title">reasoning is a scaffold</span>
    <span class="ctrl">
      
      
      
    </span>
  </div>
  <div class="stage" id="cs294f1-stage" role="group" aria-live="polite" aria-describedby="cs294f1-caption">
    <div class="grid">
      <div class="card" data-card="direct">
        <div class="label">direct answer</div>
        <div class="steps">
          <div class="step show">problem in</div>
          <div class="step" data-direct>jump to final answer</div>
          <div class="step" data-direct>no place to inspect</div>
        </div>
      </div>
      <div class="card" data-card="scaffold">
        <div class="label">chain of thought</div>
        <div class="steps">
          <div class="step" data-scaffold>split the task</div>
          <div class="step" data-scaffold>track partial state</div>
          <div class="step" data-scaffold>combine carefully</div>
        </div>
      </div>
      <div class="card" data-card="vote">
        <div class="label">self-consistency</div>
        <div class="vote">
          <div class="bar" data-bar="0" data-v="A"></div>
          <div class="bar" data-bar="1" data-v="B"></div>
          <div class="bar win" data-bar="2" data-v="C"></div>
          <div class="bar" data-bar="3" data-v="D"></div>
        </div>
        <div class="out" data-out>One path can drift. Several paths expose the answer that keeps reappearing.</div>
      </div>
    </div>
  </div>
  <figcaption id="cs294f1-caption"><b>Chain-of-thought is workspace.</b> Self-consistency adds redundancy: sample multiple reasoning paths, then prefer the answer the independent paths keep returning to.</figcaption>
</figure></div><span hidden=""></span></div><p>A single path fails for local reasons. One early token that misleads drags the rest of the solution with it. Many samples give you several attempts at the same latent process, and agreement across them raises confidence.</p><p>Ten kids run a maze and seven come out the same door. That door is probably the exit. The vote carries no guarantee, and it still beats the first kid who ran.</p><h2 id="analogical-prompting-asks-the-model-to-build-its-own-examples">Analogical Prompting Asks the Model to Build Its Own Examples</h2><p>Analogical prompting hands the example writing to the model. Ask it to recall or invent related problems, solve those first, then carry the shape to the real one.</p><p>Hand-written examples cost you time, and each one covers a single shape. A tutor picks one close cousin, names the shape, and lets the student carry it to the rest.</p><h2 id="correction-needs-a-signal-from-outside-the-model">Correction Needs a Signal From Outside the Model</h2><p>Self-correction is no safety net. Ask a model to review its own answer and it can repair a wrong one. It can also break a right one. An instruction to check your work does not create ground truth.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>The trace reaches the checkpoint on its own, and a signal from outside the model opens it.</figcaption></figure><div class="v-decision"><span class="kicker">Reflection and verification</span><div class="body">Reflection is a model reviewing itself. Verification is a check against evidence from outside the model. Only verification can fail an answer.</div></div><p>A trace creates intermediate state, and that state is not automatically correct. A fluent chain can drift or carry a wrong early assumption all the way to the answer. The signals that catch it are cheap and specific.</p><ul><li>Unit tests for code</li><li>A calculator for arithmetic</li><li>A symbolic solver for constraints and a verifier for proofs</li><li>Retrieval for facts</li><li>Environment feedback for plans</li><li>A human for judgment</li></ul><p>When a reasoning step can change an action, you must be able to examine that step.</p><p>Later notes build these signals into the loop. The software note uses tests, and the neural-symbolic note uses a solver. The scaling-policy note carries the same distinction to the release gate.</p><h2 id="agents-multiply-reasoning-mistakes">Agents Multiply Reasoning Mistakes</h2><p>A wrong answer is one bad output. A wrong plan calls tools, writes files, spends money, emails people, and pushes a bad decision downstream.</p><p>The fix is a bound on what a wrong chain can touch. Four moves put that bound in place.</p><ul><li>Trace the run so each step is visible</li><li>Sample so that no single path gets your trust</li><li>Run the verifier before the action</li><li>Stop the run when the verifier fails</li></ul><p>An agent that keeps going past a failed check does not have a check.</p><h2 id="the-builder-test">The Builder Test</h2><p>Take one task your agent gets wrong today. Add the cheapest check that lives outside the model, a test or a calculator. Run the same set of tasks both ways and count what the check caught.</p><p>Compare five shapes on the same tasks: short, decomposed, tool-verified, search-guided, and one with the scratch work hidden. Score every shape on the rate of errors that matter.</p><p>Read each intermediate step on its own. A step you cannot examine alone is a step you are trusting. If you cannot say what changed after each step, the run is not observable enough to test.</p><p>Check that your decomposition matches the real structure of the task. If a verifier catches more of those errors than a longer answer, ship the verifier.</p><h2 id="what-carries">What Carries</h2><p>A reasoning trace earns its cost when it improves a decision or exposes something you can examine. Length proves nothing on its own. A long explanation can hide anchoring, circular justification, and an early mistake the chain preserves.</p><p>A verifier lives outside the model, so the agent needs a way to reach it. That is the act step.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Sun, 22 Mar 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>reasoning</category><category>chain-of-thought</category><category>self-consistency</category><category>prompting</category>
  </item>

  <item>
    <guid isPermaLink="true">https://rajdeepmondal.com/writing/agent-systems-agent-systems-map</guid>
    <title>The Loop Is the Product</title>
    <link>https://rajdeepmondal.com/writing/agent-systems-agent-systems-map</link>
    <description>An agent is a language model inside a loop, and the loop is the part a team builds, measures, and stops. The model call is one node in it.</description>
    <content:encoded><![CDATA[<div class="essay-prose"><p>An agent is a language model inside a loop, and the loop is the part a team builds. The model call is one node in it. What the loop sees, what it can touch, and what it saves are engineering decisions. So is the rule that stops it.</p><p>You meet an agent as a product surface first. A chat box gets a tool, the demo runs, and the room calls the result magic.</p><p>The course treats the agent as a system. The model sits in a loop, wired to tools and placed in an environment. Tasks measure it, and safety constrains it.</p><h2 id="the-model-is-one-call-inside-a-process">The Model Is One Call Inside a Process</h2><p>The loop has five steps: observe, decide, act, examine, remember. The model call sits at decide. Tools make act possible, the environment supplies observe, and storage gives remember something to hold.</p><figure class="rm-article-image"><div class="relative overflow-hidden"><div class="bg-muted absolute inset-0 z-10 animate-pulse rounded-[inherit]"><div class="animate-shimmer via-paper-bright/70 absolute inset-0 bg-linear-to-r from-transparent to-transparent"></div></div></div><figcaption>Each of the five steps has an owner in code, and the model call owns one of them.</figcaption></figure><p>The process decides what the model sees, what it can touch, and how it recovers. It also decides how anyone knows the run worked. Draw the boundary around all of that and you have an agent. The model call alone is a text generator with good manners.</p><p>A complete agent has parts you can point at: loop state, tool contracts, memory, permissions, observability, evaluation, escalation, and rollback. Leave one out and the system still demos well. It fails on the first run where the missing part is the one that mattered.</p><h2 id="reliability-is-the-standard">Reliability Is the Standard</h2><p>Reliability is the standard, and it is a harder bar than a good answer. Reasoning counts when it survives a distraction. Tools count when the interface is shaped well enough that the model does not have to guess. Memory counts when retrieval returns the right record at the right moment. A second agent helps when coordination beats confusion.</p><p>The standard is what still matters when you build with it next week. Four checks make it concrete.</p><ul><li>Name the state that persists between actions.</li><li>List the actions that can change the outside world.</li><li>Point at the evidence that ends the task.</li><li>Show how a human takes control back.</li></ul><p>Run the four before you widen what the agent can touch.</p><h2 id="the-course-moves-from-the-inside-out">The Course Moves From the Inside Out</h2><p>The twelve notes move from the inside out, and each one repairs a joint of the loop.</p><ul><li>Notes 1 and 2 build the decide and act steps. Reasoning traces make the decision less brittle. ReAct and tools ground the action, and memory makes the next observation less blind.</li><li>Notes 3 through 7 make the loop inspectable: multi-agent frameworks, enterprise grounding, DSPy, coding agents, and workflow agents. They settle who owns state, what counts as evidence, and how a run gets measured.</li><li>Notes 8 and 9 take the work language cannot hold: symbolic planners, solvers, simulation, robotics, and embodied control. Exact constraints move into the decide step, and the act step moves into a physical world.</li><li>Notes 10 through 12 decide where the loop stops. Open science, measurement, responsible scaling, privacy, and trustworthy deployment draw that line.</li></ul><p>Each group assumes the loop underneath it already exists.</p><h2 id="a-demo-works-because-a-human-filled-the-gaps">A Demo Works Because a Human Filled the Gaps</h2><p>A demo works once because a person fills the gaps by hand. You supply the state the loop never stored and clean the tool output before the model reads it. When the recovery path leads nowhere, you step past it.</p><p>None of that work is in the system. The next run happens without you in the room, and that run is the measurement.</p><p>Autonomy pays when the agent can see state, act safely, measure progress, keep evidence, and stop before mistakes compound. Without those five, more autonomy moves a bad decision further before anyone catches it.</p><h2 id="ask-which-part-of-the-loop-failed">Ask Which Part of the Loop Failed</h2><p>When an agent fails, name the step that broke before you touch the prompt. Observe, decide, act, examine, remember, and the permission boundary are the candidates. A prompt edit moves the decide step and leaves the other five where they were.</p><p>Read the transcript and you see one run. Read the machinery and you see every run after it. Then check whether that machinery holds under noisy inputs, stale state, weak tools, and partial failure.</p><p>Fix the named step, run the task again, and check the same six candidates.</p><h2 id="the-builder-test">The Builder Test</h2><p>Take one task your agent runs today and trace it through the loop. Point at the observation it started from and the action it took. Find the result, the memory it wrote, and the measurement that says the task is done. Name the boundary that held it inside its permissions. A step you cannot point at is the defect, and it is the next thing to build.</p><h2 id="what-carries">What Carries</h2><p>Agent quality is state, tools, evidence, measurement, and control working together. Model quality is one input to that. The other five are yours to build.</p><p>A loop that cannot think through one hard task will not survive twelve. So the decide step comes first.</p><div class="rm-essay-close" aria-hidden="true"><svg width="76" height="32" viewBox="0 0 76 32" aria-hidden="true" class="rm-fmark-essay"><path d="M 2 14 Q 18 2 36 14 T 74 12" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" opacity="0.5"></path><line x1="2" y1="24" x2="60" y2="24" stroke="currentColor" stroke-width="1.1"></line><circle cx="68" cy="24" r="2.8" fill="var(--vermilion)"></circle></svg></div></div>]]></content:encoded>
    <pubDate>Fri, 20 Mar 2026 12:00:00 GMT</pubDate>
    <author>rajdeep@rajdeepmondal.com (Rajdeep Mondal)</author>
    <category>ai</category><category>agents</category><category>llm-agents</category><category>technical-notes</category><category>reasoning</category><category>planning</category><category>tool-use</category>
  </item>

    </channel>
  </rss>