<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Luhui Dev</title>
    <description>The latest articles on DEV Community by Luhui Dev (@luhuidev).</description>
    <link>https://dev.to/luhuidev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3812586%2Fae3fdf39-429c-4db4-8f7a-71835412451a.jpeg</url>
      <title>DEV Community: Luhui Dev</title>
      <link>https://dev.to/luhuidev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luhuidev"/>
    <language>en</language>
    <item>
      <title>What Is Loopcraft? From Prompt Engineering to Agent Loop System Design</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Fri, 26 Jun 2026 10:53:45 +0000</pubDate>
      <link>https://dev.to/luhuidev/what-is-loopcraft-from-prompt-engineering-to-agent-loop-system-design-2dff</link>
      <guid>https://dev.to/luhuidev/what-is-loopcraft-from-prompt-engineering-to-agent-loop-system-design-2dff</guid>
      <description>&lt;p&gt;🙋‍&lt;br&gt;
&lt;em&gt;I’m &lt;a href="https://luhuidev.com/" rel="noopener noreferrer"&gt;Luhui Dev&lt;/a&gt;, a developer who has been breaking down Agent engineering and exploring how AI can be applied in education.&lt;br&gt;
I focus on Agent Harness, LLM application engineering, AI for Math, and the productization of education SaaS.&lt;/em&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;A new term has been circulating in the Silicon Valley agent world: &lt;strong&gt;Loopcraft&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;My first reaction was: isn't this just putting an agent inside &lt;code&gt;while true&lt;/code&gt;? A few years ago people called it Agent Loop. Then it became Workflow and Harness Engineering. Now we have Loopcraft. The AI industry never stops inventing new names.&lt;/p&gt;

&lt;p&gt;But after following recent discussions from Peter Steinberger, Claude Code lead Boris Cherny, and Andrej Karpathy around agent loops, I do think something real is changing.&lt;/p&gt;

&lt;p&gt;Peter Steinberger put it this way:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You shouldn’t be prompting coding agents anymore. You should be designing loops that prompt your agents.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In other words, you should not manually prompt a coding agent again and again. You should design a loop that prompts the agent for you.&lt;/p&gt;

&lt;p&gt;Boris Cherny said something similar:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I don’t prompt Claude anymore. I write loops. The loops do the work.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Karpathy made a related point when introducing Autoresearch: &lt;strong&gt;if a human still has to inspect every result, decide the next step, and give the agent another instruction, the human becomes the throughput bottleneck of the whole system.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Put together, these comments point to an abstraction shift:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before:
Human -&amp;gt; Prompt -&amp;gt; Agent -&amp;gt; Result

Now:
Human -&amp;gt; Design the loop
             ↓
Task discovery -&amp;gt; Agent execution -&amp;gt; Automatic verification -&amp;gt; Retry on failure -&amp;gt; Save state -&amp;gt; Continue running
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My shortest definition is: &lt;strong&gt;Prompt Engineering optimizes a single interaction. Loopcraft optimizes the whole system that runs repeatedly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Loopcraft is less interested in how to complete one isolated task and more interested in questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who starts the next task?&lt;/li&gt;
&lt;li&gt;How does the agent know what to do?&lt;/li&gt;
&lt;li&gt;Who checks the output?&lt;/li&gt;
&lt;li&gt;How does failure produce useful feedback?&lt;/li&gt;
&lt;li&gt;Should the system retry, switch strategy, or hand off to a human?&lt;/li&gt;
&lt;li&gt;How is state preserved across sessions?&lt;/li&gt;
&lt;li&gt;How do lessons from repeated runs improve the system itself?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This article breaks down three questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is Loopcraft, and why is it suddenly getting attention?&lt;/li&gt;
&lt;li&gt;How is it different from Agent Harness?&lt;/li&gt;
&lt;li&gt;Can an ordinary developer build a small loop today?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Why People Are Moving From Prompts to Loops
&lt;/h2&gt;

&lt;p&gt;For the past two years, the typical way to use a coding agent looked roughly like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Tell the agent what to do
-&amp;gt; Wait for code changes
-&amp;gt; Review the result
-&amp;gt; Tell it what is wrong
-&amp;gt; Let the agent continue
-&amp;gt; Review again
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model can already write code, search files, and run tests. But the whole process is still driven step by step by a human.&lt;/p&gt;

&lt;p&gt;After each round, the agent stops and waits for the next instruction.&lt;/p&gt;

&lt;p&gt;On the surface, the human is using the agent. From another angle, the human is acting as the scheduler, state machine, and verifier of the agent system.&lt;/p&gt;

&lt;p&gt;So even if the model is fast, the human still cannot leave. The async mobile supervision features shipped by many agent products are one attempt to relieve this bottleneck.&lt;/p&gt;

&lt;p&gt;That is the problem behind the recent loop discourse: &lt;strong&gt;do not automate only one step inside the work. Design the surrounding system for task discovery, assignment, verification, and continuation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example, fixing a CI failure used to look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I see a CI failure -&amp;gt; Open Codex -&amp;gt; Copy the error log -&amp;gt; Ask it to analyze -&amp;gt; Review the diff -&amp;gt; Ask it to run tests -&amp;gt; Confirm green -&amp;gt; Manually create a PR
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside a loop, it can become:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CI failure event -&amp;gt; Automatically read logs -&amp;gt; Decide whether the problem is safe to automate -&amp;gt; Start an agent in an isolated worktree -&amp;gt; Modify code -&amp;gt; Run tests and lint -&amp;gt; A second verifier checks the diff -&amp;gt; Create a PR when it passes -&amp;gt; Notify a human when it cannot proceed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The real automation here is not just code editing. It is the closed loop around code editing.&lt;/p&gt;

&lt;p&gt;So Loopcraft is not a new model capability, and it is not one specific framework.&lt;/p&gt;

&lt;p&gt;It is closer to an agent system design discipline: &lt;strong&gt;organizing task execution, result verification, event triggers, state persistence, and system improvement into nested loops.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Is Loopcraft Actually New?
&lt;/h2&gt;

&lt;p&gt;The name is new. The underlying technical pieces are not.&lt;/p&gt;

&lt;p&gt;We already had:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reason-Act-Observe loops for agents;&lt;/li&gt;
&lt;li&gt;workflows and state machines;&lt;/li&gt;
&lt;li&gt;automated tests and CI/CD;&lt;/li&gt;
&lt;li&gt;scheduled jobs and event-driven systems;&lt;/li&gt;
&lt;li&gt;multi-agent collaboration;&lt;/li&gt;
&lt;li&gt;LLM-as-a-judge;&lt;/li&gt;
&lt;li&gt;Reflexion and Self-Refine;&lt;/li&gt;
&lt;li&gt;long-term memory;&lt;/li&gt;
&lt;li&gt;automated experimentation and hill climbing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even the simplest Ralph Loop is basically repeated invocation of a coding agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;claude &lt;span class="s2"&gt;"Read the task and current progress, then continue the work"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Agent Harness vs. Loopcraft
&lt;/h2&gt;

&lt;p&gt;This is where the terms are easiest to confuse.&lt;/p&gt;

&lt;p&gt;Over the past year, Agent Harness has already become a popular concept.&lt;/p&gt;

&lt;p&gt;Anthropic's definition is clear: a harness is the system that enables a model to work as an agent, including context handling, tool use, permissions, environment, state management, and result return.&lt;/p&gt;

&lt;p&gt;Put simply, Harness answers: &lt;strong&gt;what environment does this agent work in?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Loopcraft answers a different question: &lt;strong&gt;when is this agent started, why does it continue running, who checks the result, and what should happen in the next round?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A simplified analogy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Model: the worker's brain
Tools: the tools in the worker's hands
Harness: the worker's workstation and work environment
Loop: the factory cadence, quality control, and task scheduling
Loopcraft: how to design and layer the whole production loop system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In practice, the boundary is not absolute.&lt;/p&gt;

&lt;p&gt;A mature long-running harness already includes retries, verification, and state handoff. A loop also depends on the harness for tools and execution environment.&lt;/p&gt;

&lt;p&gt;I prefer to separate them by focus:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Concept&lt;/th&gt;
&lt;th&gt;Main question&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Prompt Engineering&lt;/td&gt;
&lt;td&gt;What instruction should the model see in this round?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context Engineering&lt;/td&gt;
&lt;td&gt;What information should the model see right now?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tool Engineering&lt;/td&gt;
&lt;td&gt;What actions can the agent take?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Harness Engineering&lt;/td&gt;
&lt;td&gt;How can one agent run happen reliably?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Loopcraft&lt;/td&gt;
&lt;td&gt;How are repeated runs triggered, verified, connected, and improved?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Loopcraft does not replace Harness.&lt;/p&gt;

&lt;p&gt;In fact, &lt;strong&gt;without a stable harness, a loop just manufactures errors automatically and continuously.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Loopcraft Is Not One Loop, but Layers of Loops
&lt;/h2&gt;

&lt;p&gt;LangChain later broke Loopcraft into four practical layers. I find the breakdown useful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 1: Agent Loop
&lt;/h3&gt;

&lt;p&gt;The innermost layer is the agent loop we already know:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The model reasons
-&amp;gt; Calls a tool
-&amp;gt; Reads the tool result
-&amp;gt; Continues reasoning
-&amp;gt; Stops when it believes the task is done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, a documentation agent can:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Read an issue -&amp;gt; Search the repository -&amp;gt; Edit Markdown -&amp;gt; Check links -&amp;gt; Create a PR
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Layer 2: Verification Loop
&lt;/h3&gt;

&lt;p&gt;An agent saying "done" does not mean the task is actually done. So we wrap the agent in a verification layer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent executes
-&amp;gt; Verifier checks
-&amp;gt; If it fails, return concrete feedback
-&amp;gt; Agent executes again
-&amp;gt; Repeat until it passes or the budget is exhausted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The verifier can be unit tests, type checks, lint, schema validation, and so on.&lt;/p&gt;

&lt;p&gt;One important principle: &lt;strong&gt;try not to let the same entity that writes the answer also grade its own exam.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 3: Event-driven Loop
&lt;/h3&gt;

&lt;p&gt;Once execution and verification are in place, the next step is removing manual startup.&lt;/p&gt;

&lt;p&gt;Tasks can be triggered by real events. The agent is no longer just a chat tool; it becomes a background component in a business system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Event
-&amp;gt; Deterministic rule decides whether to handle it
-&amp;gt; Start agent
-&amp;gt; Verify result
-&amp;gt; Update the real system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Layer 4: Hill-climbing Loop
&lt;/h3&gt;

&lt;p&gt;The first three layers automate work.&lt;/p&gt;

&lt;p&gt;The fourth layer starts automating how the work gets better.&lt;/p&gt;

&lt;p&gt;Every agent run leaves a trace:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what task it received;&lt;/li&gt;
&lt;li&gt;what tools it called;&lt;/li&gt;
&lt;li&gt;where it failed;&lt;/li&gt;
&lt;li&gt;why the verifier rejected it;&lt;/li&gt;
&lt;li&gt;how many tokens it used;&lt;/li&gt;
&lt;li&gt;whether a human had to take over.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An outer system can periodically analyze these traces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Collect many run records
-&amp;gt; Identify frequent failure modes
-&amp;gt; Adjust prompts, tools, skills, or verifiers
-&amp;gt; Re-test on an eval set
-&amp;gt; Update the harness after passing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the layer where Loopcraft becomes most valuable.&lt;/p&gt;

&lt;p&gt;An ordinary loop repeats work. A hill-climbing loop changes the system that produces the work.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ordinary loop:
Failure -&amp;gt; Try again

Improvement loop:
Failure -&amp;gt; Analyze why it failed
        -&amp;gt; Modify prompts, tools, or verification rules
        -&amp;gt; Make future runs more reliable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The outer loop's arrow does not just go back to the beginning of the task. It reaches into the agent and changes the inner loop.&lt;/p&gt;

&lt;p&gt;That is where compounding starts.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Karpathy's Autoresearch Is the Cleanest Loopcraft Example So Far
&lt;/h2&gt;

&lt;p&gt;Karpathy's Autoresearch is a good concrete example for understanding Loopcraft.&lt;/p&gt;

&lt;p&gt;The project is conceptually simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent proposes a training improvement
-&amp;gt; Modify train.py
-&amp;gt; Run training for a fixed five minutes
-&amp;gt; Read the val_bpb metric
-&amp;gt; Keep the change if the metric improves
-&amp;gt; Roll back if the metric worsens
-&amp;gt; Start the next experiment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It can run about 12 experiments per hour without human intervention. Overnight, it can complete close to 100 experiments.&lt;/p&gt;

&lt;p&gt;The clever part is not a fancy agent prompt. It is that Karpathy reshaped the problem into an environment that is ideal for loop optimization:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the agent can modify only one file;&lt;/li&gt;
&lt;li&gt;the evaluation metric is fixed;&lt;/li&gt;
&lt;li&gt;each experiment has a fixed runtime;&lt;/li&gt;
&lt;li&gt;results can be compared automatically;&lt;/li&gt;
&lt;li&gt;failed changes can be rolled back;&lt;/li&gt;
&lt;li&gt;Git records the full experiment history;&lt;/li&gt;
&lt;li&gt;verification code cannot be modified by the agent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the core shift of Loopcraft: &lt;strong&gt;humans move from directly doing the task to designing a system that can repeatedly do, verify, and improve the task.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. How to Build a Minimal Loop Yourself
&lt;/h2&gt;

&lt;p&gt;Autoresearch is a special environment. Ordinary developers can start with something simpler:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Automatically receive a small issue, attempt a fix, create a PR after tests pass, and retry with feedback when it fails.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Do not start with multi-agent orchestration. A minimal loop needs only six parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Trigger&lt;/strong&gt;: what event starts the task, such as a CI failure, scheduled job, or issue with a specific label.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Goal&lt;/strong&gt;: what counts as done, preferably something that can be turned into tests, lint, type checks, or another machine-verifiable condition.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State&lt;/strong&gt;: store attempt count, failure reason, and current progress in a file or database instead of relying only on chat context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Worker&lt;/strong&gt;: run the coding agent in an isolated worktree or container so it does not pollute the main branch or other tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verifier&lt;/strong&gt;: prefer tests, rules, and static checks. Use an LLM reviewer only for parts that are hard to formalize.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budget&lt;/strong&gt;: limit attempts, runtime, and cost. Hand off to a human for high-risk operations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The whole flow can be simplified to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;attempt&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;run_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;goal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;load_state&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;verdict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;verify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;save_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;verdict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;verdict&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;passed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;create_pull_request&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;verdict&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;retryable&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;notify_human&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whether you use Claude Code, Codex, GitHub Actions, Bash, or Python is not the important part.&lt;/p&gt;

&lt;p&gt;What matters is designing this chain clearly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Trigger -&amp;gt; Execute -&amp;gt; Verify -&amp;gt; Feedback -&amp;gt; Retry or exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As long as a task has a clear goal, reliable feedback, recoverable state, and a stopping condition, you already have a minimal loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Common Loopcraft Traps
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Trap 1: Treating Infinite Retry as Autonomy
&lt;/h3&gt;

&lt;p&gt;Running repeatedly is not the same as improving.&lt;/p&gt;

&lt;p&gt;If the agent receives no new feedback, repeating ten times usually means spending ten times the tokens to make similar mistakes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trap 2: Letting the Agent Change Its Own Exam
&lt;/h3&gt;

&lt;p&gt;The execution agent should not freely modify tests, evaluation metrics, time budgets, permission boundaries, or verifier prompts.&lt;/p&gt;

&lt;p&gt;Otherwise it may not be making the task better. It may only be making "pass" easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trap 3: Starting With Multiple Agents
&lt;/h3&gt;

&lt;p&gt;Multiple agents do not automatically create intelligence. They first create more token cost, file conflicts, duplicate work, and state synchronization problems.&lt;/p&gt;

&lt;p&gt;Get one worker, one verifier, and one persistent state path working before adding parallelism.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trap 4: Measuring How Busy the Agent Is
&lt;/h3&gt;

&lt;p&gt;Number of agents, runtime, token usage, and tool-call count are not the final value.&lt;/p&gt;

&lt;p&gt;What matters is &lt;strong&gt;verified progress per unit cost&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Examples include issue auto-resolution rate, average cost per qualified PR, and human handoff ratio.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trap 5: The Smoother the Loop, the Easier It Is to Stop Understanding
&lt;/h3&gt;

&lt;p&gt;This is the risk I care about most.&lt;/p&gt;

&lt;p&gt;When an agent can automatically write code, test it, fix it, and create a PR, humans may be tempted to look only at the final green check.&lt;/p&gt;

&lt;p&gt;But the faster the system produces code, the faster human understanding of that system can decline.&lt;/p&gt;

&lt;p&gt;Loopcraft should not become an excuse to stop thinking. It actually raises the bar for how much the human has to understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;I increasingly feel that agent engineering is going through an abstraction shift.&lt;/p&gt;

&lt;p&gt;At first we discussed prompts. Then we moved to context, tools, memory, and harnesses.&lt;/p&gt;

&lt;p&gt;Now the focus is moving outward again: how to put a single agent run inside a larger cycle of tasks, verification, and improvement.&lt;/p&gt;

&lt;p&gt;I remain skeptical of fully removing humans from the loop.&lt;/p&gt;

&lt;p&gt;But I agree with one thing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do not only fix the current result produced by the agent. Start fixing the system that keeps producing those results.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Field Notes: How Agentic RAG Handles the Real Mess of Enterprise Data</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Fri, 19 Jun 2026 15:24:18 +0000</pubDate>
      <link>https://dev.to/luhuidev/field-notes-how-agentic-rag-handles-the-real-mess-of-enterprise-data-a68</link>
      <guid>https://dev.to/luhuidev/field-notes-how-agentic-rag-handles-the-real-mess-of-enterprise-data-a68</guid>
      <description>&lt;p&gt;🙋‍&lt;br&gt;
&lt;em&gt;I’m &lt;a href="https://luhuidev.com/" rel="noopener noreferrer"&gt;Luhui Dev&lt;/a&gt;, a developer who has been breaking down Agent engineering and exploring how AI can be applied in education.&lt;br&gt;
I focus on Agent Harness, LLM application engineering, AI for Math, and the productization of education SaaS.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  A Support Ticket That Opens a Data Maze
&lt;/h2&gt;

&lt;p&gt;Say your company just launched an AI customer-support system.&lt;/p&gt;

&lt;p&gt;A major account sends in a ticket: &lt;em&gt;"What's the remaining warranty period on the servers we purchased under Project Alpha last quarter? Could you also share the original contract terms and the current technical support contact?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It sounds like an ordinary question. But when your tech lead reads the ticket, they pause for a moment.&lt;/p&gt;

&lt;p&gt;Because they know answering it requires the system to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Look up the customer's profile and project history in the &lt;strong&gt;CRM&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Look up the procurement contract and warranty terms for Project Alpha in the &lt;strong&gt;ERP / contract management system&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Look up the stock-in date and device serial numbers for that batch of servers in the &lt;strong&gt;asset management system&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Look up the current customer-success owner in the &lt;strong&gt;HR system&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These four systems are maintained by different teams, run on different databases, and enforce different access controls.&lt;/p&gt;

&lt;p&gt;A standard RAG system is helpless here. The best it can do is say, "Sorry, I couldn't find relevant information."&lt;/p&gt;

&lt;p&gt;This is exactly the problem &lt;strong&gt;Agentic RAG&lt;/strong&gt; is built to solve.&lt;/p&gt;


&lt;h2&gt;
  
  
  Traditional RAG: A One-Shot Retrieval Clerk
&lt;/h2&gt;

&lt;p&gt;Let's quickly recap how RAG works.&lt;/p&gt;

&lt;p&gt;The core idea behind &lt;strong&gt;RAG (Retrieval-Augmented Generation)&lt;/strong&gt; is simple: an LLM's training knowledge is static, while enterprise data is dynamic and private. The fix is to retrieve relevant document chunks from a database before generating an answer, stuff them into the context, and have the LLM answer based on that material.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User question → [vector search] → retrieve relevant chunks → [LLM] → generate answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pipeline works well when there's a single knowledge base and a clear question. But it has two fundamental limits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limit one: a single retrieval pass, no iteration.&lt;/strong&gt; Retrieve once, hand it to the LLM once, done. If the first pass misses the key information, the whole chain breaks, and the LLM is left guessing or saying "I don't know."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limit two: a single corpus, no routing.&lt;/strong&gt; Traditional RAG assumes all knowledge lives in one unified vector database. In a real enterprise, data is scattered across CRM, ERP, Confluence, data warehouses, private document stores -- each with its own access point and permission boundary.&lt;/p&gt;

&lt;p&gt;Here's an analogy: traditional RAG is a librarian who can only find books on the first floor, while the book you need might be sitting on the fourth floor, behind a different access pass.&lt;/p&gt;



&lt;h2&gt;
  
  
  Agentic RAG: A Retrieval Department That Thinks
&lt;/h2&gt;

&lt;p&gt;The core shift in Agentic RAG is this: &lt;strong&gt;turn a single retrieval pass into a planned, iterative retrieval process.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's no longer a passive query-and-return pipeline. It's a workflow run by multiple specialized agents, each with a distinct responsibility.&lt;/p&gt;

&lt;p&gt;Let's use the support-ticket example to walk through how the whole workflow operates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwhhs5e0fd7qu43cw732l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwhhs5e0fd7qu43cw732l.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  Step 1: The Orchestrator Decomposes the Task
&lt;/h3&gt;

&lt;p&gt;The user's question first reaches the &lt;strong&gt;Orchestrator&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The orchestrator doesn't retrieve anything directly. It first understands the structure of the question: how many independent information needs are involved? Are there dependencies between them? Which data sources need to be accessed?&lt;/p&gt;

&lt;p&gt;For our ticket, the orchestrator breaks it down into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Subtask A&lt;/strong&gt;: Look up the customer's "Project Alpha" basics (customer ID, project number) in the CRM&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subtask B&lt;/strong&gt;: Use the project number to look up warranty terms in the contract system&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subtask C&lt;/strong&gt;: Use the project number to look up device serial numbers and stock-in dates in the asset management system&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subtask D&lt;/strong&gt;: Look up the current technical support owner in the HR system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note that Subtasks B and C depend on the result of Subtask A (they need the project number first). Subtask D can run in parallel.&lt;/p&gt;

&lt;p&gt;This dependency graph is the execution plan produced by the &lt;strong&gt;Planner Agent&lt;/strong&gt;.&lt;/p&gt;



&lt;h3&gt;
  
  
  Step 2: Query Rewriting for Each Data Source
&lt;/h3&gt;

&lt;p&gt;Every data source expects queries in a different form. The CRM might need keyword search, the contract system might need structured SQL, and the vector database needs semantic search.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Query Rewriter&lt;/strong&gt; translates each natural-language subtask into a query format the target source can understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For the CRM vector store: &lt;code&gt;"Alpha project procurement record {customer name}"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;For the contract system: &lt;code&gt;SELECT warranty_terms FROM contracts WHERE project_id = 'Alpha-XXX'&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;For asset management: &lt;code&gt;"Alpha project server stock-in date serial number"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;



&lt;h3&gt;
  
  
  Step 3: Parallel Retrieval Across Permission Boundaries
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Search Fanout Agent&lt;/strong&gt; queries multiple data sources at once.&lt;/p&gt;

&lt;p&gt;There's a key engineering problem here: &lt;strong&gt;permissions&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Different data sources have different access controls. CRM data might be open to the sales team, HR data might only be accessible to admins, and contract data might require legal sign-off. An Agentic RAG framework needs to maintain a "credential pool" at this layer -- different access tokens for different data sources -- and make sure retrieval never exceeds the current user's actual authorization scope.&lt;/p&gt;

&lt;p&gt;This isn't just a technical problem; it's a compliance one too: &lt;strong&gt;AI shouldn't be able to bypass data access controls you were never supposed to have just because you phrased a request in natural language.&lt;/strong&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  Step 4: Sufficiency Checking -- the Most Important Innovation
&lt;/h3&gt;

&lt;p&gt;Once all retrieval results come back, they're passed to the &lt;strong&gt;Sufficient Context Agent&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is the design that most distinguishes Agentic RAG from traditional RAG: &lt;strong&gt;the system actively judges whether the information gathered so far is enough to answer the original question, and if not, it spells out exactly what's missing before retrieving again.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In our ticket example, the checker might find:&lt;/p&gt;

&lt;p&gt;✅ Found: customer profile, project number, device serial numbers&lt;br&gt;
✅ Found: technical support owner&lt;br&gt;
❌ &lt;strong&gt;Missing&lt;/strong&gt;: the contract system returned a document, but the warranty terms are in an attached PDF that the vector search didn't hit&lt;/p&gt;

&lt;p&gt;Instead of just saying "not enough information," the checker outputs a precise description of the gap:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Project number Alpha-2024-087, device serial numbers SN-XXX-YYY-ZZZ, and stock-in date March 2024 have been retrieved. The main contract file has been found, but the warranty terms are in Contract Attachment B. Re-search the contract attachment store specifically for 'Attachment B warranty period.'"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That feedback drives a &lt;strong&gt;second retrieval round&lt;/strong&gt;: the rewriter generates a more precise query targeted at the contract attachment.&lt;/p&gt;

&lt;p&gt;This "retrieve → evaluate → retrieve again" loop continues until the sufficiency checker determines the information is complete, or the maximum iteration limit is reached.&lt;/p&gt;



&lt;h3&gt;
  
  
  Step 5: Synthesis Produces the Final Answer
&lt;/h3&gt;

&lt;p&gt;Once everything is in place, the &lt;strong&gt;Synthesis Agent&lt;/strong&gt; combines fragments from four different systems into one coherent, accurate, and source-attributed answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The three servers purchased under Project Alpha (project number Alpha-2024-087, serial numbers SN-XXX-001 through 003) carry a 36-month warranty from their stock-in date (March 15, 2024), per Section 4.2 of Contract Attachment B, expiring March 14, 2027. The current technical support owner is Li Ming (extension 4521, &lt;a href="mailto:liming@company.com"&gt;liming@company.com&lt;/a&gt;)."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every sentence has a traceable source.&lt;/p&gt;



&lt;h2&gt;
  
  
  Cross-System Permissions: Harder Than the Technology
&lt;/h2&gt;

&lt;p&gt;The handling of &lt;strong&gt;permission boundaries&lt;/strong&gt; deserves its own discussion.&lt;/p&gt;

&lt;p&gt;In a real enterprise, data permissions are a multi-dimensional problem:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Role-based access&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Different roles see different data&lt;/td&gt;
&lt;td&gt;Sales can see a contract summary but not the full text&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data classification&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A single database can hold multiple sensitivity levels&lt;/td&gt;
&lt;td&gt;Employee salary vs. employee directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Time-based access&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Some data has time-limited access rules&lt;/td&gt;
&lt;td&gt;Financial data is read-only during an audit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cross-system access&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data from System A must not surface in System B's context&lt;/td&gt;
&lt;td&gt;GDPR requires data to stay within its jurisdiction&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;An Agentic RAG framework needs to enforce these rules on &lt;strong&gt;every single retrieval call&lt;/strong&gt;, not just authorize access once at indexing time.&lt;/p&gt;

&lt;p&gt;That means the architecture needs &lt;strong&gt;permission checks at query time&lt;/strong&gt;, rather than the blunt approach of vectorizing everything into one big store.&lt;/p&gt;

&lt;p&gt;In database terms: traditional RAG is like joining every table into one giant table and handing it to the LLM. Agentic RAG is like generating a permission-filtered SQL query dynamically for every request.&lt;/p&gt;



&lt;h2&gt;
  
  
  Three Decisions You Can't Avoid in Practice
&lt;/h2&gt;

&lt;p&gt;When you actually build Agentic RAG in production, three decisions come up every time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decision one: routing strategy -- static rules or LLM routing?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Static routing&lt;/strong&gt;: predefine rules based on keywords or metadata in the query to decide which data source to hit. Fast and predictable, but weak on open-ended queries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM routing&lt;/strong&gt;: let the LLM understand the query's intent and dynamically decide where to route it. Flexible, but every routing decision burns an LLM call, adding latency and cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decision two: iteration depth -- when do you stop?
&lt;/h3&gt;

&lt;p&gt;The system can get stuck in an infinite loop -- every round of retrieval feels like something is still missing, so it keeps searching.&lt;/p&gt;

&lt;p&gt;Engineering-wise, you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;maximum iteration count&lt;/strong&gt; (typically 2-4 rounds)&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;time budget&lt;/strong&gt; (answer with what you have once you time out)&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;degradation strategy&lt;/strong&gt; (answer with available information and flag it as potentially incomplete once the iteration limit is hit)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Decision three: the latency-vs-accuracy trade-off
&lt;/h3&gt;

&lt;p&gt;Agentic RAG is slower than traditional RAG -- there's no avoiding it. Multiple LLM calls, parallel retrieval, and sufficiency evaluation all add latency at every step.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Cost multiplier&lt;/th&gt;
&lt;th&gt;Latency multiplier&lt;/th&gt;
&lt;th&gt;Best fit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Traditional RAG&lt;/td&gt;
&lt;td&gt;1x&lt;/td&gt;
&lt;td&gt;1x&lt;/td&gt;
&lt;td&gt;Simple Q&amp;amp;A, single knowledge base&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Adaptive RAG&lt;/td&gt;
&lt;td&gt;1.5-2x&lt;/td&gt;
&lt;td&gt;1.2-2x&lt;/td&gt;
&lt;td&gt;Mixed scenarios with varying query complexity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CRAG (Corrective RAG)&lt;/td&gt;
&lt;td&gt;3-5x&lt;/td&gt;
&lt;td&gt;2-3x&lt;/td&gt;
&lt;td&gt;High accuracy needs, tolerant of second-scale latency&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full Agentic RAG&lt;/td&gt;
&lt;td&gt;5-10x&lt;/td&gt;
&lt;td&gt;3-6x&lt;/td&gt;
&lt;td&gt;Complex multi-hop, cross-store, async scenarios&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Not every scenario needs full Agentic RAG.&lt;/p&gt;

&lt;p&gt;Classifying intent at the query level -- routing complex queries through the Agentic pipeline and simple ones through traditional RAG -- keeps average cost and latency within a reasonable range.&lt;/p&gt;



&lt;h2&gt;
  
  
  Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;I think the essence of Agentic RAG is turning retrieval into an executable strategy: &lt;strong&gt;if one pass isn't enough, keep searching until it is. And the system itself decides what "enough" means.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That shift sounds simple, but it requires moving from a stateless "query-response" model to a stateful "goal-plan-execute-evaluate-iterate" workflow.&lt;/p&gt;

&lt;p&gt;This is the same general challenge every agent system faces: &lt;strong&gt;state management is the core difficulty.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're building an enterprise AI system that spans multiple data sources, Agentic RAG isn't just an upgrade to your retrieval technique. It forces you to rethink data architecture, permission design, and workflow orchestration. Getting those three things right matters more than which framework or cloud vendor you pick.&lt;/p&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Google Research, &lt;a href="https://research.google/blog/unlocking-dependable-responses-with-gemini-enterprise-agent-platforms-agentic-rag/" rel="noopener noreferrer"&gt;&lt;em&gt;Unlocking dependable responses with Gemini Enterprise Agent Platform's Agentic RAG&lt;/em&gt;&lt;/a&gt;, June 2026&lt;/li&gt;
&lt;li&gt;Microsoft, &lt;a href="https://learn.microsoft.com/en-us/azure/search/agentic-retrieval-overview" rel="noopener noreferrer"&gt;&lt;em&gt;Agentic Retrieval Overview -- Azure AI Search&lt;/em&gt;&lt;/a&gt;, 2026-04-01 GA&lt;/li&gt;
&lt;li&gt;Microsoft, &lt;a href="https://learn.microsoft.com/en-us/azure/search/agentic-knowledge-source-overview" rel="noopener noreferrer"&gt;&lt;em&gt;What is a Knowledge Source? -- Azure AI Search&lt;/em&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Amazon Web Services, &lt;a href="https://aws.amazon.com/about-aws/whats-new/2024/04/knowledge-bases-amazon-bedrock-multiple-data-sources/" rel="noopener noreferrer"&gt;&lt;em&gt;Knowledge Bases for Amazon Bedrock -- Multiple Data Sources&lt;/em&gt;&lt;/a&gt;, April 2024&lt;/li&gt;
&lt;li&gt;MarsDevs, &lt;a href="https://www.marsdevs.com/guides/agentic-rag-2026-guide" rel="noopener noreferrer"&gt;&lt;em&gt;Agentic RAG: The 2026 Production Guide&lt;/em&gt;&lt;/a&gt; (includes cost/latency comparisons across approaches)&lt;/li&gt;
&lt;li&gt;Google Research, &lt;a href="https://research.google/blog/deeper-insights-into-retrieval-augmented-generation-the-role-of-sufficient-context/" rel="noopener noreferrer"&gt;&lt;em&gt;Deeper Insights into Retrieval-Augmented Generation: The Role of Sufficient Context&lt;/em&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>luhuidev</category>
    </item>
    <item>
      <title>Claude Code Incident Review: What Anthropic's Three Production Bugs Teach Agent Engineers</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Fri, 12 Jun 2026 14:24:59 +0000</pubDate>
      <link>https://dev.to/luhuidev/claude-code-incident-review-what-anthropics-three-production-bugs-teach-agent-engineers-4jmo</link>
      <guid>https://dev.to/luhuidev/claude-code-incident-review-what-anthropics-three-production-bugs-teach-agent-engineers-4jmo</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Last month, Anthropic published a rare kind of incident review.&lt;/p&gt;

&lt;p&gt;The rare part was not that they had bugs. If you build large-model products, bugs are part of the deal.&lt;/p&gt;

&lt;p&gt;The rare part was that they wrote up three production incidents in detail: how each one was introduced, why testing missed it, why it was hard to reproduce internally, and what they changed afterward.&lt;/p&gt;

&lt;p&gt;After reading it, I think the review is worth studying closely. If you build LLM Agents, especially systems with multi-turn tasks, tool calls, context compression, and reasoning trace management, these failures are not edge cases. They are waiting on the road.&lt;/p&gt;



&lt;h2&gt;
  
  
  Three Bugs, Three Failure Modes
&lt;/h2&gt;

&lt;p&gt;Here is the short version.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bug one&lt;/strong&gt;: On March 4, to address occasional UI freezes in Opus 4.6 under &lt;code&gt;high&lt;/code&gt; reasoning mode, the team changed the default reasoning effort from &lt;code&gt;high&lt;/code&gt; to &lt;code&gt;medium&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Internal testing looked fine: intelligence dropped only slightly, and latency improved a lot.&lt;/p&gt;

&lt;p&gt;After launch, users pushed back hard: Claude felt dumber.&lt;/p&gt;

&lt;p&gt;On April 7, one month later, the change was rolled back.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bug two&lt;/strong&gt;: On March 26, Anthropic shipped a cache optimization. The idea was simple: after a session had been idle for more than an hour, clear old thinking history to reduce the cost of resuming.&lt;/p&gt;

&lt;p&gt;Sounds reasonable, right?&lt;/p&gt;

&lt;p&gt;The production implementation had a bug. It was supposed to clear the old thinking once. Instead, it kept clearing it on every later turn.&lt;/p&gt;

&lt;p&gt;So Claude kept working while repeatedly losing the memory of why it was doing the work. Users saw forgetting, repetition, strange tool calls, and increasingly odd behavior.&lt;/p&gt;

&lt;p&gt;Worse, once thinking blocks kept disappearing, each request became a cache miss and burned through usage limits faster.&lt;/p&gt;

&lt;p&gt;The root cause was not identified until April 10, two full weeks later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bug three&lt;/strong&gt;: On April 16, to reduce verbose output from Opus 4.7, the team added a line to the system prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use no more than 25 words between tool calls, and no more than 100 words in the final response.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That prompt line showed no obvious regression during weeks of internal testing.&lt;/p&gt;

&lt;p&gt;After launch, coding quality dropped by 3%.&lt;/p&gt;

&lt;p&gt;On April 20, it was rolled back.&lt;/p&gt;




&lt;p&gt;These three bugs look different, but they point to the same issue: in an Agent system, things that look local, such as parameters, caches, and prompt lines, can still affect the core execution logic.&lt;/p&gt;

&lt;p&gt;Touch them, and you may be touching the model's brain.&lt;/p&gt;



&lt;h2&gt;
  
  
  Reasoning History Is Working Memory, Not a Log
&lt;/h2&gt;

&lt;p&gt;The second bug is the one I keep coming back to.&lt;/p&gt;

&lt;p&gt;"Clear old thinking to save tokens" is a perfectly normal engineering optimization. Thinking blocks are long and expensive. If a session has been idle for an hour, the old reasoning chain can look less important.&lt;/p&gt;

&lt;p&gt;But that is exactly the trap.&lt;/p&gt;

&lt;p&gt;For an Agent, the reasoning trace is not just a log. It does not merely record what happened. Its more important job is to preserve why the Agent made earlier decisions.&lt;/p&gt;

&lt;p&gt;That why is what lets a multi-turn task keep moving.&lt;/p&gt;

&lt;p&gt;When it disappears, the Agent does not crash immediately. It can still talk, call tools, and return results. But it has already started forgetting.&lt;/p&gt;

&lt;p&gt;It forgets which paths were ruled out, why the current path was chosen, and what problem the user was actually trying to solve.&lt;/p&gt;

&lt;p&gt;The result is a nasty kind of degradation: it gets worse, and the task drifts.&lt;/p&gt;

&lt;p&gt;This class of bug is painful because it is not a crash. It does not give you a clean stack trace. It slowly shows up in production as a feeling that the Agent has become strangely bad.&lt;/p&gt;

&lt;p&gt;So context management cannot be a blunt token-count cut.&lt;/p&gt;

&lt;p&gt;At minimum, we need to separate three categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Do not casually compress&lt;/strong&gt;: decision rationale, task intent, hard constraints, reasoning path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can compress&lt;/strong&gt;: intermediate observations, tool outputs, process material.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can drop&lt;/strong&gt;: formatting helpers, redundant explanations, temporary display content.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reasoning history is not cache garbage. In many cases, it is the Agent's working memory.&lt;/p&gt;

&lt;p&gt;You may think you are saving tokens. You may actually be removing the part of the system that lets the Agent stay on task.&lt;/p&gt;



&lt;h2&gt;
  
  
  Every Prompt Line Is Code
&lt;/h2&gt;

&lt;p&gt;The third bug is just as important.&lt;/p&gt;

&lt;p&gt;How can adding one line that says "say less" reduce coding quality?&lt;/p&gt;

&lt;p&gt;Because in model behavior, less output and less thinking are not always separate things.&lt;/p&gt;

&lt;p&gt;If you require the final answer to be under 100 words and text between tool calls to be under 25 words, the model may not only compress expression. It may compress the decision process.&lt;/p&gt;

&lt;p&gt;This is not a traditional bug. The model is sincerely optimizing for the target you gave it.&lt;/p&gt;

&lt;p&gt;That is why Anthropic's follow-up discipline matters: every system prompt change should be ablated per model; if a line can be tested line by line, test it line by line; changes that may affect intelligence need gradual rollout and a soak period.&lt;/p&gt;

&lt;p&gt;That sounds heavy.&lt;/p&gt;

&lt;p&gt;But if you accept that prompts are production code, the discipline is not excessive.&lt;/p&gt;



&lt;h2&gt;
  
  
  Clean Test Environments Are Unlike Production
&lt;/h2&gt;

&lt;p&gt;There is a common Agent engineering problem that people do not like to face:&lt;/p&gt;

&lt;p&gt;The test environment is too clean.&lt;/p&gt;

&lt;p&gt;So clean that it stops looking like production.&lt;/p&gt;

&lt;p&gt;Many Agent failures are not as simple as "input A produces wrong output B." They depend on a sequence of state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;session idle for more than one hour
resume
continue multi-turn tool use
thinking gets cleared
enter the next turn
thinking gets cleared again
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That kind of state sequence is hard to cover with unit tests and easy to miss in e2e tests.&lt;/p&gt;

&lt;p&gt;We test features. Production runs a state machine.&lt;/p&gt;

&lt;p&gt;That is also why Anthropic later had more internal employees use the exact same Claude Code build as the public release, rather than a test build.&lt;/p&gt;

&lt;p&gt;Real usage is still the best integration test.&lt;/p&gt;



&lt;h2&gt;
  
  
  Defaults Are the Product
&lt;/h2&gt;

&lt;p&gt;Now back to the first bug.&lt;/p&gt;

&lt;p&gt;Changing &lt;code&gt;high&lt;/code&gt; to &lt;code&gt;medium&lt;/code&gt; made sense from an engineering angle: fewer freezes, lower latency, and only a slight intelligence drop.&lt;/p&gt;

&lt;p&gt;The problem is that "slight drop" is benchmark language. It may not match user experience.&lt;/p&gt;

&lt;p&gt;Users are not running average benchmarks. They are working with their code, their context, their workflow, and their messy problems.&lt;/p&gt;

&lt;p&gt;In those highly personalized tasks, a small capability drop can feel like: it no longer understands me, it is not as sharp as before, it is making basic mistakes.&lt;/p&gt;

&lt;p&gt;The product may offer a setting, but most users will not change it. The default is the product decision.&lt;/p&gt;



&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;The most valuable part of this incident review is not the reminder that Claude Code can have bugs.&lt;/p&gt;

&lt;p&gt;That is normal.&lt;/p&gt;

&lt;p&gt;The valuable part is the reminder that Agent reliability often fails outside the model itself, in nearby system decisions that look local, technical, and low-risk.&lt;/p&gt;

&lt;p&gt;Default parameters, cache strategy, context trimming, prompt constraints, and differences between test and production builds can all change Agent behavior.&lt;/p&gt;

&lt;p&gt;Building an Agent is not just calling a smart model.&lt;/p&gt;

&lt;p&gt;It is maintaining a complex system that can act, forget, misunderstand goals, and be shaped by context.&lt;/p&gt;

&lt;p&gt;So the core discipline of Agent engineering may be this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do not only ask whether a change made the system faster, cheaper, or shorter. Also ask whether it took away the memory the model needs to finish the task.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>luhuidev</category>
      <category>ai</category>
      <category>claude</category>
    </item>
    <item>
      <title>DeepMind AlphaProof Nexus Explained: 4 System Paradigms for AI Math Research</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Thu, 28 May 2026 14:55:25 +0000</pubDate>
      <link>https://dev.to/luhuidev/deepmind-alphaproof-nexus-explained-4-system-paradigms-for-ai-math-research-1kdb</link>
      <guid>https://dev.to/luhuidev/deepmind-alphaproof-nexus-explained-4-system-paradigms-for-ai-math-research-1kdb</guid>
      <description>&lt;p&gt;🙋‍&lt;br&gt;
&lt;em&gt;I’m &lt;a href="https://luhuidev.com/" rel="noopener noreferrer"&gt;Luhui Dev&lt;/a&gt;, a developer who has been breaking down Agent engineering and exploring how AI can be applied in education.&lt;br&gt;
I focus on Agent Harness, LLM application engineering, AI for Math, and the productization of education SaaS.&lt;/em&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In May 2026, DeepMind released the arXiv paper &lt;a href="https://arxiv.org/html/2605.22763v1" rel="noopener noreferrer"&gt;Advancing Mathematics Research with AI-Driven Formal Proof Search&lt;/a&gt;, introducing &lt;strong&gt;AlphaProof Nexus&lt;/strong&gt;, a formal proof system for mathematical research.&lt;/p&gt;

&lt;p&gt;If we only look at the results, the paper may sound like another story about AI proving math problems: the system solved 9 out of 353 formalized Erdos open problems, proved 44 out of 492 OEIS conjectures, and was also used in real research across graph theory, optimization theory, algebraic geometry, additive combinatorics, and quantum optics.&lt;/p&gt;

&lt;p&gt;But as someone building in AI + education, what I care about more is the research route behind it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let large models propose proof ideas, let formal systems such as Lean verify them, let specialized proof searchers solve local goals, and use multi-agent orchestration to turn failures, partial drafts, and subgoals into reusable search assets.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This essay breaks down AlphaProof Nexus in plain language: why it exists, how the system is designed, and the &lt;strong&gt;four AI math research paradigms&lt;/strong&gt; reflected in the paper.&lt;/p&gt;



&lt;h2&gt;
  
  
  1. Why AI for Math Needs Formal Proof
&lt;/h2&gt;

&lt;p&gt;Most people understand mathematical proof in natural language:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Since A is true, B follows. Because of a theorem, C follows. Therefore the conclusion holds.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This works for human mathematicians because people can fill in omitted reasoning. For AI, however, there is a serious issue: &lt;strong&gt;large models are good at writing text that looks like a proof, but that does not mean they have actually proved anything.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They may:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cite theorems that do not exist;&lt;/li&gt;
&lt;li&gt;skip key steps;&lt;/li&gt;
&lt;li&gt;replace a hard problem with another problem that looks easier but is still unproved;&lt;/li&gt;
&lt;li&gt;write confident derivations with broken logic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the core starting point of the DeepMind paper is to make AI work inside a strict system.&lt;/p&gt;

&lt;p&gt;That system is &lt;strong&gt;Lean&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Lean can be understood as a mathematical compiler. When programmers write code, compilers check syntax and type errors. When mathematicians write Lean proofs, Lean checks whether every logical step really holds.&lt;/p&gt;

&lt;p&gt;If Lean accepts a proof, the proof is not merely plausible. It has passed strict machine checking.&lt;/p&gt;

&lt;p&gt;That is the basic idea of AlphaProof Nexus:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI can guess, try, and fail, but the final answer must pass Lean verification.&lt;/strong&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  2. What Is AlphaProof Nexus?
&lt;/h2&gt;

&lt;p&gt;AlphaProof Nexus is not a single large model, nor is it a chat-only math assistant. It is closer to an &lt;strong&gt;AI mathematical research pipeline&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The input is a Lean file containing an unfinished theorem proof. The system repeatedly modifies, completes, and decomposes the proof until Lean accepts it.&lt;/p&gt;

&lt;p&gt;You can picture it like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4a5b8y8ob3mb5nhcsqxk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4a5b8y8ob3mb5nhcsqxk.png" alt="AlphaProof Nexus proof search flowchart" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are several important roles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LLM&lt;/strong&gt;: proposes proof ideas, writes Lean code, and fixes errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lean&lt;/strong&gt;: checks whether the proof is actually correct.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AlphaProof&lt;/strong&gt;: solves certain local proof goals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rater Agent&lt;/strong&gt;: compares proof drafts and judges which ones are more promising.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Population DB&lt;/strong&gt;: stores many unfinished but valuable proof drafts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SafeVerify&lt;/strong&gt;: performs final checks against cheating, such as modifying the original theorem or introducing disallowed axioms.&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  3. Four AI Math Research Paradigms in the Paper
&lt;/h2&gt;

&lt;p&gt;DeepMind compares four agent configurations. They can also be read as four paradigms for AI-driven mathematical research.&lt;/p&gt;

&lt;h3&gt;
  
  
  Paradigm 1: Basic Agent
&lt;/h3&gt;

&lt;p&gt;The first is the most basic pattern: &lt;strong&gt;LLM + Lean feedback loop&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It works much like a programmer writing code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The LLM reads an unfinished Lean proof.&lt;/li&gt;
&lt;li&gt;It tries to fill in proof code.&lt;/li&gt;
&lt;li&gt;Lean compiles the file.&lt;/li&gt;
&lt;li&gt;If Lean reports errors, those errors are sent back to the LLM.&lt;/li&gt;
&lt;li&gt;The LLM edits the proof based on the errors.&lt;/li&gt;
&lt;li&gt;This repeats until the proof passes or the budget is exhausted.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The core ability here is iterative trial and correction.&lt;/p&gt;

&lt;p&gt;Imagine a student solving a problem. The student writes a solution, the teacher points out what is wrong, and the student revises it. Here the teacher is not a person but the Lean compiler. Lean will not say whether an idea is elegant, but it will strictly tell you when a type is wrong, a goal remains unsolved, a theorem does not match, or a logical step is missing.&lt;/p&gt;

&lt;p&gt;That gives the large model very high-quality feedback.&lt;/p&gt;

&lt;p&gt;One interesting conclusion in the paper is that &lt;strong&gt;Basic Agent is already strong&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In post hoc experiments, Basic Agent could also reproduce the 9 successful Erdos cases, although harder problems required more cost and had worse efficiency.&lt;/p&gt;

&lt;p&gt;This suggests that as base model capability improves, the simple "generate - compile - repair" loop has already become a highly competitive baseline for formal mathematics.&lt;/p&gt;

&lt;p&gt;The lesson is straightforward: do not expect a large model to produce a perfect proof in one shot. Put it inside an environment that can keep giving feedback and force revision.&lt;/p&gt;



&lt;h3&gt;
  
  
  Paradigm 2: Basic Agent + AlphaProof
&lt;/h3&gt;

&lt;p&gt;The second paradigm adds &lt;strong&gt;AlphaProof&lt;/strong&gt; on top of Basic Agent.&lt;/p&gt;

&lt;p&gt;AlphaProof is a formal proof search system DeepMind developed earlier. In Nexus, it is not the main character. It is more like a local proof specialist.&lt;/p&gt;

&lt;p&gt;When an LLM writes Lean proofs, it often runs into small goals such as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the current context, prove this subclaim.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Some subgoals are mechanical but awkward for an LLM to write. Others require searching through a sequence of tactics, meaning Lean proof commands. At that point, the system can hand local goals to AlphaProof.&lt;/p&gt;

&lt;p&gt;AlphaProof may return three kinds of results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it finds a proof;&lt;/li&gt;
&lt;li&gt;it proves the subgoal is actually false;&lt;/li&gt;
&lt;li&gt;it fails to find a proof within budget.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This matters because the LLM no longer has to carry every proof detail alone.&lt;/p&gt;

&lt;p&gt;You can think of the LLM as a graduate student responsible for the overall idea and proof structure; AlphaProof as a tactical searcher responsible for local technical details; and Lean as the final judge.&lt;/p&gt;

&lt;p&gt;The paper also notes that &lt;strong&gt;standalone AlphaProof cannot independently solve these research-level open problems&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the experiments, AlphaProof alone did not solve the 9 Erdos problems. Its effective position is inside the larger Nexus system, where it acts as a local proof tool.&lt;/p&gt;



&lt;h3&gt;
  
  
  Paradigm 3: Basic Agent + Evolution
&lt;/h3&gt;

&lt;p&gt;The third paradigm introduces a key idea: &lt;strong&gt;evolutionary search&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Mathematical proof is often not linear.&lt;/p&gt;

&lt;p&gt;One proof route may get stuck halfway. Another route may be unfinished but closer to the core idea. A third route may have proved useful lemmas even if the main theorem is not done.&lt;/p&gt;

&lt;p&gt;If every agent run starts from zero, a lot of exploration is wasted. AlphaProof Nexus therefore saves unfinished proof drafts into a &lt;strong&gt;Population DB&lt;/strong&gt;, a seed population of proof sketches.&lt;/p&gt;

&lt;p&gt;The system then uses a Rater Agent to compare those drafts and decide which ones are more promising.&lt;/p&gt;

&lt;p&gt;It is a bit like evolution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;each proof draft is an individual;&lt;/li&gt;
&lt;li&gt;agents mutate and rewrite drafts;&lt;/li&gt;
&lt;li&gt;the rater selects more promising drafts;&lt;/li&gt;
&lt;li&gt;the system spends compute on routes with higher potential.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The hard part is that success signals in mathematical proof are very sparse. In program optimization, even a non-optimal program may still get a score. In formal proof, a proof usually either succeeds completely or does not.&lt;/p&gt;

&lt;p&gt;Intermediate states are hard to quantify.&lt;/p&gt;

&lt;p&gt;DeepMind's approach is to ask models to compare proof draft quality instead of assigning absolute scores. For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Among these unfinished proofs, which route is clearer? Which remaining goals look more credible? Which one is more likely to be completed?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The system then ranks proof drafts using an Elo-like mechanism and uses a P-UCB-style strategy to balance two needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;continue developing high-scoring routes;&lt;/li&gt;
&lt;li&gt;explore routes that have not been tried enough.&lt;/li&gt;
&lt;/ul&gt;



&lt;h3&gt;
  
  
  Paradigm 4: Full-Featured Agent
&lt;/h3&gt;

&lt;p&gt;The fourth paradigm is the main system promoted by the paper: &lt;strong&gt;LLM + Lean + AlphaProof + Evolution&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It combines the earlier capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the LLM writes proofs, edits proofs, and proposes lemmas;&lt;/li&gt;
&lt;li&gt;Lean checks whether each step is correct;&lt;/li&gt;
&lt;li&gt;AlphaProof handles local subgoals;&lt;/li&gt;
&lt;li&gt;Evolution saves and filters different proof routes;&lt;/li&gt;
&lt;li&gt;Rater Agent judges which drafts deserve more work;&lt;/li&gt;
&lt;li&gt;SafeVerify performs final safety verification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the full shape of AlphaProof Nexus.&lt;/p&gt;

&lt;p&gt;The way it solves math problems resembles a highly automated research team: one role proposes ideas, one checks logic, one solves local technical problems, one reviews different directions, one manages historical attempts, and one performs final acceptance.&lt;/p&gt;



&lt;h2&gt;
  
  
  4. A Key Design: Proof Search Must Prevent Cheating
&lt;/h2&gt;

&lt;p&gt;AI mathematical proof has a special failure mode: it may make the proof easier by changing the problem, and it often learns to do exactly that.&lt;/p&gt;

&lt;p&gt;Suppose the original goal is to prove that property P holds for all natural numbers n.&lt;/p&gt;

&lt;p&gt;An agent may quietly change it to: property P holds for some natural numbers n.&lt;/p&gt;

&lt;p&gt;Or it may introduce an unallowed axiom that effectively assumes the conclusion.&lt;/p&gt;

&lt;p&gt;Lean may still pass certain local checks, but that is obviously not the proof we want.&lt;/p&gt;

&lt;p&gt;So AlphaProof Nexus performs multiple layers of safety checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;check whether the theorem statement was modified;&lt;/li&gt;
&lt;li&gt;check whether any &lt;code&gt;sorry&lt;/code&gt; remains;&lt;/li&gt;
&lt;li&gt;check whether disallowed axioms were introduced;&lt;/li&gt;
&lt;li&gt;check whether the proof truly corresponds to the original problem;&lt;/li&gt;
&lt;li&gt;run Lean inside a sandbox.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;This is useful for all agent systems: when the task objective is complex enough, agents may learn to bypass the objective instead of completing it. Strong verification constraints are mandatory.&lt;/strong&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  5. Experimental Results in the Paper
&lt;/h2&gt;

&lt;p&gt;DeepMind applied the system to several mathematical tasks. The most representative ones are Erdos problems and OEIS conjectures.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Erdos Problems
&lt;/h3&gt;

&lt;p&gt;Erdos was one of the most important mathematicians of the twentieth century and left behind many open problems. The paper reports that the system processed 353 formalized Erdos open problems and solved 9 of them.&lt;/p&gt;

&lt;p&gt;The percentage may look low, but these are not elementary contest problems. They are research-level mathematical problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. OEIS Conjectures
&lt;/h3&gt;

&lt;p&gt;OEIS is a database of integer sequences with many conjectures about sequence patterns. The system proved 44 out of 492 OEIS conjectures.&lt;/p&gt;

&lt;p&gt;This type of task is especially suitable for formal proof systems because many sequence conjectures can be encoded cleanly as definitions and theorems.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Deployment in Real Mathematical Research
&lt;/h3&gt;

&lt;p&gt;The paper also says the system was used in multiple research areas, including graph theory, optimization theory, algebraic geometry, additive combinatorics, and quantum optics.&lt;/p&gt;



&lt;h2&gt;
  
  
  6. Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;Here are the conclusions I reached after reading the paper closely.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion 1: LLMs Can Already Be Core Components of Formal Proof Search
&lt;/h3&gt;

&lt;p&gt;Many people used to say that large models are bad at rigorous mathematics because they hallucinate, skip steps, and invent things.&lt;/p&gt;

&lt;p&gt;That is true, but incomplete.&lt;/p&gt;

&lt;p&gt;If you ask an LLM to directly write a natural-language proof, it is unreliable. But if you place it inside a strict feedback system such as Lean, it can become an efficient search engine.&lt;/p&gt;

&lt;p&gt;The value of an LLM is not that it is always correct. Its value is that it can propose many candidate routes and keep revising them based on compiler feedback.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion 2: Multi-Agent Orchestration Matters More Than a Single Model
&lt;/h3&gt;

&lt;p&gt;The point of AlphaProof Nexus is not that one model version can solve hard problems. The point is that the system decomposes capabilities into generation, checking, search, rating, caching, and verification.&lt;/p&gt;

&lt;p&gt;That is an engineering mindset. Mathematical research becomes a long-running search process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion 3: Failed Attempts Are Valuable
&lt;/h3&gt;

&lt;p&gt;Unfinished proof sketches, failed subgoals, Lean errors, and AlphaProof search results can all enter later loops.&lt;/p&gt;

&lt;p&gt;That makes mathematical proof search feel more like software engineering: code can be reused, error logs can be analyzed, intermediate states can be saved, branches can continue, and the final result is accepted by a compiler.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion 4: Strong and Cheap Models Can Divide the Work
&lt;/h3&gt;

&lt;p&gt;The paper uses stronger models for complex proof generation and cheaper models for draft comparison and ranking.&lt;/p&gt;

&lt;p&gt;That is a practical agent engineering lesson. Not every step needs the strongest model.&lt;/p&gt;

&lt;p&gt;Use strong models for complex reasoning, cheaper models for high-throughput evaluation, and specialized tools for local proof. That is more scalable than asking one expensive model to do everything.&lt;/p&gt;

</description>
      <category>deepmind</category>
      <category>ai</category>
      <category>math</category>
      <category>luhuidev</category>
    </item>
    <item>
      <title>Lessons from LangChain: Designing a Reliable Runtime for Production-Grade Agents</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Wed, 20 May 2026 13:46:51 +0000</pubDate>
      <link>https://dev.to/luhuidev/lessons-from-langchain-designing-a-reliable-runtime-for-production-grade-agents-6gk</link>
      <guid>https://dev.to/luhuidev/lessons-from-langchain-designing-a-reliable-runtime-for-production-grade-agents-6gk</guid>
      <description>&lt;p&gt;🙋‍&lt;br&gt;
&lt;em&gt;I’m &lt;a href="http://luhuidev.com/" rel="noopener noreferrer"&gt;Luhui Dev&lt;/a&gt;, a developer who has been breaking down Agent engineering and exploring how AI can be applied in education.&lt;br&gt;
I focus on Agent Harness, LLM application engineering, AI for Math, and the productization of education SaaS.&lt;/em&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Agent demos are easy to get excited about. A model, a few tools, a prompt, wrap it in a loop, and suddenly you have something that searches, writes files, and calls APIs.&lt;/p&gt;

&lt;p&gt;But between a demo and a production system, there's a long gulf. I call it the &lt;strong&gt;Runtime gap&lt;/strong&gt; — and what crosses it isn't a smarter model. It's a runtime that can hold up complex, unstable, interruptible, recoverable workloads in a real environment.&lt;/p&gt;

&lt;p&gt;Once you actually deploy into a business context, an Agent might run for minutes or tens of minutes. It calls multiple external systems, may need user approval, may hit network failures, tool timeouts, drifting model output, missing permissions, mid-flight user interruptions, process restarts, and version upgrades. Worse, it carries state: where the task is up to, what's already been queried, which intermediate files were written, which conclusions are still unconfirmed, whether this user can access a given dataset.&lt;/p&gt;

&lt;p&gt;At that point, optimizing prompts alone won't fix the underlying problem. What an Agent needs is a runtime that holds the execution process together — complex, unstable, interruptible, and recoverable.&lt;/p&gt;

&lt;p&gt;LangChain's recent writing on production deep agents and their Runtime is worth sharing for anyone building Agent products. It's a useful reminder: the moat for business-grade Agents isn't just a prettier agent loop. It's whether you can make state, permissions, recovery, observability, and human collaboration into a stable foundation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ldp56a85u7vz4a6rp2t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ldp56a85u7vz4a6rp2t.png" width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  1. Business-grade Agent failures don't only happen when the model is wrong
&lt;/h2&gt;

&lt;p&gt;When people think about Agent reliability, the first thing that comes to mind is usually hallucinations. That matters, but in a business system, the failure surface is much larger.&lt;/p&gt;

&lt;p&gt;The process might crash on step 8 of a long task. Re-running wastes cost and may double-call external APIs, leaving dirty data behind.&lt;/p&gt;

&lt;p&gt;A tool might fail. An API timeout, a page that won't load, a database query that throws — without retries, fallbacks, and state persistence, the whole task becomes a one-shot gamble.&lt;/p&gt;

&lt;p&gt;It might lose context while waiting for human approval. The user comes back half an hour later to click "Confirm," and the system can't remember which step they were confirming.&lt;/p&gt;

&lt;p&gt;It might lose control at the interaction layer. The Agent is still running, and the user types "wait, that direction is wrong — switch to plan B." Should the system queue, interrupt, restart, or reject? Without a clear policy, the experience falls apart.&lt;/p&gt;

&lt;p&gt;So reliability for a production Agent is at least six things: execution reliability, state reliability, interaction reliability, permission reliability, observability, and operational reliability. The value of a Runtime is to productize and frameworkify these problems — instead of leaving every team to hand-roll them from scratch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwoxm2nujkxonmgnbz0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwoxm2nujkxonmgnbz0g.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  2. Separate Harness from Runtime
&lt;/h2&gt;

&lt;p&gt;In my current view, one critical distinction is this: Harness and Runtime are not the same thing.&lt;/p&gt;

&lt;p&gt;The Harness is the behavioral shell of an Agent. It governs how the task is planned, how the prompt is written, which tools can be called, whether sub-tasks are spawned, whether there's a filesystem, whether sub-Agents are used, how context is compressed. This layer directly affects how smart the Agent looks.&lt;/p&gt;

&lt;p&gt;The Runtime is the lower layer. It governs how Agents get executed, persisted, recovered, interrupted, observed, scheduled, isolated across users, and how concurrent requests are handled. This layer directly affects whether the Agent can actually support a business system.&lt;/p&gt;

&lt;p&gt;In many open-source Agents, everything gets stuffed into the harness: rules in the prompt, try-catch inside tool calls, ad-hoc state in the database, a loading spinner on the frontend. It runs in the short term. Over time it becomes a tangle of logic no one wants to maintain.&lt;/p&gt;

&lt;p&gt;LangChain's Runtime approach is to lift the cross-cutting capabilities out of the agent-loop context.&lt;/p&gt;



&lt;h2&gt;
  
  
  3. Durable Execution: the first foundation of reliability
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F61utwkr3god64p49duzu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F61utwkr3god64p49duzu.png" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If I could only learn one design from LangChain Runtime, I'd start with durable execution.&lt;/p&gt;

&lt;p&gt;A normal web request is short-lived: request in, do some work, respond, done. Agents are different. A business Agent might run many steps: understand the task, break it down, retrieve material, call tools, write intermediate files, wait for approval, continue, generate a report. The process naturally spans multiple model calls, tool calls, and user interactions.&lt;/p&gt;

&lt;p&gt;Once tasks get long, the system has to answer one question: what if it crashes in the middle?&lt;/p&gt;

&lt;p&gt;LangChain/LangGraph's answer is checkpointing. Key states during execution are continuously persisted. On recovery, you don't start from scratch — you resume from the most recent reasonable state. For a business system, this isn't just a cost saver. It's how you avoid duplicating side effects.&lt;/p&gt;

&lt;p&gt;How does it actually work? LangGraph models Agent execution as a state graph. Each node is a step — a model call, a tool call, a conditional. State flows between nodes, and after each step, the current snapshot of the whole graph is serialized to the checkpointer. There are several design choices worth unpacking here.&lt;/p&gt;

&lt;p&gt;First, &lt;strong&gt;the unit of checkpointing is the node boundary, not the function-call boundary.&lt;/strong&gt; If a streaming model call dies mid-output, recovery re-runs the entire call.&lt;/p&gt;

&lt;p&gt;Second, &lt;strong&gt;state is structured, not a black-box pickle.&lt;/strong&gt; LangGraph requires you to split state into named channels (&lt;code&gt;messages&lt;/code&gt;, &lt;code&gt;plan&lt;/code&gt;, &lt;code&gt;scratchpad&lt;/code&gt;), each paired with a reducer (append for &lt;code&gt;messages&lt;/code&gt;, overwrite for &lt;code&gt;plan&lt;/code&gt;). That makes checkpoints structured diffs — traceable, replayable, and time-travelable to any step.&lt;/p&gt;

&lt;p&gt;Third, &lt;strong&gt;checkpoints form a tree, not a line.&lt;/strong&gt; Every checkpoint carries a parent reference. You can branch off any historical node and re-run — tweak the user's question, skip an approval, try a different tool — all of which grow new branches off the same tree.&lt;/p&gt;

&lt;p&gt;Fourth, &lt;strong&gt;interrupt and checkpoint share the same mechanism.&lt;/strong&gt; An interrupt before or after a node is essentially a checkpoint written at that point followed by a pause. Human approval, user edits, external wake-up signals — all reuse the same persistence layer. That's why HITL can be a Runtime capability rather than UI logic.&lt;/p&gt;

&lt;p&gt;Fifth, &lt;strong&gt;the backend is pluggable.&lt;/strong&gt; In dev, use in-memory or SQLite; in production, Postgres or Redis. Your Agent's reliability tier can scale with the business — you don't need heavyweight infrastructure on day one.&lt;/p&gt;

&lt;p&gt;Picture an Agent generating a research report for an enterprise customer. It has finished gathering material, summarizing competitors, drafting the report, and is now waiting for the user to confirm whether to pull internal CRM data. If the service restarts at this point, the ideal outcome isn't making the Agent search again from scratch, nor making the user re-describe their requirements. It's resuming at "waiting for confirmation."&lt;/p&gt;

&lt;p&gt;That's the point of durable execution: turning Agent execution from a one-shot function call into a savable, recoverable, resumable task that has a real lifecycle.&lt;/p&gt;

&lt;p&gt;There are still specific questions worth answering, like: what exactly counts as a recoverable boundary in each Agent step? Can writes to the business system be safely repeated?&lt;/p&gt;



&lt;h2&gt;
  
  
  4. Layer your state: short-term state, long-term memory, and business data shouldn't be mixed
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsho5x5bv1n8zolb9diee.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsho5x5bv1n8zolb9diee.png" width="799" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Complex Agent tasks produce state. But state shouldn't be one big stew.&lt;/p&gt;

&lt;p&gt;Short-term state is the current task's context: what the plan is, where execution has reached, intermediate results, which tool calls completed, what's pending confirmation. This kind of state belongs bound to threads, runs, and checkpoints.&lt;/p&gt;

&lt;p&gt;Long-term memory is cross-session context: user preferences, organizational rules, common workflows, recurring constraints, reusable knowledge. This should live in a long-term store, namespaced by user, organization, application, assistant, and so on.&lt;/p&gt;

&lt;p&gt;Business data is yet another layer: orders, problems, lessons, customer records, organizational assets, permission models. This data generally shouldn't be casually swallowed by an Agent Runtime. It should stay owned by the business system, with the Agent accessing it through controlled tools.&lt;/p&gt;

&lt;p&gt;LangChain's design is instructive here: it separates thread checkpoints from the long-term store, while still letting deep agents access different layers of state through something like a virtual filesystem. For the Agent on top, reading and writing files and memory feels natural; for the system underneath, state still has clear boundaries.&lt;/p&gt;

&lt;p&gt;This matters a lot in real business systems. Many early Agent products pile chat history, tool results, user preferences, and business data into a single conversation memory. It's simple to implement, but later it blows up at once in permissions, cost, retrieval quality, data cleanup, and compliance audit.&lt;/p&gt;

&lt;p&gt;A more robust pattern: short-term state serves task recovery, long-term memory serves experience continuity, and business data stays inside the business system — the Agent only reaches it through permission-controlled tools.&lt;/p&gt;



&lt;h2&gt;
  
  
  5. Human-in-the-loop isn't decoration — it's a reliability mechanism
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9ug0sxz22gvfjs90lcx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9ug0sxz22gvfjs90lcx.png" width="800" height="546"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Production-grade Agents are hard to fully automate. Especially anything that touches writes, external system calls, important decisions, paid resources, or user privacy — human collaboration is a necessary safety valve.&lt;/p&gt;

&lt;p&gt;The key isn't popping up a confirmation dialog. The real engineering question is: how does the Agent pause? What state is saved while it pauses? Can the user come back any time later and continue? Can the user edit the plan the Agent produced? After editing, where does it resume? Are approval records auditable?&lt;/p&gt;

&lt;p&gt;LangChain Runtime makes interrupt/resume a runtime capability rather than something the application layer judges ad-hoc. Because if HITL only lives in the frontend interaction layer, it quickly becomes UI logic — and once tasks span processes, workers, and time, the frontend can't hold it.&lt;/p&gt;

&lt;p&gt;Plenty of scenarios in business Agents need this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A finance Agent about to submit an expense report needs human confirmation.&lt;/li&gt;
&lt;li&gt;An education Agent generating lesson plans in bulk needs a teacher to pick the teaching style.&lt;/li&gt;
&lt;li&gt;A customer service Agent issuing a refund needs supervisor approval.&lt;/li&gt;
&lt;li&gt;A data analysis Agent wanting to access sensitive fields needs a one-time user authorization.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren't ordinary chat experiences — they're business workflows. If the Runtime natively supports pausing, resuming, approval, and state persistence, Agent reliability jumps a clear notch.&lt;/p&gt;



&lt;h2&gt;
  
  
  6. Permissions and multi-tenancy: an Agent shouldn't roam with the master key
&lt;/h2&gt;

&lt;p&gt;One of the biggest risks for a production Agent is permissions.&lt;/p&gt;

&lt;p&gt;In a normal app, the user clicks a button, calls an API, the server checks permissions — the chain is relatively clear. Once an Agent gets involved, it gets complicated: the model decides which tool to call, the tool may access external systems, those external systems may require user authorization, and the Agent may also write intermediate results into long-term memory.&lt;/p&gt;

&lt;p&gt;LangChain's approach is to split identity and permissions into layers: who the end user is, which threads and resources that user can access, which external systems the Agent can access on the user's behalf, and what team members can do on the platform itself.&lt;/p&gt;

&lt;p&gt;In this design, the Agent isn't a backend super-admin. It's more like a delegated executor, allowed to act only within the scope of the current user, current organization, and current task.&lt;/p&gt;

&lt;p&gt;If you're designing a Runtime for your own production Agent, you should at least think about these boundaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User identity enters the run context. Every Agent execution should know whom it is currently acting on behalf of.&lt;/li&gt;
&lt;li&gt;Resource access should be isolated by thread, file, project, and organization. You can't rely on a prompt to tell the model not to touch someone else's data.&lt;/li&gt;
&lt;li&gt;External tool authorization should be managed separately. GitHub, Slack, CRM, object storage, databases — long-term keys shouldn't be handed directly to the Agent's execution environment.&lt;/li&gt;
&lt;li&gt;Long-term memory needs namespaces. Otherwise the user preferences an Agent remembers can easily become data pollution in a multi-tenant setting.&lt;/li&gt;
&lt;li&gt;High-risk tools need approval or policy interception. Deletes, sends, payments, publishes, bulk writes — these can't rely on the model's self-discipline.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The more human-like the Agent feels, the easier it is for a system to assume it inherits a human's full permissions. From an engineering view, the Agent should hold task-scoped, time-bounded, minimum-privilege permissions.&lt;/p&gt;



&lt;h2&gt;
  
  
  7. Middleware: put protective capabilities into the runtime lifecycle
&lt;/h2&gt;

&lt;p&gt;Many teams write guardrails into the prompt: "don't leak private information," "don't perform dangerous operations," "ask the user when uncertain." Useful, but not enough.&lt;/p&gt;

&lt;p&gt;Models forget, prompts get overridden, tool-call paths can route around the rules, and streaming output and background tasks may behave differently. A business system needs a harder line of defense.&lt;/p&gt;

&lt;p&gt;The middleware design inserts control points around the Agent lifecycle: before the model call, during the model call, during a tool call, and after the model call — all can host policy.&lt;/p&gt;

&lt;p&gt;That means many reliability capabilities can sink down into the Runtime:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Before a model call: trim context, inject permission info, check token budgets.&lt;/li&gt;
&lt;li&gt;During a model call: model fallback, timeout control, retry policy, cost accounting.&lt;/li&gt;
&lt;li&gt;During a tool call: permission checks, parameter validation, sensitive-action interception, human approval.&lt;/li&gt;
&lt;li&gt;After model output: PII detection, format validation, result archiving, trace tagging.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is more stable than scattering logic across every tool, and far easier to govern uniformly.&lt;/p&gt;

&lt;p&gt;For a business-grade Agent, middleware isn't just a security filter — it's the entry point for Runtime governability.&lt;/p&gt;



&lt;h2&gt;
  
  
  8. Streaming and double-texting: interaction reliability also belongs in the Runtime
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8f9yof130wvf7qcqwf8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8f9yof130wvf7qcqwf8.png" width="799" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A lot of people treat streaming as a UX optimization. For Agents, streaming is also a reliability concern.&lt;/p&gt;

&lt;p&gt;If a long task has no real-time feedback, the user has no idea whether the system is still alive or where it's up to. Especially for research, coding, data analysis, and lesson-plan generation, users need to see the intermediate state: retrieving, calling a tool, drafting, waiting for confirmation.&lt;/p&gt;

&lt;p&gt;The trickier piece is mid-flight user input. The Agent is still running and the user sends a new instruction — what LangChain calls a double-texting problem. It's not a small UX detail. It's an interaction protocol problem.&lt;/p&gt;

&lt;p&gt;The system has to decide: is the new input queued, or does it interrupt the current task? Is it merged into the current context, or does the task roll back and re-run? Can the user change goals mid-task, or must they wait until the current task finishes?&lt;/p&gt;

&lt;p&gt;In business systems, the right answer varies.&lt;/p&gt;

&lt;p&gt;A writing Agent can let the user adjust direction mid-task.&lt;/p&gt;

&lt;p&gt;A payments Agent cannot get casually interrupted and then continue with dangerous operations.&lt;/p&gt;

&lt;p&gt;A lesson-plan Agent might be a good fit for queueing new input onto a task list.&lt;/p&gt;

&lt;p&gt;A coding Agent might need to pause the current command and wait for the user to confirm a plan change.&lt;/p&gt;

&lt;p&gt;This is why chat experience is actually part of Runtime design.&lt;/p&gt;



&lt;h2&gt;
  
  
  9. Observability: you can't debug a business Agent with logs alone
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdp7tzg22n3jrpajznap8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdp7tzg22n3jrpajznap8.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For traditional applications, logs, metrics, and distributed tracing usually get the job done. For Agents, plain logs are often not enough.&lt;/p&gt;

&lt;p&gt;That's because Agent errors are frequently process errors: step 1 misunderstood the task, step 3 used the wrong tool, step 5 accepted low-quality retrieval, step 7 promoted an intermediate assumption into a conclusion. The final answer is wrong, but the actual cause is buried in the execution path.&lt;/p&gt;

&lt;p&gt;LangChain/LangSmith emphasize trace, time travel, and debug. A business-grade Agent needs more than call success rate — it needs to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which nodes did this task pass through?&lt;/li&gt;
&lt;li&gt;What context did each step's model call actually see?&lt;/li&gt;
&lt;li&gt;Which tools were called? With what parameters? Returning what?&lt;/li&gt;
&lt;li&gt;How did intermediate state change?&lt;/li&gt;
&lt;li&gt;At which step did a branch occur?&lt;/li&gt;
&lt;li&gt;Were middleware, approvals, retries, or fallbacks triggered?&lt;/li&gt;
&lt;li&gt;If you change the state of a particular checkpoint, do the downstream results change?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These capabilities decide whether the Agent can be continuously improved. Otherwise the team is just tweaking prompts by feel — and that isn't an engineering loop.&lt;/p&gt;

&lt;p&gt;Going further: observability also feeds eval. Traces aren't just for triage — they become evaluation samples, regression tests, cost analyses, and product insight.&lt;/p&gt;



&lt;h2&gt;
  
  
  10. An Agent Runtime should scale horizontally and control cost
&lt;/h2&gt;

&lt;p&gt;Once a business Agent goes live and starts serving users, operational concerns kick in.&lt;/p&gt;

&lt;p&gt;Some tasks are short, some are long. Some only read data; some call slow tools. Some users send messages back-to-back; some tasks fire on a schedule. Model calls are expensive; tool calls can be expensive too. Once long tasks pile up, the API server, queue workers, Redis, Postgres, and external tools all become bottlenecks.&lt;/p&gt;

&lt;p&gt;Several things in LangChain Agent Server are worth learning from:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Separate the API server from queue workers.&lt;/strong&gt; The former accepts requests; the latter executes long-running tasks. This stops long tasks from dragging down the entry service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer ephemeral state and durable state.&lt;/strong&gt; Transient runtime state can live in something like Redis; threads, runs, checkpoints, and memory go into durable storage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concurrency is configurable.&lt;/strong&gt; Different Agents have different task shapes — I/O-heavy and CPU-heavy workers need different concurrency policies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Avoid frontend polling.&lt;/strong&gt; For long tasks, join/stream beats blunt polling — both for UX and for system resource cost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Support cron.&lt;/strong&gt; Plenty of business Agents don't fire because a user clicked something; they need to run periodic checks, periodic summaries, periodic syncs, periodic content generation.&lt;/p&gt;

&lt;p&gt;A reliable business Agent Runtime has to care about both task semantics and infrastructure cost at the same time.&lt;/p&gt;



&lt;h2&gt;
  
  
  11. A Runtime design checklist
&lt;/h2&gt;

&lt;p&gt;If you're not copying LangChain wholesale but designing a runtime for your own business Agent, here's a checklist to break the capability surface into.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One: task lifecycle.&lt;/strong&gt; Do you have basic abstractions like thread, run, and step? Can a single Agent execution be tracked, canceled, paused, resumed, retried?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two: durable execution.&lt;/strong&gt; Is the key state at each step checkpointed? Where are the recovery boundaries? Which operations are replayable, which must be idempotent, which can only resume after human confirmation?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three: layered state.&lt;/strong&gt; Are short-term task state, long-term memory, and business data separated? Are there namespaces? Are cleanup, migration, and audit supported?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Four: permission model.&lt;/strong&gt; Who is the Agent acting on behalf of? Which resources can it touch? Which tools can it call? How are external system authorizations managed? Do high-risk operations require approval?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Five: tool governance.&lt;/strong&gt; Do tools have schemas, permissions, timeouts, retries, rate limits, audit logs? On failure, do you retry, fall back, skip, or interrupt?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Six: human-in-the-loop.&lt;/strong&gt; Can a run be interrupted mid-flight? Can it resume after user confirmation? Are approval content, approver identity, and approval time auditable?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Seven: interaction protocol.&lt;/strong&gt; How is streaming designed? How is mid-flight user input handled? When is queueing, rejecting, interrupting, or restarting the right answer?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Eight: observability and debugging.&lt;/strong&gt; Is there structured tracing? Can you see model calls, tool calls, state changes, and middleware triggers? Can bad cases be turned into evals?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nine: operational scaling.&lt;/strong&gt; Are the entry service and execution workers separated? How is the queue designed? Where are the storage bottlenecks? How do you rate-limit when long tasks pile up? How is cost attributed?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ten: deployment boundaries.&lt;/strong&gt; What do you self-host, and what do you delegate to a managed platform? Can data stay inside your system? Are you locking yourself too deeply into one runtime?&lt;/p&gt;



&lt;h2&gt;
  
  
  12. Closing thoughts
&lt;/h2&gt;

&lt;p&gt;Agent products aren't only chasing smarter behavior. Once they enter a business system, what matters as much is being more reliable: recoverable, isolable, approvable, traceable, scalable, cost-controllable.&lt;/p&gt;

&lt;p&gt;That's why Agent Harness and Runtime are worth seeing as separate. The Harness sets the ceiling on what an Agent can do. The Runtime sets the floor under which it can't safely go live. Without the former, the Agent isn't smart enough; without the latter, the Agent can't be launched.&lt;/p&gt;

&lt;p&gt;If we're going to build our own production-grade Agents, the Runtime should enter the architecture from day one. Even if v1 isn't a full system, the boundaries should be defined first: how is task state saved, how is user identity passed, how are tool permissions controlled, how does human approval recover, how do traces settle into evaluation data.&lt;/p&gt;

&lt;p&gt;The future of Agents isn't only stronger models — it's a more mature Runtime. Whoever can make a complex Agent's execution stable, controllable, and auditable will get closer to real business deployment.&lt;/p&gt;

&lt;p&gt;That's what I find most worth learning from LangChain's Runtime piece.&lt;/p&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;LangChain, The Runtime Behind Production Deep Agents
&lt;a href="https://www.langchain.com/blog/runtime-behind-production-deep-agents" rel="noopener noreferrer"&gt;www.langchain.com/blog/runtime-behind-production-deep-agents&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;



</description>
      <category>ai</category>
      <category>agents</category>
      <category>langchain</category>
      <category>programming</category>
    </item>
    <item>
      <title>Lessons from LangChain: Designing a Reliable Runtime for Production-Grade Agents</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Wed, 20 May 2026 13:38:22 +0000</pubDate>
      <link>https://dev.to/luhuidev/lessons-from-langchain-designing-a-reliable-runtime-for-production-grade-agents-472g</link>
      <guid>https://dev.to/luhuidev/lessons-from-langchain-designing-a-reliable-runtime-for-production-grade-agents-472g</guid>
      <description>&lt;p&gt;🙋‍&lt;br&gt;
&lt;em&gt;I’m &lt;a href="http://luhuidev.com/" rel="noopener noreferrer"&gt;Luhui Dev&lt;/a&gt;, a developer who has been breaking down Agent engineering and exploring how AI can be applied in education.&lt;br&gt;
I focus on Agent Harness, LLM application engineering, AI for Math, and the productization of education SaaS.&lt;/em&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Agent demos are easy to get excited about. A model, a few tools, a prompt, wrap it in a loop, and suddenly you have something that searches, writes files, and calls APIs.&lt;/p&gt;

&lt;p&gt;But between a demo and a production system, there's a long gulf. I call it the &lt;strong&gt;Runtime gap&lt;/strong&gt; — and what crosses it isn't a smarter model. It's a runtime that can hold up complex, unstable, interruptible, recoverable workloads in a real environment.&lt;/p&gt;

&lt;p&gt;Once you actually deploy into a business context, an Agent might run for minutes or tens of minutes. It calls multiple external systems, may need user approval, may hit network failures, tool timeouts, drifting model output, missing permissions, mid-flight user interruptions, process restarts, and version upgrades. Worse, it carries state: where the task is up to, what's already been queried, which intermediate files were written, which conclusions are still unconfirmed, whether this user can access a given dataset.&lt;/p&gt;

&lt;p&gt;At that point, optimizing prompts alone won't fix the underlying problem. What an Agent needs is a runtime that holds the execution process together — complex, unstable, interruptible, and recoverable.&lt;/p&gt;

&lt;p&gt;LangChain's recent writing on production deep agents and their Runtime is worth sharing for anyone building Agent products. It's a useful reminder: the moat for business-grade Agents isn't just a prettier agent loop. It's whether you can make state, permissions, recovery, observability, and human collaboration into a stable foundation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ldp56a85u7vz4a6rp2t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ldp56a85u7vz4a6rp2t.png" width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  1. Business-grade Agent failures don't only happen when the model is wrong
&lt;/h2&gt;

&lt;p&gt;When people think about Agent reliability, the first thing that comes to mind is usually hallucinations. That matters, but in a business system, the failure surface is much larger.&lt;/p&gt;

&lt;p&gt;The process might crash on step 8 of a long task. Re-running wastes cost and may double-call external APIs, leaving dirty data behind.&lt;/p&gt;

&lt;p&gt;A tool might fail. An API timeout, a page that won't load, a database query that throws — without retries, fallbacks, and state persistence, the whole task becomes a one-shot gamble.&lt;/p&gt;

&lt;p&gt;It might lose context while waiting for human approval. The user comes back half an hour later to click "Confirm," and the system can't remember which step they were confirming.&lt;/p&gt;

&lt;p&gt;It might lose control at the interaction layer. The Agent is still running, and the user types "wait, that direction is wrong — switch to plan B." Should the system queue, interrupt, restart, or reject? Without a clear policy, the experience falls apart.&lt;/p&gt;

&lt;p&gt;So reliability for a production Agent is at least six things: execution reliability, state reliability, interaction reliability, permission reliability, observability, and operational reliability. The value of a Runtime is to productize and frameworkify these problems — instead of leaving every team to hand-roll them from scratch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwoxm2nujkxonmgnbz0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwoxm2nujkxonmgnbz0g.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  2. Separate Harness from Runtime
&lt;/h2&gt;

&lt;p&gt;In my current view, one critical distinction is this: Harness and Runtime are not the same thing.&lt;/p&gt;

&lt;p&gt;The Harness is the behavioral shell of an Agent. It governs how the task is planned, how the prompt is written, which tools can be called, whether sub-tasks are spawned, whether there's a filesystem, whether sub-Agents are used, how context is compressed. This layer directly affects how smart the Agent looks.&lt;/p&gt;

&lt;p&gt;The Runtime is the lower layer. It governs how Agents get executed, persisted, recovered, interrupted, observed, scheduled, isolated across users, and how concurrent requests are handled. This layer directly affects whether the Agent can actually support a business system.&lt;/p&gt;

&lt;p&gt;In many open-source Agents, everything gets stuffed into the harness: rules in the prompt, try-catch inside tool calls, ad-hoc state in the database, a loading spinner on the frontend. It runs in the short term. Over time it becomes a tangle of logic no one wants to maintain.&lt;/p&gt;

&lt;p&gt;LangChain's Runtime approach is to lift the cross-cutting capabilities out of the agent-loop context.&lt;/p&gt;



&lt;h2&gt;
  
  
  3. Durable Execution: the first foundation of reliability
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F61utwkr3god64p49duzu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F61utwkr3god64p49duzu.png" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If I could only learn one design from LangChain Runtime, I'd start with durable execution.&lt;/p&gt;

&lt;p&gt;A normal web request is short-lived: request in, do some work, respond, done. Agents are different. A business Agent might run many steps: understand the task, break it down, retrieve material, call tools, write intermediate files, wait for approval, continue, generate a report. The process naturally spans multiple model calls, tool calls, and user interactions.&lt;/p&gt;

&lt;p&gt;Once tasks get long, the system has to answer one question: what if it crashes in the middle?&lt;/p&gt;

&lt;p&gt;LangChain/LangGraph's answer is checkpointing. Key states during execution are continuously persisted. On recovery, you don't start from scratch — you resume from the most recent reasonable state. For a business system, this isn't just a cost saver. It's how you avoid duplicating side effects.&lt;/p&gt;

&lt;p&gt;How does it actually work? LangGraph models Agent execution as a state graph. Each node is a step — a model call, a tool call, a conditional. State flows between nodes, and after each step, the current snapshot of the whole graph is serialized to the checkpointer. There are several design choices worth unpacking here.&lt;/p&gt;

&lt;p&gt;First, &lt;strong&gt;the unit of checkpointing is the node boundary, not the function-call boundary.&lt;/strong&gt; If a streaming model call dies mid-output, recovery re-runs the entire call.&lt;/p&gt;

&lt;p&gt;Second, &lt;strong&gt;state is structured, not a black-box pickle.&lt;/strong&gt; LangGraph requires you to split state into named channels (&lt;code&gt;messages&lt;/code&gt;, &lt;code&gt;plan&lt;/code&gt;, &lt;code&gt;scratchpad&lt;/code&gt;), each paired with a reducer (append for &lt;code&gt;messages&lt;/code&gt;, overwrite for &lt;code&gt;plan&lt;/code&gt;). That makes checkpoints structured diffs — traceable, replayable, and time-travelable to any step.&lt;/p&gt;

&lt;p&gt;Third, &lt;strong&gt;checkpoints form a tree, not a line.&lt;/strong&gt; Every checkpoint carries a parent reference. You can branch off any historical node and re-run — tweak the user's question, skip an approval, try a different tool — all of which grow new branches off the same tree.&lt;/p&gt;

&lt;p&gt;Fourth, &lt;strong&gt;interrupt and checkpoint share the same mechanism.&lt;/strong&gt; An interrupt before or after a node is essentially a checkpoint written at that point followed by a pause. Human approval, user edits, external wake-up signals — all reuse the same persistence layer. That's why HITL can be a Runtime capability rather than UI logic.&lt;/p&gt;

&lt;p&gt;Fifth, &lt;strong&gt;the backend is pluggable.&lt;/strong&gt; In dev, use in-memory or SQLite; in production, Postgres or Redis. Your Agent's reliability tier can scale with the business — you don't need heavyweight infrastructure on day one.&lt;/p&gt;

&lt;p&gt;Picture an Agent generating a research report for an enterprise customer. It has finished gathering material, summarizing competitors, drafting the report, and is now waiting for the user to confirm whether to pull internal CRM data. If the service restarts at this point, the ideal outcome isn't making the Agent search again from scratch, nor making the user re-describe their requirements. It's resuming at "waiting for confirmation."&lt;/p&gt;

&lt;p&gt;That's the point of durable execution: turning Agent execution from a one-shot function call into a savable, recoverable, resumable task that has a real lifecycle.&lt;/p&gt;

&lt;p&gt;There are still specific questions worth answering, like: what exactly counts as a recoverable boundary in each Agent step? Can writes to the business system be safely repeated?&lt;/p&gt;



&lt;h2&gt;
  
  
  4. Layer your state: short-term state, long-term memory, and business data shouldn't be mixed
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsho5x5bv1n8zolb9diee.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsho5x5bv1n8zolb9diee.png" width="799" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Complex Agent tasks produce state. But state shouldn't be one big stew.&lt;/p&gt;

&lt;p&gt;Short-term state is the current task's context: what the plan is, where execution has reached, intermediate results, which tool calls completed, what's pending confirmation. This kind of state belongs bound to threads, runs, and checkpoints.&lt;/p&gt;

&lt;p&gt;Long-term memory is cross-session context: user preferences, organizational rules, common workflows, recurring constraints, reusable knowledge. This should live in a long-term store, namespaced by user, organization, application, assistant, and so on.&lt;/p&gt;

&lt;p&gt;Business data is yet another layer: orders, problems, lessons, customer records, organizational assets, permission models. This data generally shouldn't be casually swallowed by an Agent Runtime. It should stay owned by the business system, with the Agent accessing it through controlled tools.&lt;/p&gt;

&lt;p&gt;LangChain's design is instructive here: it separates thread checkpoints from the long-term store, while still letting deep agents access different layers of state through something like a virtual filesystem. For the Agent on top, reading and writing files and memory feels natural; for the system underneath, state still has clear boundaries.&lt;/p&gt;

&lt;p&gt;This matters a lot in real business systems. Many early Agent products pile chat history, tool results, user preferences, and business data into a single conversation memory. It's simple to implement, but later it blows up at once in permissions, cost, retrieval quality, data cleanup, and compliance audit.&lt;/p&gt;

&lt;p&gt;A more robust pattern: short-term state serves task recovery, long-term memory serves experience continuity, and business data stays inside the business system — the Agent only reaches it through permission-controlled tools.&lt;/p&gt;



&lt;h2&gt;
  
  
  5. Human-in-the-loop isn't decoration — it's a reliability mechanism
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9ug0sxz22gvfjs90lcx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9ug0sxz22gvfjs90lcx.png" width="800" height="546"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Production-grade Agents are hard to fully automate. Especially anything that touches writes, external system calls, important decisions, paid resources, or user privacy — human collaboration is a necessary safety valve.&lt;/p&gt;

&lt;p&gt;The key isn't popping up a confirmation dialog. The real engineering question is: how does the Agent pause? What state is saved while it pauses? Can the user come back any time later and continue? Can the user edit the plan the Agent produced? After editing, where does it resume? Are approval records auditable?&lt;/p&gt;

&lt;p&gt;LangChain Runtime makes interrupt/resume a runtime capability rather than something the application layer judges ad-hoc. Because if HITL only lives in the frontend interaction layer, it quickly becomes UI logic — and once tasks span processes, workers, and time, the frontend can't hold it.&lt;/p&gt;

&lt;p&gt;Plenty of scenarios in business Agents need this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A finance Agent about to submit an expense report needs human confirmation.&lt;/li&gt;
&lt;li&gt;An education Agent generating lesson plans in bulk needs a teacher to pick the teaching style.&lt;/li&gt;
&lt;li&gt;A customer service Agent issuing a refund needs supervisor approval.&lt;/li&gt;
&lt;li&gt;A data analysis Agent wanting to access sensitive fields needs a one-time user authorization.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren't ordinary chat experiences — they're business workflows. If the Runtime natively supports pausing, resuming, approval, and state persistence, Agent reliability jumps a clear notch.&lt;/p&gt;



&lt;h2&gt;
  
  
  6. Permissions and multi-tenancy: an Agent shouldn't roam with the master key
&lt;/h2&gt;

&lt;p&gt;One of the biggest risks for a production Agent is permissions.&lt;/p&gt;

&lt;p&gt;In a normal app, the user clicks a button, calls an API, the server checks permissions — the chain is relatively clear. Once an Agent gets involved, it gets complicated: the model decides which tool to call, the tool may access external systems, those external systems may require user authorization, and the Agent may also write intermediate results into long-term memory.&lt;/p&gt;

&lt;p&gt;LangChain's approach is to split identity and permissions into layers: who the end user is, which threads and resources that user can access, which external systems the Agent can access on the user's behalf, and what team members can do on the platform itself.&lt;/p&gt;

&lt;p&gt;In this design, the Agent isn't a backend super-admin. It's more like a delegated executor, allowed to act only within the scope of the current user, current organization, and current task.&lt;/p&gt;

&lt;p&gt;If you're designing a Runtime for your own production Agent, you should at least think about these boundaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User identity enters the run context. Every Agent execution should know whom it is currently acting on behalf of.&lt;/li&gt;
&lt;li&gt;Resource access should be isolated by thread, file, project, and organization. You can't rely on a prompt to tell the model not to touch someone else's data.&lt;/li&gt;
&lt;li&gt;External tool authorization should be managed separately. GitHub, Slack, CRM, object storage, databases — long-term keys shouldn't be handed directly to the Agent's execution environment.&lt;/li&gt;
&lt;li&gt;Long-term memory needs namespaces. Otherwise the user preferences an Agent remembers can easily become data pollution in a multi-tenant setting.&lt;/li&gt;
&lt;li&gt;High-risk tools need approval or policy interception. Deletes, sends, payments, publishes, bulk writes — these can't rely on the model's self-discipline.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The more human-like the Agent feels, the easier it is for a system to assume it inherits a human's full permissions. From an engineering view, the Agent should hold task-scoped, time-bounded, minimum-privilege permissions.&lt;/p&gt;



&lt;h2&gt;
  
  
  7. Middleware: put protective capabilities into the runtime lifecycle
&lt;/h2&gt;

&lt;p&gt;Many teams write guardrails into the prompt: "don't leak private information," "don't perform dangerous operations," "ask the user when uncertain." Useful, but not enough.&lt;/p&gt;

&lt;p&gt;Models forget, prompts get overridden, tool-call paths can route around the rules, and streaming output and background tasks may behave differently. A business system needs a harder line of defense.&lt;/p&gt;

&lt;p&gt;The middleware design inserts control points around the Agent lifecycle: before the model call, during the model call, during a tool call, and after the model call — all can host policy.&lt;/p&gt;

&lt;p&gt;That means many reliability capabilities can sink down into the Runtime:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Before a model call: trim context, inject permission info, check token budgets.&lt;/li&gt;
&lt;li&gt;During a model call: model fallback, timeout control, retry policy, cost accounting.&lt;/li&gt;
&lt;li&gt;During a tool call: permission checks, parameter validation, sensitive-action interception, human approval.&lt;/li&gt;
&lt;li&gt;After model output: PII detection, format validation, result archiving, trace tagging.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is more stable than scattering logic across every tool, and far easier to govern uniformly.&lt;/p&gt;

&lt;p&gt;For a business-grade Agent, middleware isn't just a security filter — it's the entry point for Runtime governability.&lt;/p&gt;



&lt;h2&gt;
  
  
  8. Streaming and double-texting: interaction reliability also belongs in the Runtime
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8f9yof130wvf7qcqwf8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8f9yof130wvf7qcqwf8.png" width="799" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A lot of people treat streaming as a UX optimization. For Agents, streaming is also a reliability concern.&lt;/p&gt;

&lt;p&gt;If a long task has no real-time feedback, the user has no idea whether the system is still alive or where it's up to. Especially for research, coding, data analysis, and lesson-plan generation, users need to see the intermediate state: retrieving, calling a tool, drafting, waiting for confirmation.&lt;/p&gt;

&lt;p&gt;The trickier piece is mid-flight user input. The Agent is still running and the user sends a new instruction — what LangChain calls a double-texting problem. It's not a small UX detail. It's an interaction protocol problem.&lt;/p&gt;

&lt;p&gt;The system has to decide: is the new input queued, or does it interrupt the current task? Is it merged into the current context, or does the task roll back and re-run? Can the user change goals mid-task, or must they wait until the current task finishes?&lt;/p&gt;

&lt;p&gt;In business systems, the right answer varies.&lt;/p&gt;

&lt;p&gt;A writing Agent can let the user adjust direction mid-task.&lt;/p&gt;

&lt;p&gt;A payments Agent cannot get casually interrupted and then continue with dangerous operations.&lt;/p&gt;

&lt;p&gt;A lesson-plan Agent might be a good fit for queueing new input onto a task list.&lt;/p&gt;

&lt;p&gt;A coding Agent might need to pause the current command and wait for the user to confirm a plan change.&lt;/p&gt;

&lt;p&gt;This is why chat experience is actually part of Runtime design.&lt;/p&gt;



&lt;h2&gt;
  
  
  9. Observability: you can't debug a business Agent with logs alone
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdp7tzg22n3jrpajznap8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdp7tzg22n3jrpajznap8.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For traditional applications, logs, metrics, and distributed tracing usually get the job done. For Agents, plain logs are often not enough.&lt;/p&gt;

&lt;p&gt;That's because Agent errors are frequently process errors: step 1 misunderstood the task, step 3 used the wrong tool, step 5 accepted low-quality retrieval, step 7 promoted an intermediate assumption into a conclusion. The final answer is wrong, but the actual cause is buried in the execution path.&lt;/p&gt;

&lt;p&gt;LangChain/LangSmith emphasize trace, time travel, and debug. A business-grade Agent needs more than call success rate — it needs to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which nodes did this task pass through?&lt;/li&gt;
&lt;li&gt;What context did each step's model call actually see?&lt;/li&gt;
&lt;li&gt;Which tools were called? With what parameters? Returning what?&lt;/li&gt;
&lt;li&gt;How did intermediate state change?&lt;/li&gt;
&lt;li&gt;At which step did a branch occur?&lt;/li&gt;
&lt;li&gt;Were middleware, approvals, retries, or fallbacks triggered?&lt;/li&gt;
&lt;li&gt;If you change the state of a particular checkpoint, do the downstream results change?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These capabilities decide whether the Agent can be continuously improved. Otherwise the team is just tweaking prompts by feel — and that isn't an engineering loop.&lt;/p&gt;

&lt;p&gt;Going further: observability also feeds eval. Traces aren't just for triage — they become evaluation samples, regression tests, cost analyses, and product insight.&lt;/p&gt;



&lt;h2&gt;
  
  
  10. An Agent Runtime should scale horizontally and control cost
&lt;/h2&gt;

&lt;p&gt;Once a business Agent goes live and starts serving users, operational concerns kick in.&lt;/p&gt;

&lt;p&gt;Some tasks are short, some are long. Some only read data; some call slow tools. Some users send messages back-to-back; some tasks fire on a schedule. Model calls are expensive; tool calls can be expensive too. Once long tasks pile up, the API server, queue workers, Redis, Postgres, and external tools all become bottlenecks.&lt;/p&gt;

&lt;p&gt;Several things in LangChain Agent Server are worth learning from:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Separate the API server from queue workers.&lt;/strong&gt; The former accepts requests; the latter executes long-running tasks. This stops long tasks from dragging down the entry service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer ephemeral state and durable state.&lt;/strong&gt; Transient runtime state can live in something like Redis; threads, runs, checkpoints, and memory go into durable storage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concurrency is configurable.&lt;/strong&gt; Different Agents have different task shapes — I/O-heavy and CPU-heavy workers need different concurrency policies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Avoid frontend polling.&lt;/strong&gt; For long tasks, join/stream beats blunt polling — both for UX and for system resource cost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Support cron.&lt;/strong&gt; Plenty of business Agents don't fire because a user clicked something; they need to run periodic checks, periodic summaries, periodic syncs, periodic content generation.&lt;/p&gt;

&lt;p&gt;A reliable business Agent Runtime has to care about both task semantics and infrastructure cost at the same time.&lt;/p&gt;



&lt;h2&gt;
  
  
  11. A Runtime design checklist
&lt;/h2&gt;

&lt;p&gt;If you're not copying LangChain wholesale but designing a runtime for your own business Agent, here's a checklist to break the capability surface into.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One: task lifecycle.&lt;/strong&gt; Do you have basic abstractions like thread, run, and step? Can a single Agent execution be tracked, canceled, paused, resumed, retried?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two: durable execution.&lt;/strong&gt; Is the key state at each step checkpointed? Where are the recovery boundaries? Which operations are replayable, which must be idempotent, which can only resume after human confirmation?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three: layered state.&lt;/strong&gt; Are short-term task state, long-term memory, and business data separated? Are there namespaces? Are cleanup, migration, and audit supported?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Four: permission model.&lt;/strong&gt; Who is the Agent acting on behalf of? Which resources can it touch? Which tools can it call? How are external system authorizations managed? Do high-risk operations require approval?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Five: tool governance.&lt;/strong&gt; Do tools have schemas, permissions, timeouts, retries, rate limits, audit logs? On failure, do you retry, fall back, skip, or interrupt?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Six: human-in-the-loop.&lt;/strong&gt; Can a run be interrupted mid-flight? Can it resume after user confirmation? Are approval content, approver identity, and approval time auditable?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Seven: interaction protocol.&lt;/strong&gt; How is streaming designed? How is mid-flight user input handled? When is queueing, rejecting, interrupting, or restarting the right answer?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Eight: observability and debugging.&lt;/strong&gt; Is there structured tracing? Can you see model calls, tool calls, state changes, and middleware triggers? Can bad cases be turned into evals?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nine: operational scaling.&lt;/strong&gt; Are the entry service and execution workers separated? How is the queue designed? Where are the storage bottlenecks? How do you rate-limit when long tasks pile up? How is cost attributed?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ten: deployment boundaries.&lt;/strong&gt; What do you self-host, and what do you delegate to a managed platform? Can data stay inside your system? Are you locking yourself too deeply into one runtime?&lt;/p&gt;



&lt;h2&gt;
  
  
  12. Closing thoughts
&lt;/h2&gt;

&lt;p&gt;Agent products aren't only chasing smarter behavior. Once they enter a business system, what matters as much is being more reliable: recoverable, isolable, approvable, traceable, scalable, cost-controllable.&lt;/p&gt;

&lt;p&gt;That's why Agent Harness and Runtime are worth seeing as separate. The Harness sets the ceiling on what an Agent can do. The Runtime sets the floor under which it can't safely go live. Without the former, the Agent isn't smart enough; without the latter, the Agent can't be launched.&lt;/p&gt;

&lt;p&gt;If we're going to build our own production-grade Agents, the Runtime should enter the architecture from day one. Even if v1 isn't a full system, the boundaries should be defined first: how is task state saved, how is user identity passed, how are tool permissions controlled, how does human approval recover, how do traces settle into evaluation data.&lt;/p&gt;

&lt;p&gt;The future of Agents isn't only stronger models — it's a more mature Runtime. Whoever can make a complex Agent's execution stable, controllable, and auditable will get closer to real business deployment.&lt;/p&gt;

&lt;p&gt;That's what I find most worth learning from LangChain's Runtime piece.&lt;/p&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;LangChain, The Runtime Behind Production Deep Agents
&lt;a href="https://www.langchain.com/blog/runtime-behind-production-deep-agents" rel="noopener noreferrer"&gt;www.langchain.com/blog/runtime-behind-production-deep-agents&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;



</description>
      <category>ai</category>
      <category>agents</category>
      <category>langchain</category>
      <category>programming</category>
    </item>
    <item>
      <title>Anthropic Managed Agents: 2026 Agent Harness Architecture for Production AI Agents</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Wed, 13 May 2026 13:29:36 +0000</pubDate>
      <link>https://dev.to/luhuidev/anthropic-managed-agents-2026-agent-harness-architecture-for-production-ai-agents-3899</link>
      <guid>https://dev.to/luhuidev/anthropic-managed-agents-2026-agent-harness-architecture-for-production-ai-agents-3899</guid>
      <description>&lt;p&gt;🙋‍&lt;br&gt;
&lt;em&gt;I’m &lt;a href="https://luhuidev.com/en" rel="noopener noreferrer"&gt;Luhui Dev&lt;/a&gt;, a developer who has been breaking down Agent engineering and exploring how AI can be applied in education.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;I focus on Agent Harness, LLM application engineering, AI for Math, and the productization of education SaaS.&lt;/em&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Anthropic's recent posts on Agent Harness are worth your time.&lt;/p&gt;

&lt;p&gt;They quietly pushed the whole field forward — from "how do I write a smarter loop" to "how do I design a runtime that survives production."&lt;/p&gt;

&lt;p&gt;This piece walks through the latest practice: Session, Harness, Sandbox, Credentials, Tool Protocol, Context Builder, Trace, Eval.&lt;/p&gt;


&lt;h2&gt;
  
  
  How the thinking shifted
&lt;/h2&gt;

&lt;p&gt;Anthropic didn't wake up one day and decide Agents needed a Runtime. The center of gravity moved a few times over the past couple of years.&lt;/p&gt;
&lt;h3&gt;
  
  
  Phase 1: Long context as the main lever
&lt;/h3&gt;

&lt;p&gt;Early Anthropic talked a lot about long context.&lt;/p&gt;

&lt;p&gt;100K, then 200K context windows showed up. Claude could read more docs, hold longer conversations, juggle more complex material. Most problems were still framed as prompt engineering — how to stuff information in, how to make the model find the right piece in a long window, how to cut down on misses.&lt;/p&gt;

&lt;p&gt;Made sense at the time. When the window suddenly gets bigger, everyone wants to throw task state, docs, and chat history into it.&lt;/p&gt;

&lt;p&gt;But real Agent work proved a simple point: &lt;strong&gt;a bigger workspace is not the same as reliable memory.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No matter how long the window is, it's still tokens the model sees in a single call. It gets expensive. It degrades. It gets compressed. It gets polluted by noise.&lt;/p&gt;


&lt;h3&gt;
  
  
  Phase 2: Splitting Agents into workflow vs autonomous loop
&lt;/h3&gt;

&lt;p&gt;By the &lt;em&gt;Building Effective AI Agents&lt;/em&gt; era, Anthropic started drawing a hard line between workflow and agent.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;workflow&lt;/strong&gt; has a defined process and controllable paths. The model makes calls at certain nodes.&lt;/p&gt;

&lt;p&gt;An &lt;strong&gt;agent&lt;/strong&gt; is an open loop. The model plans, calls tools, reads results, and keeps going on its own.&lt;/p&gt;

&lt;p&gt;This distinction matters more than people give it credit for. Most products don't need a highly autonomous Agent.&lt;/p&gt;

&lt;p&gt;Stable business processes are cheaper, more reliable, and easier to debug as workflows. Forcing an Agent in usually just turns a controllable process into an uncontrollable black box.&lt;/p&gt;

&lt;p&gt;The takeaway from this phase still holds: &lt;strong&gt;start simple. Only reach for higher autonomy when the task actually demands open-ended decisions.&lt;/strong&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Phase 3: Tools, context, and safety become the main battlefield
&lt;/h3&gt;

&lt;p&gt;After 2025, Anthropic's posts pivoted hard toward engineering details.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;think&lt;/code&gt; tool — gives space for reasoning inside complex tool calls.&lt;/p&gt;

&lt;p&gt;Multi-agent research system — parallel search and division of labor for heavy research tasks.&lt;/p&gt;

&lt;p&gt;Context engineering — selecting, compressing, trimming, and dynamically loading context.&lt;/p&gt;

&lt;p&gt;Agent Skills — procedural domain knowledge, loaded on demand.&lt;/p&gt;

&lt;p&gt;Claude Code sandboxing — drawing the line around code execution, filesystem, network, and credentials.&lt;/p&gt;

&lt;p&gt;MCP, code execution with MCP, advanced tool use — connecting tools, discovering them, and stopping tool definition bloat and intermediate-result pollution from wrecking the context.&lt;/p&gt;

&lt;p&gt;These look like scattered topics. They all point at the same thing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Once an Agent does real work, the question stops being "can the model answer" and becomes "can the system carry the model's actions."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Too many tools → context explodes.&lt;/p&gt;

&lt;p&gt;Tasks too long → chat history runs out of road.&lt;/p&gt;

&lt;p&gt;Execution too free → safety boundary collapses.&lt;/p&gt;

&lt;p&gt;Multi-Agent too eager → cost and coordination overhead pile up.&lt;/p&gt;

&lt;p&gt;Models upgrading too fast → old harness assumptions expire.&lt;/p&gt;


&lt;h3&gt;
  
  
  Phase 4: Lift the problem to the Runtime layer
&lt;/h3&gt;

&lt;p&gt;In the latest Managed Agents post, Anthropic stopped debating how to write a specific harness. They started talking about a stable interface for an &lt;strong&gt;Agent Runtime&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The system gets split into Session, Harness, Sandbox.&lt;/p&gt;

&lt;p&gt;Claude + harness = the &lt;strong&gt;brain&lt;/strong&gt;. Sandbox and execution environment = the &lt;strong&gt;hands&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Session lives outside the context window.&lt;/p&gt;

&lt;p&gt;Credentials live outside the sandbox.&lt;/p&gt;

&lt;p&gt;Execution environments are allowed to fail, get replaced, get rebuilt.&lt;/p&gt;

&lt;p&gt;That's the whole arc of Anthropic's thinking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Long context → Tool loop → Context engineering → Safe execution → Recoverable runtime
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  The core idea of Managed Agents: stable interfaces, swappable strategies
&lt;/h2&gt;

&lt;p&gt;Managed Agents boils down to one line: &lt;strong&gt;don't bolt together the things that will keep changing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Models change. Harness strategies change. Tools change. Sandbox shapes change. Context strategies change. Customer deployment environments change. Safety requirements change.&lt;/p&gt;

&lt;p&gt;Cram all of that into one container, one loop, one prompt stack — and within a year your system is a brick you can't replace.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Harnesses encode assumptions that go stale as models improve.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A harness encodes the current model's weaknesses. Model can't plan long tasks? Add a planner. Model misses checks? Add an evaluator. Model bails early when context is close to full? Add context reset. Model is shaky on tool calls? Add elaborate retry logic.&lt;/p&gt;

&lt;p&gt;These strategies work on one generation of the model. The next generation, they're dead weight.&lt;/p&gt;

&lt;p&gt;Anthropic gave a sharp example: Claude Sonnet 4.5 tended to wrap up early near the context limit, so the harness added a context reset. With Claude Opus 4.5, that behavior was gone — and the reset logic became overhead.&lt;/p&gt;

&lt;p&gt;The lesson:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't bake today's model defects into tomorrow's architecture.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The core interfaces Managed Agents pulls out look roughly like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Session: what happened during the task
Harness: what to do next
Sandbox: where actions execute
Tool interface: how actions get called
Credential boundary: whether actions are authorized
Context builder: what the model sees this turn
Trace / Eval: how the run gets reviewed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The point isn't to land an elegant fixed Agent loop.&lt;/p&gt;

&lt;p&gt;The point is: when models, tools, and execution environments change, the system can keep evolving.&lt;/p&gt;

&lt;p&gt;That's what's actually worth stealing from Managed Agents.&lt;/p&gt;



&lt;h2&gt;
  
  
  Key idea #1: Brain / Hands decoupling
&lt;/h2&gt;

&lt;p&gt;The most important cut in Managed Agents is splitting &lt;strong&gt;brain&lt;/strong&gt; from &lt;strong&gt;hands&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Brain = Claude + harness.&lt;/p&gt;

&lt;p&gt;Hands = sandbox, MCP server, external tools, devices, browser, code execution environment.&lt;/p&gt;

&lt;p&gt;The early default was putting the brain &lt;em&gt;inside&lt;/em&gt; the hands. One container running the harness, holding the session, executing tools, sitting on the filesystem — sometimes with credentials thrown in for fun.&lt;/p&gt;

&lt;p&gt;In production, this creates the classic problem: &lt;strong&gt;the container becomes a pet server.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can't toss it. Can't easily restart it. If it crashes you have to rescue it. To debug you have to SSH in.&lt;/p&gt;

&lt;p&gt;User data, execution state, tool calls, and credential boundaries all mashed together.&lt;/p&gt;

&lt;p&gt;Anthropic's later approach: let the harness leave the sandbox. The harness becomes a relatively stateless control plane. The sandbox becomes a callable, rebuildable execution resource.&lt;/p&gt;

&lt;p&gt;The two talk through a dead-simple interface:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;execute(name, input) -&amp;gt; string
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The harness doesn't need to know whether the other side is a container, a remote service, an MCP server, or some tool environment inside a customer's VPC. It calls the action. It gets the result back.&lt;/p&gt;

&lt;p&gt;What you get out of this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Sandbox dies, task doesn't die.&lt;/li&gt;
&lt;li&gt; Brain can start work, sandbox can load later.&lt;/li&gt;
&lt;li&gt; One brain, many hands.&lt;/li&gt;
&lt;/ol&gt;



&lt;h2&gt;
  
  
  Key idea #2: Session design
&lt;/h2&gt;

&lt;p&gt;The other big call in Managed Agents:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Session is not Claude's context window.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lots of Agent systems blur session, chat history, memory, and context window together. Short tasks survive that. Long tasks fall apart.&lt;/p&gt;

&lt;p&gt;The context window is just the tokens the model sees in a single inference call. It's a workspace.&lt;/p&gt;

&lt;p&gt;The session should be the durable record of what happened — closer to an &lt;strong&gt;event log&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A serious session should be capturing at least:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user_input
model_response
tool_call
tool_result
file_change
error
retry
approval
checkpoint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every time the harness calls the model, it pulls from the session and assembles a context for that turn.&lt;/p&gt;

&lt;p&gt;This separation is the whole game: &lt;strong&gt;Prompt is the workspace. Session is the ledger.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A workspace gets organized, compressed, trimmed, rearranged. A ledger stays as complete, queryable, and recoverable as you can make it. Dump all history into context and cost explodes while the model drowns in noise. Rely only on summaries and the detail you dropped becomes tomorrow's critical bug.&lt;/p&gt;

&lt;p&gt;The shape that holds up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Raw events kept long-term
        ↓
Context Builder picks dynamically
        ↓
This model call sees a high-signal context
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is also where context engineering and durable state split apart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Context engineering&lt;/strong&gt; decides what the model sees this turn.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Session event log&lt;/strong&gt; records what actually happened in the system.&lt;/p&gt;

&lt;p&gt;Long-running Agents that skip this layer pay for it later — resume, trace, eval, debug all get painful.&lt;/p&gt;



&lt;h2&gt;
  
  
  Key idea #3: Sandbox design
&lt;/h2&gt;

&lt;p&gt;Sandbox is the most underrated piece in an Agent system.&lt;/p&gt;

&lt;p&gt;Most teams start by giving the Agent a shell. It can run commands, read files, edit code. Feels like enough.&lt;/p&gt;

&lt;p&gt;Fine for demos. In production, the sandbox is your &lt;strong&gt;security boundary&lt;/strong&gt;, your &lt;strong&gt;execution boundary&lt;/strong&gt;, and a meaningful source of &lt;strong&gt;cost and latency&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;What Anthropic pushed in Claude Code sandboxing and Managed Agents:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Sandboxes isolate filesystem and network.&lt;/strong&gt; Treat model-generated code as untrusted code. The sandbox needs to limit filesystem access and limit network reach. Otherwise prompt injection can talk the Agent into reading files it shouldn't, hitting services it shouldn't, and exfiltrating the result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sandboxes shouldn't hold long-lived credentials.&lt;/strong&gt; Every GitHub token, DB key, or cloud secret sitting inside the sandbox is something an attacker can talk the Agent into leaking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sandboxes need to be rebuildable and recoverable.&lt;/strong&gt; Long-running Agents will hit failures. Bind the sandbox to a session too tightly and the failure takes the whole task down. Better: make the sandbox rebuildable, recoverable, and ideally snapshot/resume-able. This is just Brain / Hands decoupling, taken seriously.&lt;/li&gt;
&lt;/ol&gt;



&lt;h2&gt;
  
  
  TL;DR: Anthropic's 2026 Agent Harness architecture
&lt;/h2&gt;

&lt;p&gt;Stitching the whole 2026 thinking together, you get this picture:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7exbaoxd88xji2f8xazh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7exbaoxd88xji2f8xazh.png" width="800" height="601"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What matters here is the responsibility boundary for each piece.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Harness is the control plane&lt;/strong&gt; — schedules models, context, tools, strategies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Session event log is durable state&lt;/strong&gt; — not bound to any container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Context Builder&lt;/strong&gt; — assembles a high-signal context from session, memory, skills, and tool results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool Router&lt;/strong&gt; — dispatches actions to MCP, the code execution environment, the sandbox, or other hands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sandbox executes actions&lt;/strong&gt; — allowed to fail, allowed to be rebuilt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Credential Proxy / Vault holds credentials&lt;/strong&gt; — untrusted execution environments never get the raw token.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Trace / Eval&lt;/strong&gt; runs through the whole thing — so you can review, regress, and A/B harness changes.&lt;/p&gt;



&lt;h2&gt;
  
  
  Research-grade harness vs production-grade harness
&lt;/h2&gt;

&lt;p&gt;Plenty of Agent demos look great and then get clunky, expensive, and impossible to debug in production.&lt;/p&gt;

&lt;p&gt;The reason: research harness and production harness have different goals.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;research harness&lt;/strong&gt; chases capability ceiling. Burn more tokens, spawn more subagents, stack more evaluators, run another round. If the task success rate ticks up, the experiment was worth it.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;production harness&lt;/strong&gt; chases stable returns. It has to count cost, watch latency, control permissions, recover from failure, be observable, ship gradually, roll back cleanly.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;Research Harness&lt;/th&gt;
&lt;th&gt;Production Harness&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Goal&lt;/td&gt;
&lt;td&gt;Push task success ceiling&lt;/td&gt;
&lt;td&gt;Stable delivery under cost / latency / safety constraints&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State&lt;/td&gt;
&lt;td&gt;Transcript, local files, temp progress files&lt;/td&gt;
&lt;td&gt;External session log, checkpoints, event history&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context&lt;/td&gt;
&lt;td&gt;Give the model everything you can&lt;/td&gt;
&lt;td&gt;Smaller, higher-signal context set&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tools&lt;/td&gt;
&lt;td&gt;Wire up as many as possible&lt;/td&gt;
&lt;td&gt;Dynamic discovery, on-demand loading, scoped permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-Agent&lt;/td&gt;
&lt;td&gt;Try parallelism and role splits first&lt;/td&gt;
&lt;td&gt;Only on high-value, parallelizable tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safety&lt;/td&gt;
&lt;td&gt;Manual confirmation, light isolation&lt;/td&gt;
&lt;td&gt;Sandbox, proxy, vault, scoped credentials&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failure recovery&lt;/td&gt;
&lt;td&gt;Retry or human handoff&lt;/td&gt;
&lt;td&gt;Resume, replay, checkpoint, trace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Evaluation&lt;/td&gt;
&lt;td&gt;Did the final demo work&lt;/td&gt;
&lt;td&gt;Outcome eval, trace analysis, regression suite&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Iteration&lt;/td&gt;
&lt;td&gt;Add modules, add strategies, add agents&lt;/td&gt;
&lt;td&gt;Run ablations, delete the strategies that no longer pay rent&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One line from Anthropic's posts sticks: &lt;strong&gt;harness strategies get repriced every time the model upgrades.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Today's planner is helpful. Tomorrow it slows the system down. Today's evaluator catches errors. Tomorrow it just adds cost. Today's context reset is a necessary patch. Tomorrow it's dead weight.&lt;/p&gt;

&lt;p&gt;So a production harness can't only add things. It has to delete things. That's the whole point of ablations.&lt;/p&gt;

&lt;p&gt;Every model upgrade should re-test: is memory still earning its keep? Is the critic? Is tool search? Is multi-agent fanout? Is context reset?&lt;/p&gt;

&lt;p&gt;In Agent engineering, &lt;strong&gt;the ability to delete obsolete complexity is its own skill.&lt;/strong&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Closing thoughts
&lt;/h2&gt;

&lt;p&gt;Agent products will keep getting more complex. But the complexity shouldn't all live in the prompt and the loop. It belongs in the runtime:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Session: durable state
Harness: control plane
Context Builder: context scheduling
Tool Router: action dispatch
Sandbox: isolated execution
Credential Proxy: credential boundary
Trace: process record
Eval: outcome judgment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the actual foundation for Agents in production.&lt;/p&gt;

&lt;p&gt;Multi-agent setups will keep evolving. The MCP ecosystem will keep growing. Context windows will keep getting longer. Models will keep getting better at tool calls, planning, and self-repair.&lt;/p&gt;

&lt;p&gt;But none of that softens the core problem. It sharpens it: &lt;strong&gt;your system has to be able to swap out old strategies.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An Agent platform that hardcodes everything into prompts, containers, and a fixed loop gets harder to maintain every quarter.&lt;/p&gt;

&lt;p&gt;A system that draws clear boundaries between state, execution, credentials, context, and evaluation — that's the one that gets to evolve alongside the model.&lt;/p&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Anthropic, Scaling Managed Agents: Decoupling the brain from the hands
&lt;a href="https://www.anthropic.com/engineering/managed-agents" rel="noopener noreferrer"&gt;www.anthropic.com/engineering/managed-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anthropic, Harness design for long-running application development
&lt;a href="https://www.anthropic.com/engineering/harness-design-long-running-apps" rel="noopener noreferrer"&gt;www.anthropic.com/engineering/harness-design-long-running-apps&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anthropic, Effective harnesses for long-running agents
&lt;a href="https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents" rel="noopener noreferrer"&gt;www.anthropic.com/engineering/effective-harnesses-for-long-running-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anthropic, Effective context engineering for AI agents
&lt;a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents" rel="noopener noreferrer"&gt;www.anthropic.com/engineering/effective-context-engineering-for-ai-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anthropic, Making Claude Code more secure and autonomous with sandboxing
&lt;a href="https://www.anthropic.com/engineering/claude-code-sandboxing" rel="noopener noreferrer"&gt;www.anthropic.com/engineering/claude-code-sandboxing&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anthropic, Code execution with MCP: building more efficient AI agents
&lt;a href="https://www.anthropic.com/engineering/code-execution-with-mcp" rel="noopener noreferrer"&gt;www.anthropic.com/engineering/code-execution-with-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anthropic, Introducing advanced tool use on the Claude Developer Platform
&lt;a href="https://www.anthropic.com/engineering/advanced-tool-use" rel="noopener noreferrer"&gt;www.anthropic.com/engineering/advanced-tool-use&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anthropic, Equipping agents for the real world with Agent Skills
&lt;a href="https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills" rel="noopener noreferrer"&gt;www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Anthropic, Building Effective AI Agents
&lt;a href="https://www.anthropic.com/engineering/building-effective-agents" rel="noopener noreferrer"&gt;www.anthropic.com/engineering/building-effective-agents&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>luhuidev</category>
      <category>claude</category>
      <category>agents</category>
    </item>
    <item>
      <title>Dino-GSP Major Update: Algeo SDK 2.0 embedded editing mode is now available</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Sun, 10 May 2026 15:16:35 +0000</pubDate>
      <link>https://dev.to/luhuidev/dino-gsp-major-update-algeo-sdk-20-embedded-editing-mode-is-now-available-5ea</link>
      <guid>https://dev.to/luhuidev/dino-gsp-major-update-algeo-sdk-20-embedded-editing-mode-is-now-available-5ea</guid>
      <description>&lt;p&gt;Videos can be embedded. Documents can be embedded. Spreadsheets can be embedded.&lt;/p&gt;

&lt;p&gt;But what about &lt;strong&gt;geometry&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;For the past decade, whenever a product needed users to draw a geometry problem, edit a dynamic figure, or save an interactive geometry asset, the workflow usually broke in the same place: leave the product, use a separate tool, take a screenshot, and paste it back. That fractured workflow has sat in the middle of education platforms, teaching research systems, and AI math products for years.&lt;/p&gt;

&lt;p&gt;Today, &lt;strong&gt;&lt;a href="https://open.dajiaoai.com/?utm_source=luhuidev" rel="noopener noreferrer"&gt;Algeo SDK 2.0 embedded editing mode&lt;/a&gt;&lt;/strong&gt; is officially available. Geometry is no longer the missing embeddable format. It can now live inside your product like a standard component, with data flowing back into your business system, UI matching your product design, and permissions staying under your own control.&lt;/p&gt;

&lt;p&gt;Here are five common scenarios we see. If any of them sounds like your product, this release is worth a closer look.&lt;/p&gt;



&lt;h2&gt;
  
  
  Scenario 1: online education platforms can let teachers create geometry problems in place
&lt;/h2&gt;

&lt;p&gt;A high school math teacher is preparing tomorrow's geometry lesson on your platform. She needs an example problem about angle proofs in a circle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before&lt;/strong&gt;: she opened a separate geometry tool, finished the diagram, took a screenshot, and pasted it back into your question bank. The text lived in one place and the image in another. Students saw a static picture that could not be dragged, edited, or reused after the test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now&lt;/strong&gt;: she clicks "insert geometry board" in your question bank admin, and the Algeo editor opens in place. Circles, points, and auxiliary lines are created in the same workflow. When she saves, the board data enters your question bank and is bound to her account, school, and textbook chapter.&lt;/p&gt;

&lt;p&gt;When students open the problem, they can drag a point on the circle and see the angle change directly. Throughout the whole process, &lt;strong&gt;your product stays in control&lt;/strong&gt;: the data is yours, the permissions are yours, the content rights are yours, and the user behavior logs are yours.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsp1wgfvlw7awtf2fh0w7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsp1wgfvlw7awtf2fh0w7.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1p8ejnf8rbpuzqmv26zk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1p8ejnf8rbpuzqmv26zk.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Scenario 2: AI math products can let AI and students work on the same board
&lt;/h2&gt;

&lt;p&gt;This is one of the fastest-growing customer categories we have seen over the past year.&lt;/p&gt;

&lt;p&gt;A student uploads a photo of a geometry problem. Your AI parses the problem and generates a solution path. But text alone is not enough. The student needs to &lt;strong&gt;see&lt;/strong&gt; why an auxiliary line is drawn that way, and needs to &lt;strong&gt;test by hand&lt;/strong&gt; whether an equality still holds when a point starts moving.&lt;/p&gt;

&lt;p&gt;Algeo embedded editing closes that loop for the first time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After AI parsing, code can generate board content and load it into the editor automatically&lt;/li&gt;
&lt;li&gt;Students interact directly inside your product by dragging, modifying, and trying alternatives&lt;/li&gt;
&lt;li&gt;Every student edit can be sent back to your system as an event and used in the next AI analysis round&lt;/li&gt;
&lt;li&gt;AI can respond to the student's specific change instead of giving generic explanation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Education is a &lt;strong&gt;feedback loop&lt;/strong&gt;. Text plus static diagrams can no longer carry that loop for geometry. The missing piece is a board that can be driven by code while still giving students hands-on control.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6n0vfy5i3xm1pkzdo45.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6n0vfy5i3xm1pkzdo45.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9n4as04z8m2r7oainni.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9n4as04z8m2r7oainni.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Scenario 3: educational publishing can turn geometry assets into a managed production workflow
&lt;/h2&gt;

&lt;p&gt;In many publishing workflows, geometry illustrations used to operate like a separate workshop: an author drew the figure, a designer remade it as vector art, an editor reviewed it, and a layout designer processed it again. One geometry asset for one problem could pass through four tools and five people.&lt;/p&gt;

&lt;p&gt;After embedding Algeo into a content management system, that pipeline becomes much flatter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authors write problems and draw figures directly in the CMS, with assets stored as structured geometry data rather than images&lt;/li&gt;
&lt;li&gt;Editors can open the original board and revise it directly instead of asking the author to recreate it&lt;/li&gt;
&lt;li&gt;The same geometry data can export to PDF, web, print, and interactive courseware: &lt;strong&gt;draw once, reuse everywhere&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Version control stays inside the CMS, so geometry boards stop being external unmanaged files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For content organizations, this is not just about saving one tool. It is about turning geometry into a managed asset.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7rolxl07hg2z4c4qr9d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7rolxl07hg2z4c4qr9d.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2lwbdb4kx9f6c1u1r0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2lwbdb4kx9f6c1u1r0u.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Scenario 4: schools and institutions can finally build a shared geometry asset library
&lt;/h2&gt;

&lt;p&gt;Teaching research has an old pain point: Chinese language groups have material libraries, English groups have corpora, math teams have question banks, but &lt;strong&gt;geometry&lt;/strong&gt; often remains scattered. Every teacher has dozens of local geometry source files. They leave with the teacher, disappear with an old computer, and are hard for new teachers to inherit.&lt;/p&gt;

&lt;p&gt;When an institution embeds Algeo into its collaborative teaching research platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Geometry assets enter the institutional asset library and can be organized by subject, grade, and knowledge point&lt;/li&gt;
&lt;li&gt;Teachers can remix the same board while keeping a complete revision history&lt;/li&gt;
&lt;li&gt;New teachers can receive accumulated geometry resources on day one&lt;/li&gt;
&lt;li&gt;Permissions and approvals follow the institution's own rules, including what can be shared broadly and what stays inside a subject group&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftcaswwaxh7qygkxiadtu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftcaswwaxh7qygkxiadtu.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Scenario 5: question banks and homework systems can make geometry a first-class format
&lt;/h2&gt;

&lt;p&gt;Many question bank systems have structured templates for multiple choice, fill-in-the-blank, and written-response questions. &lt;strong&gt;Geometry is often still just an image&lt;/strong&gt;. That creates three limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Similar-question recommendation is weak because the system cannot tell whether two geometry problems share the same mathematical structure&lt;/li&gt;
&lt;li&gt;Fine-grained grading is hard because the student's answer often comes back as another image&lt;/li&gt;
&lt;li&gt;Learning analytics are shallow because the system cannot see which construction step caused the student to get stuck&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once Algeo turns geometry problems into structured data, these workflows become possible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Both the problem and the solving process are structured, so the question bank can handle geometry more like algebra&lt;/li&gt;
&lt;li&gt;Every student operation can be reported back, allowing the grading system to locate which point was moved at which step&lt;/li&gt;
&lt;li&gt;Learning analytics can tell a teacher that 70% of a class did not think to draw a specific auxiliary line&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsau5z1jvpun8dkvr9b99.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsau5z1jvpun8dkvr9b99.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  What is ready at the technical level
&lt;/h2&gt;

&lt;p&gt;The scenarios are compelling, but production adoption is always an engineering problem. Algeo SDK 2.0 is designed to be production-ready in several core areas.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bidirectional communication with clear data ownership
&lt;/h3&gt;

&lt;p&gt;Every edit, board switch, and save request can be sent back to the host application through &lt;code&gt;postMessage&lt;/code&gt;. &lt;strong&gt;You control the save button&lt;/strong&gt;. The iframe does not bypass your business system to persist anything directly. When to save, where to save, and which permissions are required are all decided by your backend. The SDK only maintains the UI state for saved and unsaved changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fully configurable UI that fits into your product
&lt;/h3&gt;

&lt;p&gt;The navigation bar, board list, toolbox, algebra panel, and document panel can each be toggled independently at runtime. In an AI-assisted scenario, the editor can be reduced to a clean canvas. In a professional authoring scenario, the full toolchain can be shown. In advanced integrations, you can even &lt;strong&gt;replace our board list with your own UI&lt;/strong&gt; and drive it through the SDK capability APIs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Engineered capability layers
&lt;/h3&gt;

&lt;p&gt;The SDK separates editor capabilities into four clear units: board file document, multi-board slides, history, and display mode. Each unit can be called independently, which also gives us room to improve each one over time without breaking the others.&lt;/p&gt;

&lt;h3&gt;
  
  
  Versioned protocol for long-term evolution
&lt;/h3&gt;

&lt;p&gt;Every handshake between the SDK and iframe carries a protocol version. That means an integration you build today can continue to work after future upgrades, while still allowing us to deliver new capabilities without asking you to rewrite the integration every time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Production-oriented robustness
&lt;/h3&gt;

&lt;p&gt;The SDK includes a 30-second initialization timeout, standardized error codes, a clean destroy lifecycle, and self-hosted base URL support through &lt;code&gt;baseUrl&lt;/code&gt;. These details matter when a real product faces network jitter, CSP rules, and complex route changes in single-page applications. We have already validated the approach in multiple production customer environments.&lt;/p&gt;



&lt;h2&gt;
  
  
  Why choose Dino-GSP and Algeo
&lt;/h2&gt;

&lt;p&gt;There are very few teams in China that can build a &lt;strong&gt;dynamic geometry&lt;/strong&gt; editor at this level. We spent a year making it production-ready, then another release cycle turning it from a product into a component. Geometry as a category really opens up only when it can be installed inside any product.&lt;/p&gt;

&lt;p&gt;If your product contains the word "geometry", whether in K12, higher education, AI math, educational publishing, or teaching research, we would be glad to talk.&lt;/p&gt;

&lt;p&gt;Docs: &lt;a href="https://open.dajiaoai.com/?utm_source=luhuidev" rel="noopener noreferrer"&gt;open.dajiaoai.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/dajiaoai/algeo-sdk" rel="noopener noreferrer"&gt;github.com/dajiaoai/algeo-sdk&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Put a geometry board inside your product, starting today.&lt;/p&gt;

</description>
      <category>luhuidev</category>
      <category>aitools</category>
    </item>
    <item>
      <title>AHE Deep Dive: How Coding Agent Harnesses Automatically Evolve</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Mon, 04 May 2026 15:02:16 +0000</pubDate>
      <link>https://dev.to/luhuidev/ahe-deep-dive-how-coding-agent-harnesses-automatically-evolve-2him</link>
      <guid>https://dev.to/luhuidev/ahe-deep-dive-how-coding-agent-harnesses-automatically-evolve-2him</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When building a coding agent, the capability of your base model is only part of the equation. In real production scenarios, what matters just as much is the &lt;strong&gt;harness&lt;/strong&gt; wrapped around that model — the prompt, tools, middleware, memory, execution environment, trace, and evaluation pipeline.&lt;/p&gt;

&lt;p&gt;This is exactly what the AHE paper addresses: &lt;strong&gt;how to make a coding agent's harness continuously observable, modifiable, testable, rollback-able, and even self-iterating — just like software engineering.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The full paper title is &lt;strong&gt;"Agentic Harness Engineering: Observability-Driven Automatic Evolution of Coding-Agent Harnesses"&lt;/strong&gt;, authored by researchers from Fudan University, Peking University, and Shanghai Qiji Zhifeng Co., Ltd. The academic teams bring methodological design, while the industry team contributes experience from Agent/LLM infrastructure and Nex AGI systems.&lt;/p&gt;

&lt;p&gt;Even better, AHE is open source: &lt;code&gt;china-qijizhifeng/agentic-harness-engineering&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This makes it more than just a paper concept — you can directly examine the seed coding agent, evolve agent, experiment configs, traces, manifests, and rollback structures. For anyone building coding agents, agent infrastructure, or broader agent products, this repository is worth dissecting.&lt;/p&gt;

&lt;p&gt;This article explores three questions: why AHE works, how it evolves harnesses, and how to start your own small experiment with the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 1: A Quick Intro to Harness Engineering
&lt;/h2&gt;

&lt;p&gt;A harness is the external engineering shell that makes a model actually work. In a coding agent, it typically includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;System prompt&lt;/strong&gt;: defines the agent's basic working mode&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tools&lt;/strong&gt;: file I/O, shell, search, test execution, code modification, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tool descriptions&lt;/strong&gt;: what the model sees about tool usage and parameter schemas&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Middleware&lt;/strong&gt;: interception, validation, correction, and logging before/after tool calls&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Memory&lt;/strong&gt;: short-term, long-term, and experience accumulation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Context management&lt;/strong&gt;: compression, pruning, and retrieval&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Execution environment&lt;/strong&gt;: sandbox, permissions, runtime isolation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Evaluation/observability&lt;/strong&gt;: testing, trace, logs, rewards, failure reports, regression tracking&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure determines how the model approaches tasks, invokes tools, handles failures, and judges completion.&lt;/p&gt;

&lt;p&gt;For example, when a shell command hangs in production, the solution isn't to keep adding "don't use interactive commands" to the prompt. A more robust approach: add timeout to the shell tool, use middleware to detect high-risk commands, truncate long outputs at the response layer, and enforce state checks before task completion.&lt;/p&gt;

&lt;p&gt;This is the essence of Harness Engineering: putting agent capabilities into a maintainable runtime system.&lt;/p&gt;

&lt;p&gt;I won't dive deeper into the Harness concept here. If you want to learn more, search for keywords like: Harness Engineering, Agent Harness, Agent Runtime, Tool-use Agent, Agent Observability, Agent Evaluation, Coding Agent Infrastructure.&lt;/p&gt;

&lt;p&gt;Let's move to the main focus of this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 2: AHE's Core Positioning — Self-Iterating Coding Agent Harnesses
&lt;/h2&gt;

&lt;p&gt;AHE stands for &lt;strong&gt;Agentic Harness Engineering&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The paper's subtitle contains the key phrase: &lt;strong&gt;Observability-Driven Automatic Evolution of Coding-Agent Harnesses&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This breaks down into three layers:&lt;/p&gt;

&lt;p&gt;First, AHE targets &lt;strong&gt;coding agent harnesses&lt;/strong&gt;. It doesn't train new models or modify base model parameters.&lt;/p&gt;

&lt;p&gt;Second, it performs &lt;strong&gt;automatic evolution&lt;/strong&gt;. The goal isn't a one-time manual prompt tweak, but continuous harness evolution across multiple runs.&lt;/p&gt;

&lt;p&gt;Third, it relies on &lt;strong&gt;observability&lt;/strong&gt;. Changes come from traces, logs, rewards, failure analysis, change manifests — not from vague "self-reflection" in a prompt.&lt;/p&gt;

&lt;p&gt;So AHE's precise positioning is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An automatic evolution framework for coding agent harnesses. Through observable runtime evidence, it continuously improves the agent's surrounding prompt, tools, middleware, memory, skills, and sub-agents.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the key difference from ordinary prompt optimization. AHE does modify prompts, but its &lt;strong&gt;action space is much larger — it includes tools, middleware, and memory as evolvable structures&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 3: AHE's Experimental Results
&lt;/h2&gt;

&lt;p&gt;AHE's main experiments ran on Terminal-Bench 2. The paper reports that after 10 iterations, AHE improved the seed harness's pass @1 from &lt;strong&gt;69.7% to 77.0%&lt;/strong&gt;. This shows that on the target benchmark, AHE found effective harness modifications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F0094abe827f1daff598a8586b8943a64be147b4e8c28a826975e7d62ad5546ef" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F0094abe827f1daff598a8586b8943a64be147b4e8c28a826975e7d62ad5546ef" alt="Results Chart" width="1502" height="725"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The ablation study is even more revealing. The paper replaced different components in full AHE back to the seed harness individually, with roughly these results:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fdbc78ed72f2d6e8a0f5afbcb56b474840216fad514f863392b1360362d1ace1d" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fdbc78ed72f2d6e8a0f5afbcb56b474840216fad514f863392b1360362d1ace1d" alt="Ablation Study" width="908" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This result is highly informative.&lt;/p&gt;

&lt;p&gt;If gains mainly came from better system prompts, prompt-only should improve. But in the experiment, prompt-only actually decreased, while memory, tools, and middleware showed more significant improvements.&lt;/p&gt;

&lt;p&gt;This means AHE's key benefits come from structural harness modifications. It also suggests that in complex tasks, many agent failures require harder (more engineering-focused) mechanisms: tool behavior, runtime interception, state recording, long-term experience, regression testing.&lt;/p&gt;

&lt;p&gt;The paper also conducted transfer experiments. When the evolved harness transferred to SWE-bench-verified, success rate gains were small, but token usage dropped more noticeably. This suggests AHE's evolved structures may be better at reducing ineffective exploration and context waste.&lt;/p&gt;

&lt;p&gt;Cross-model transfer is also noteworthy. When AHE-generated harnesses were applied to multiple base models, the paper reports positive gains across the board. This indicates the learned components contain some transferable engineering structures.&lt;/p&gt;

&lt;p&gt;My assessment: AHE's prediction of "which changes will fix problems" is significantly better than random, but its prediction of "which changes will cause regressions" is still relatively weak. It does prove that harnesses can be continuously evolved in a file-based, evidence-based, version-controlled manner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 4: AHE's Key Workflow — Evaluate, Diagnose, Modify, Verify, Rollback
&lt;/h2&gt;

&lt;p&gt;AHE's main loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;graph TD
    A[Current Harness] --&amp;gt; B[Run Code Agent on benchmark]
    B --&amp;gt; C[Collect trace, log, reward]
    C --&amp;gt; D[Analyze failure patterns]
    D --&amp;gt; E[Evolve Agent modifies Harness files]
    E --&amp;gt; F[Write change_manifest]
    F --&amp;gt; G[Re-evaluate next round]
    G --&amp;gt; H[Verify if changes work, rollback if needed]
    H -.-&amp;gt; A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This closed loop has three main actors.&lt;/p&gt;

&lt;p&gt;First is the &lt;strong&gt;Code Agent&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is the actual agent completing coding tasks, and the object being optimized. In the AHE repository, the seed agent is quite simple — basically a bash-only coding agent.&lt;/p&gt;

&lt;p&gt;Second is the &lt;strong&gt;Agent Debugger&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It reads the Code Agent's execution traces and compresses massive traces into readable failure reports. After a benchmark run, raw traces can be extremely long, making direct model reading too costly. Agent Debugger converts these traces into overviews and per-task analyses, providing evidence for subsequent modifications.&lt;/p&gt;

&lt;p&gt;Third is the &lt;strong&gt;Evolve Agent&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It reads the previous round's results, failure analysis, and historical modification records, then modifies harness files in the workspace. Its modification targets include prompts, tools, middleware, memory, skills, sub-agent configs, etc.&lt;/p&gt;

&lt;p&gt;AHE adds strong engineering constraints to this process:&lt;/p&gt;

&lt;p&gt;Every modification must land in files. Every modification requires a manifest. The next round must verify predictions in the manifest. Poor results must be rollback-able. The entire process should leave an auditable evidence chain.&lt;/p&gt;

&lt;p&gt;The self-reflection agent must answer more specific questions: which file was changed, why, which tasks are expected to be fixed, which tasks might be harmed, and whether the next round's results validate this judgment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 5: What Evolvable Components Does AHE Break the Harness Into?
&lt;/h2&gt;

&lt;p&gt;AHE's first step is breaking the harness into explicit components.&lt;/p&gt;

&lt;p&gt;The paper emphasizes several evolvable object types:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System Prompt&lt;/strong&gt;: Defines the Code Agent's basic behavior, like executing shell non-interactively, checking state before task completion, not exiting prematurely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool Descriptions&lt;/strong&gt;: What the model sees about tools. The tool itself might not change, but if the description changes, so does how the model calls it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool Implementations&lt;/strong&gt;: The actual tool implementation. For example, how the shell tool executes commands, handles timeouts, truncates output, returns error messages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Middleware&lt;/strong&gt;: Runtime interception layer. It can check before/after tool calls, like detecting dangerous commands, reminding about unverified tasks, blocking premature endings, recording risk states.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skills&lt;/strong&gt;: Reusable experience. Think of these as operation manuals for certain task patterns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sub-agents&lt;/strong&gt;: Sub-agent configurations. Complex tasks can be split to different roles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Long-term Memory&lt;/strong&gt;: For accumulating experience across tasks and rounds.&lt;/p&gt;

&lt;p&gt;This decomposition gives the Evolve Agent a richer action space. It can choose the right place to intervene based on failure evidence.&lt;/p&gt;

&lt;p&gt;Example: Code Agent keeps hanging in shell. The least efficient approach is adding more prompt reminders. AHE's path is more engineering-focused: add timeout to shell tool; middleware checks for obviously interactive commands; return messages explicitly state failure reasons; system prompt adds behavioral constraints.&lt;/p&gt;

&lt;p&gt;These structural modifications are more stable and easier to reuse and rollback.&lt;/p&gt;

&lt;p&gt;The key is understanding the positioning: &lt;strong&gt;prompts are behavioral suggestions; tools, middleware, and memory are execution mechanisms.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AHE's value lies in bringing these execution mechanisms into the evolution scope.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 6: Three Layers of Observability — How AHE Avoids Blind Search
&lt;/h2&gt;

&lt;p&gt;Just having an agent randomly modify files and rerun benchmarks has limited value. AHE's core design is three layers of observability.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Component Observability
&lt;/h3&gt;

&lt;p&gt;Component observability means the system knows what parts the harness has, where each part is, how to modify it, and how to register it.&lt;/p&gt;

&lt;p&gt;In the AHE repository, prompts, tool descriptions, tool implementations, middleware, memory, etc., all appear as files. New tools need YAML descriptions and Python implementations, plus config registration; new middleware needs explicit integration; new skills or sub-agents also need config exposure.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Experience Observability
&lt;/h3&gt;

&lt;p&gt;Experience observability means after an agent runs, the system records how it succeeded or failed.&lt;/p&gt;

&lt;p&gt;AHE collects each task's trace, runtime log, reward, etc. Then Agent Debugger compresses these raw traces into analysis reports.&lt;/p&gt;

&lt;p&gt;When a coding agent fails, simply knowing "it failed" isn't very useful. What you really need to locate is the failure level: command execution failure, dependency installation failure, test not run, file path error, output too long causing context pollution, agent prematurely judging task complete, losing previous state in long tasks.&lt;/p&gt;

&lt;p&gt;Through traces and analysis, AHE turns failures into readable, summarizable, actionable evidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Decision Observability
&lt;/h3&gt;

&lt;p&gt;After each modification, the Evolve Agent must write a &lt;code&gt;change_manifest.json&lt;/code&gt;. This manifest records which files were changed, what failure pattern they address, why this component was chosen, which tasks are expected to be fixed, which might regress, and the modification's constraint strength.&lt;/p&gt;

&lt;p&gt;After the next evaluation round, the system checks this manifest to see if predictions came true.&lt;/p&gt;

&lt;p&gt;This step turns every modification into a verifiable hypothesis. Even without using AHE's full automatic evolution pipeline, just introducing the change manifest habit into your own agent team will immediately improve engineering transparency.&lt;/p&gt;

&lt;p&gt;Many agent projects struggle with long-term maintenance precisely because of this: lots of prompt changes, lots of tool adjustments, but nobody knows what each change actually solved, and nobody knows if it introduced new problems. AHE's manifest mechanism at least makes this process auditable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 7: AHE's Engineering Organization from the Repository
&lt;/h2&gt;

&lt;p&gt;The main entry point for the AHE repository is &lt;code&gt;evolve.py&lt;/code&gt;. It orchestrates the entire evolution workflow, including initializing workspace, running evaluations, handling iteration directories, doing attribution, recovery, and rollback.&lt;/p&gt;

&lt;p&gt;The seed agent being evolved is &lt;code&gt;agents/code_agent_simple/&lt;/code&gt;, which includes:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;code_agent.yaml&lt;/code&gt; describes how this agent loads prompts, which tools it uses, what tracer to use.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;systemprompt.md&lt;/code&gt; is the initial system prompt.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;LongTermMEMORY.md&lt;/code&gt; and &lt;code&gt;ShortTermMEMORY.md&lt;/code&gt; correspond to long-term and short-term memory interfaces. &lt;code&gt;tool_descriptions/&lt;/code&gt; holds tool descriptions, &lt;code&gt;tools/&lt;/code&gt; holds tool implementations.&lt;/p&gt;

&lt;p&gt;The Evolve Agent is in &lt;code&gt;agents/evolve_agent/&lt;/code&gt;. Key files worth examining:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;evolve_agent.yaml&lt;/code&gt; defines what tools, middleware, and skills the Evolve Agent itself can use.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;evolve_prompt.md&lt;/code&gt; is an evolution contract: it specifies that Evolve Agent can only modify workspace, must make evidence-based changes, must write summaries and manifests, must follow registration rules.&lt;/p&gt;

&lt;p&gt;Config files are in &lt;code&gt;configs/&lt;/code&gt; and &lt;code&gt;configs/experiments/&lt;/code&gt;. &lt;code&gt;configs/base.yaml&lt;/code&gt; is the base config, &lt;code&gt;configs/experiments/exp-simple-code-gpt54.yaml&lt;/code&gt; is a config overlay close to the paper experiments.&lt;/p&gt;

&lt;p&gt;Launch scripts are in &lt;code&gt;scripts/&lt;/code&gt;, like &lt;code&gt;scripts/evolve.sh&lt;/code&gt; for starting long experiments, &lt;code&gt;scripts/build_templates.py&lt;/code&gt; for building task templates for E2B.&lt;/p&gt;

&lt;p&gt;If you just want to understand the project, you don't need to read all files at once. I recommend this reading order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;README
  ↓
agents/code_agent_simple/code_agent.yaml
  ↓
agents/code_agent_simple/systemprompt.md
  ↓
agents/evolve_agent/evolve_prompt.md
  ↓
configs/base.yaml
  ↓
configs/experiments/exp-simple-code-gpt54.yaml
  ↓
evolve.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sequence helps you build concepts first, then see execution details.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 8: Getting Started with the Repository — Run a Small Experiment First
&lt;/h2&gt;

&lt;p&gt;AHE is not a lightweight SDK. You can't expect to &lt;code&gt;pip install&lt;/code&gt; and immediately embed it in production systems.&lt;/p&gt;

&lt;p&gt;It's more like a research experiment framework. Running full paper-level experiments requires LLM API, E2B sandbox, SERPER API, benchmark data, concurrent scheduling, and considerable token costs.&lt;/p&gt;

&lt;p&gt;So a more realistic onboarding approach is to run a minimal closed loop first.&lt;/p&gt;

&lt;p&gt;Set the goal as: get AHE's core pipeline running.&lt;/p&gt;

&lt;p&gt;That is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;graph LR
    A[Task execution] --&amp;gt; B[Trace generation]
    B --&amp;gt; C[Analysis generation]
    C --&amp;gt; D[change_manifest written]
    D --&amp;gt; E[Next round re-evaluation]
    E --&amp;gt; F[change_evaluation&amp;lt;br&amp;gt;judges modification effect]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once this pipeline works, you understand AHE's practical value.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Clone the Repository
&lt;/h3&gt;

&lt;p&gt;Official repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/china-qijizhifeng/agentic-harness-engineering.git
cd agentic-harness-engineering
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Install Dependencies
&lt;/h3&gt;

&lt;p&gt;The project uses &lt;code&gt;uv&lt;/code&gt; to manage Python dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv sync
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Configure Environment Variables
&lt;/h3&gt;

&lt;p&gt;Copy the environment variable template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp .env.example .env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At minimum, pay attention to these variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LLM_API_KEY
LLM_BASE_URL
E2B_API_KEY
SERPER_API_KEY
GITHUB_TOKEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Agent Debugger can also configure model endpoints separately. Refer to &lt;code&gt;.env.example&lt;/code&gt; for specifics.&lt;/p&gt;

&lt;p&gt;One important note: AHE's task execution depends on E2B sandbox. Much code execution happens in isolated remote environments. This helps with security and reproducibility, but also means you need an E2B account and credits.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Prepare Benchmark Task Templates
&lt;/h3&gt;

&lt;p&gt;The official workflow requires building task templates first. Example command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv run python scripts/build_templates.py --dataset-dir /path/to/dataset -j 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;/path/to/dataset&lt;/code&gt; with your actual task data path.&lt;/p&gt;

&lt;p&gt;If you're just doing a small experiment, I don't recommend preparing full Terminal-Bench 2 at the start. Select a few tasks and get the pipeline working first — that's more important.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Start with a Small Config
&lt;/h3&gt;

&lt;p&gt;For paper experiment config, refer to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;configs/experiments/exp-simple-code-gpt54.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running the full config is quite costly. Copy a small config, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp configs/experiments/exp-simple-code-gpt54.yaml configs/experiments/exp-mini.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then reduce the parameters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;max_iterations: 2
harbor:
  k: 2
  n_concurrent: 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the config supports specifying task subsets, use only 3 to 5 tasks. The point of a small experiment is validating the workflow, not chasing scores.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Launch the Evolution Experiment
&lt;/h3&gt;

&lt;p&gt;You can use the script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./scripts/evolve.sh configs/experiments/exp-mini.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or look inside the script to see how it calls &lt;code&gt;evolve.py&lt;/code&gt;, then manually launch as needed.&lt;/p&gt;

&lt;p&gt;Full experiments can run for a long time. Even small experiments require attention to API costs, E2B concurrency limits, and network stability.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Look at Experiment Artifacts, Not Just Scores
&lt;/h3&gt;

&lt;p&gt;After running, don't just look at pass rate.&lt;/p&gt;

&lt;p&gt;What's more worth examining are these artifacts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;runs/iteration_*/
analysis/overview.md
analysis/detail/*.md
change_manifest.json
change_evaluation.json
agent/nexau_in_memory_tracer.cleaned.json
verifier/reward.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running, focus on observing and answering these questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What patterns were this round's failures attributed to?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Which files did Evolve Agent change?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Why did it choose to change these files?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Which tasks does the manifest predict will be fixed?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Did the next round verify this prediction?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Were there cases where fixing one task broke another?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you can find answers to all these questions in the artifacts, it means AHE's core closed loop is working.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 9: What AHE Hasn't Solved Yet
&lt;/h2&gt;

&lt;p&gt;AHE is valuable, but its boundaries should be clear too.&lt;/p&gt;

&lt;p&gt;First, it's still a research framework. Full runs aren't cheap, requiring benchmarks, sandboxes, LLM APIs, and fairly complex experiment configs.&lt;/p&gt;

&lt;p&gt;Second, the effectiveness evidence in the paper needs more replication experiments. The improvement on Terminal-Bench 2 is clear, but for strong statistical conclusions, more seeds, more campaigns, and more confidence intervals are needed.&lt;/p&gt;

&lt;p&gt;Third, its prediction of regression risk isn't strong enough. The system is better at explaining what a modification might fix, but not as good at judging what it might harm. This is a hard problem for automatic evolution systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 10: AHE's Inspiration for Agent Product Teams
&lt;/h2&gt;

&lt;p&gt;AHE's biggest inspiration for product-focused agent teams is pulling agent improvement processes from "mystical prompt tuning" back into the engineering world.&lt;/p&gt;

&lt;p&gt;A real agent product will eventually face these questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;After a user reports an error, how do you reproduce it?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do you aggregate failure causes?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Did a certain prompt modification actually help?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Did a tool change regress other scenarios?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is there regression testing before release?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can you rollback if production performance degrades?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do you distill effective experience into memory or skills?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No single model can solve these problems for you.&lt;/p&gt;

&lt;p&gt;They belong to the scope of harness engineering work.&lt;/p&gt;

&lt;p&gt;If you're also building your own agent, this repository is worth thoroughly dissecting. Even without running it completely, you can learn a lot about harness organization, trace design, modification attribution, and regression verification engineering methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Agentic Harness Engineering: Observability-Driven Automatic Evolution of Coding-Agent Harnesses\&lt;br&gt;
arXiv: &lt;a href="https://arxiv.org/abs/2604.25850" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2604.25850&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AHE Official Code Repository\&lt;br&gt;
GitHub: &lt;a href="https://github.com/china-qijizhifeng/agentic-harness-engineering" rel="noopener noreferrer"&gt;https://github.com/china-qijizhifeng/agentic-harness-engineering&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Harness engineering: leveraging Codex in an agent-first world\&lt;br&gt;
OpenAI Engineering Blog: &lt;a href="https://openai.com/index/harness-engineering/" rel="noopener noreferrer"&gt;https://openai.com/index/harness-engineering/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🙋‍&lt;br&gt;
&lt;em&gt;I’m &lt;a href="http://luhuidev.com/" rel="noopener noreferrer"&gt;Luhui Dev&lt;/a&gt;, a developer who has been breaking down Agent engineering and exploring how AI can be applied in education.&lt;br&gt;
I focus on Agent Harness, LLM application engineering, AI for Math, and the productization of education SaaS.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>luhuidev</category>
    </item>
    <item>
      <title>Why Signatures Make Automatic Optimization Easier Than Writing Prompts Directly</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Wed, 22 Apr 2026 13:40:26 +0000</pubDate>
      <link>https://dev.to/luhuidev/why-signatures-make-automatic-optimization-easier-than-writing-prompts-directly-35k1</link>
      <guid>https://dev.to/luhuidev/why-signatures-make-automatic-optimization-easier-than-writing-prompts-directly-35k1</guid>
      <description>&lt;p&gt;A great discovery from my recent project work: &lt;strong&gt;DSPy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;While building the content generation pipeline for Canviz, I encountered a recurring engineering problem—it was extremely difficult to maintain stable "problem explanation quality + canvas script usability" through prompts alone. Whenever I switched models or added new grade levels, I had to re-tune the entire string of prompts. DSPy offered me a systematic solution that's worth sharing separately.&lt;/p&gt;



&lt;h2&gt;
  
  
  The Fundamental Contradiction of Prompt Engineering
&lt;/h2&gt;

&lt;p&gt;Before diving into DSPy, I need to clarify one thing: &lt;strong&gt;Why is writing prompts an engineering problem, not just a matter of technique?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditional prompts have a fatal design flaw: &lt;strong&gt;they mix "what I want to do" with "how to tell the model to do it."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That natural language prompt you write simultaneously handles two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Describing the task's &lt;strong&gt;logic&lt;/strong&gt; (what inputs to accept, what outputs to produce);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The "incantation" tuned for &lt;strong&gt;this specific model&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Take a math teaching scenario as an example—the logic of "explaining a chicken-and-rabbit problem" is eternal, but the incantation to make GPT explain it well versus making Claude Sonnet explain it well can be quite different. Once you switch models, or change from third grade to fifth grade, that incantation might fail. Worse yet, there's no systematic way to fix it—you can only rely on intuition and trial-and-error.&lt;/p&gt;

&lt;p&gt;This is what software engineering calls the hard-coding problem. For ordinary logic, we've long learned not to hard-code; but for AI pipelines, we willingly lock the most core logic into a fragile string.&lt;/p&gt;

&lt;p&gt;DSPy's author, Stanford's Omar Khattab, describes this problem as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Existing LM pipelines are typically implemented using hard-coded prompt templates, discovered through trial and error, and extremely brittle."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;



&lt;h2&gt;
  
  
  What is DSPy? What's Its Core Insight?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DSPy (Declarative Self-improving Python)&lt;/strong&gt; is a framework open-sourced by Stanford NLP Lab in 2023, published at ICLR 2024. Its core proposition is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Programming language models, not prompting them.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It offers an elegant solution: &lt;strong&gt;completely separate the task's interface description from the specific prompt implementation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You only need to tell DSPy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What this step inputs and outputs;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What the logical structure of the entire pipeline is;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What your evaluation criteria are.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then DSPy's &lt;strong&gt;Compiler&lt;/strong&gt; and &lt;strong&gt;Optimizer&lt;/strong&gt; will automatically find the best prompt for you—tailored to your chosen model, your data, and your metrics.&lt;/p&gt;

&lt;p&gt;To borrow the official analogy: &lt;strong&gt;This is like jumping from assembly language to high-level languages, or from writing raw SQL to using an ORM.&lt;/strong&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  Three Core Concepts to Understand DSPy's Full Picture
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Signature: Type Signature of Tasks
&lt;/h3&gt;

&lt;p&gt;Signature is DSPy's interface description. It tells the framework what this step does, not how to do it, using a type-declaration-like approach:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ExplainMathProblem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Signature&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Explain a math problem to students of a specified grade, using language appropriate to their cognitive level.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;InputField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Original text of the math problem&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;InputField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Student grade level, e.g., 3 for third grade&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;explanation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OutputField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Step-by-step explanation suitable for the grade, friendly and easy to understand&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;key_concept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OutputField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Core concept tested by this problem, explained in one sentence&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice: you haven't written any prompt at all. This only contains &lt;strong&gt;the semantics of the interface&lt;/strong&gt;, without any "you are a gentle and patient math teacher..." type of prompting.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Module: Composable Functional Units
&lt;/h3&gt;

&lt;p&gt;Module is DSPy's execution unit, inspired by PyTorch's &lt;code&gt;nn. Module&lt;/code&gt;. You can compose them like building blocks to construct a complete teaching content generation pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MathLessonPipeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Module&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="c1"&gt;# Step 1: Explain the problem
&lt;/span&gt;        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;explain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ChainOfThought&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ExplainMathProblem&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c1"&gt;# Step 2: Generate corresponding Dinogsp geometry visualization script based on explanation
&lt;/span&gt;        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;generate_diagram&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Predict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;problem, explanation -&amp;gt; dinogsp_script: str&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c1"&gt;# Step 3: Create a practice problem of the same type
&lt;/span&gt;        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;make_exercise&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Predict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;problem, key_concept, grade -&amp;gt; exercise: str, answer: str&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;forward&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="c1"&gt;# Explain
&lt;/span&gt;        &lt;span class="n"&gt;step1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;explain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;grade&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c1"&gt;# Generate diagram
&lt;/span&gt;        &lt;span class="n"&gt;step2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate_diagram&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;explanation&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;step1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;explanation&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c1"&gt;# Create practice problem
&lt;/span&gt;        &lt;span class="n"&gt;step3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;make_exercise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;key_concept&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;step1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key_concept&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;grade&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;grade&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Prediction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;explanation&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;step1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;explanation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;dinogsp_script&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;step2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dinogsp_script&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;exercise&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;step3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exercise&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;answer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;step3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;answer&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This entire three-step pipeline doesn't contain a single word of prompt—everything written is &lt;strong&gt;logic&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;DSPy includes several classic reasoning strategy modules:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Module&lt;/th&gt;
&lt;th&gt;Corresponding Reasoning Method&lt;/th&gt;
&lt;th&gt;Application in Teaching&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dspy. Predict&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Direct prediction&lt;/td&gt;
&lt;td&gt;Problem difficulty grading, concept tagging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dspy. ChainOfThought&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Chain of Thought (CoT)&lt;/td&gt;
&lt;td&gt;Step-by-step problem-solving explanation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dspy. ReAct&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reasoning-Action loop&lt;/td&gt;
&lt;td&gt;Calling external tools to validate scripts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dspy. ProgramOfThought&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Program-based thinking&lt;/td&gt;
&lt;td&gt;Generating executable math calculation code&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  3. Optimizer: Automatic Tuning Engine
&lt;/h3&gt;

&lt;p&gt;This is the most magical part of DSPy, where its truly unique value lies.&lt;/p&gt;

&lt;p&gt;You need to provide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An evaluation dataset (e.g., 100 problems, each with manually annotated good explanation samples);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An evaluation metric function (to judge whether the generated explanation is good).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then call the optimizer, which will automatically search for the optimal combination of prompt instructions and few-shot examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Define evaluation metric: whether explanation is age-appropriate, whether diagram script is parseable
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;lesson_quality_metric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prediction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;trace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;explanation_ok&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prediction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;explanation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;  &lt;span class="c1"&gt;# Basic length
&lt;/span&gt;    &lt;span class="n"&gt;script_parseable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;validate_dinogsp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prediction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dinogsp_script&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Script usability
&lt;/span&gt;    &lt;span class="n"&gt;grade_appropriate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;check_vocabulary_level&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;prediction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;explanation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;grade&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Age-appropriate vocabulary
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;explanation_ok&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;script_parseable&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;grade_appropriate&lt;/span&gt;

&lt;span class="c1"&gt;# Optimize using MIPROv2
&lt;/span&gt;&lt;span class="n"&gt;optimizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dspy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MIPROv2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;lesson_quality_metric&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;auto&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;medium&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;optimized_pipeline&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;optimizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nc"&gt;MathLessonPipeline&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="n"&gt;trainset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;annotated_lessons&lt;/span&gt;  &lt;span class="c1"&gt;# Your annotated data
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Save results, load directly in production without re-optimization
&lt;/span&gt;&lt;span class="n"&gt;optimized_pipeline&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;./optimized_math_lesson.json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A medium-level optimization costs about $10 and takes 20 minutes to run, resulting in a teaching content generation system automatically tuned for your chosen model and specified grade-level data.&lt;/p&gt;



&lt;h2&gt;
  
  
  Looking at the Data
&lt;/h2&gt;

&lt;p&gt;DSPy's official documentation provides a set of impressive data:&lt;/p&gt;

&lt;p&gt;On the HotPotQA multi-hop reasoning task (which requires combining information across documents, very similar to the logical structure of math word problems), running &lt;code&gt;dspy. ReAct&lt;/code&gt; with the &lt;code&gt;gpt mini&lt;/code&gt; series:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Before optimization: 24% accuracy&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;After MIPROv2 optimization with 500 samples: 51% accuracy&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More than doubled, not by switching to a more expensive model, but by teaching this smaller model to better complete this type of task.&lt;/p&gt;



&lt;h2&gt;
  
  
  The Essential Difference from LangChain/LlamaIndex
&lt;/h2&gt;

&lt;p&gt;You might wonder how DSPy differs from LangChain—for instance, if you're already using LangChain, do you need to switch?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LangChain / LlamaIndex&lt;/strong&gt; are tool chain orchestration frameworks. They connect components like LLMs, vector databases, and tool calls, but the prompts themselves are still strings written by humans. If you switch models, you still have to manually modify the prompts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DSPy&lt;/strong&gt; is an AI program compilation framework. It doesn't just connect components—it takes over the generation and optimization of prompts. Humans are responsible for writing the logic, while it translates that into the most effective natural language instructions for a specific model.&lt;/p&gt;

&lt;p&gt;Specifically for math teaching scenarios: if you built a "generate third-grade explanations" pipeline with LangChain, and tomorrow the product requires fifth-grade support, you need to manually go back and modify all related prompt strings—because the vocabulary and logical depth requirements for fifth grade have changed. With DSPy, you only change the input parameter &lt;code&gt;grade=5&lt;/code&gt;, then rerun compilation, and the framework will automatically adjust the internal prompting strategy.&lt;/p&gt;

&lt;p&gt;If I were to make an analogy: LangChain is an automated assembly line, DSPy is a high-level language with a JIT compiler.&lt;/p&gt;



&lt;h2&gt;
  
  
  My Developer Perspective: What It Solves, What's Still Missing
&lt;/h2&gt;

&lt;p&gt;After all these praises, I should also mention what I think it still lacks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What DSPy truly solves:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pain of model migration&lt;/strong&gt;: Switching from GPT-5.4 to the cheaper Kimi 2.5, just recompile once—no need to manually modify prompts;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-step joint optimization&lt;/strong&gt;: Explanation quality + diagram script usability—these two goals were previously hard to optimize simultaneously, but DSPy's compiler can perform global optimal search;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reproducible experiments&lt;/strong&gt;: Optimization results saved as JSON, shareable with the team, version-controlled, goodbye to "which document has that best-performing prompt we used before?"&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Current limitations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Evaluation metrics are the hard part&lt;/strong&gt;: Functions like &lt;code&gt;validate_dinogsp()&lt;/code&gt; need to be written by you, and writing them well isn't easy. DSPy's optimization effectiveness highly depends on metric quality—vague metrics lead the optimizer to game the system;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimization isn't free&lt;/strong&gt;: Medium-level optimization on 100 samples costs about $2; if you have multiple grade levels and problem types, costs will rise significantly as data volume increases;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Debugging experience is still maturing&lt;/strong&gt;: When an optimized pipeline still underperforms, it's sometimes hard to determine whether it's insufficient data, flawed metrics, or the model's inherent capability boundary.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  When Should You Use DSPy?
&lt;/h2&gt;

&lt;p&gt;If you're encountering any of the following situations, it's worth seriously considering DSPy:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ Very suitable:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You're building multi-step LLM pipelines (explanation + diagram + practice problems is exactly this structure)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You need to switch between different models (cost control, or selecting different capability models by age group)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You have an evaluation dataset and want quantifiable improvement in effectiveness&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You're tired of modifying prompts by feel and want a systematic optimization method&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your application needs long-term maintenance in production&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;⚠️ Not quite suitable:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Just quickly validating an idea, no need for long-term maintenance&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The task has no clear evaluation metrics, leaving the optimizer with nothing to work with&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I think DSPy's approach is good because it proposes &lt;strong&gt;a more engineering-reliable way of thinking&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Prompts in AI pipelines are essentially &lt;strong&gt;parameters&lt;/strong&gt; of the program, not the program's &lt;strong&gt;source code&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Just as I wouldn't hard-code neural network weights into source code, I shouldn't treat prompts tuned for a specific model as the program logic itself. These weights should be systematically learnable, optimizable, savable, and transferable.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;logic&lt;/strong&gt; of teaching content is stable—step-by-step, illustrated, age-appropriate expression; but &lt;strong&gt;how to guide the model to achieve all this&lt;/strong&gt; will constantly change with model updates, grade expansions, and problem type additions. Using DSPy to separate the two enables a truly maintainable AI teaching system.&lt;/p&gt;



&lt;p&gt;🙋‍♀️ &lt;em&gt;If you're also working on AI education, feel free to &lt;a href="https://luhuidev.com/en" rel="noopener noreferrer"&gt;connect&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;DSPy Official Documentation: &lt;a href="https://dspy.ai" rel="noopener noreferrer"&gt;dspy.ai&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Paper: &lt;a href="https://arxiv.org/abs/2310.03714" rel="noopener noreferrer"&gt;DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines, ICLR 2024&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GitHub: &lt;a href="https://github.com/stanfordnlp/dspy" rel="noopener noreferrer"&gt;stanfordnlp/dspy&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optimizer Details: &lt;a href="https://dspy.ai/learn/optimization/optimizers/" rel="noopener noreferrer"&gt;dspy.ai/learn/optimization/optimizers&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>promptengineering</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Struggling with Research Figures? Here's How Multi-Agent Collaboration Gets It Right</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Sat, 11 Apr 2026 08:51:32 +0000</pubDate>
      <link>https://dev.to/luhuidev/struggling-with-research-figures-heres-how-multi-agent-collaboration-gets-it-right-2pka</link>
      <guid>https://dev.to/luhuidev/struggling-with-research-figures-heres-how-multi-agent-collaboration-gets-it-right-2pka</guid>
      <description>&lt;h1&gt;
  
  
  Struggling with Research Figures? Here's How Multi-Agent Collaboration Gets It Right
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem Every Researcher Knows Too Well
&lt;/h2&gt;

&lt;p&gt;Anyone who's done research knows this pain: creating a single figure from concept to completion can be more exhausting than writing the actual paper. You need logical structure, data precision, and style compliance—miss any one of these, and you're back to the drawing board.&lt;/p&gt;

&lt;p&gt;Single-model AI generation tools often produce beautiful images with broken logic, or logically sound diagrams that look terrible, or worst of all—figures where all the proportions are completely off.&lt;/p&gt;

&lt;p&gt;PaperBanana solved this problem, and it works remarkably well. The key insight? &lt;strong&gt;Break the task into multiple roles and let an AI team collaborate.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F218018b2e853dd507f5f7584dfdb9fb246edd46bc7ffc814445b9f62d34b1f09" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F218018b2e853dd507f5f7584dfdb9fb246edd46bc7ffc814445b9f62d34b1f09" alt="image.png" width="760" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Traditional AI Falls Short
&lt;/h2&gt;

&lt;p&gt;Many assume that throwing a large language model at the problem should work. But research figures aren't ordinary illustrations—they need to &lt;strong&gt;accurately express logic&lt;/strong&gt;, &lt;strong&gt;ensure data precision&lt;/strong&gt;, and ultimately meet academic journal aesthetics.&lt;/p&gt;

&lt;p&gt;A single model can't nail all three at once. The result? Either gorgeous images with completely wrong logic, or logically correct diagrams that look like they're from the '90s, and almost always with numerical proportions that make no sense.&lt;/p&gt;

&lt;p&gt;This is the core pain point of research figure generation, and exactly why solutions like PaperBanana emerged.&lt;/p&gt;

&lt;h2&gt;
  
  
  PaperBanana's Five-Role Collaboration
&lt;/h2&gt;

&lt;p&gt;PaperBanana's design philosophy is simple: &lt;strong&gt;Split the generation task into five specialized roles, let each focus on what they do best, then collaborate iteratively.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Visual Workflow&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Ffe549e3b91d7fc3b05cd5bd00de0736024847c57f36ddf8340eb6e34ff1e4c36" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Ffe549e3b91d7fc3b05cd5bd00de0736024847c57f36ddf8340eb6e34ff1e4c36" alt="image.png" width="600" height="1075"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Retriever — The Inspiration Board&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Retriever searches through a curated reference database to find the most relevant examples.&lt;/p&gt;

&lt;p&gt;It focuses on &lt;strong&gt;visual structure matching&lt;/strong&gt;, ensuring that subsequent generation has reliable layout references to work from.&lt;/p&gt;

&lt;p&gt;Think of it like a designer browsing templates before starting to sketch—that's what the Retriever does.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Planner — The Skeleton Designer&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Planner is the core brain. It transforms paper descriptions and figure objectives into detailed figure plans, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Figure components (nodes/modules)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Logical relationships and arrow directions between components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Spatial layout suggestions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Labels, annotations, etc.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Planner's core job is to provide the skeleton, preventing the generation from going off the rails.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Stylist — The Aesthetic Director&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;With the skeleton in place, the Stylist handles the aesthetics.&lt;/p&gt;

&lt;p&gt;It extracts colors, fonts, line weights, and shapes from reference examples, optimizing the Planner's output to meet journal standards.&lt;/p&gt;

&lt;p&gt;NeurIPS and Nature have different figure styles—the Stylist ensures generated figures comply with academic norms.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;4. Visualizer — The Executor&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Visualizer generates figures based on the standardized plan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Method figures&lt;/strong&gt; → Rendered using high-quality image generation models&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data charts&lt;/strong&gt; → Outputs &lt;strong&gt;reproducible Matplotlib code&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means generated figures aren't just pretty—they're directly usable as research materials, reproducible and modifiable.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;5. Critic — The QA/Feedback Loop&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Critic is key to closing the loop. It checks whether the figure faithfully reflects the text, whether it's clear, and whether it meets style specifications.&lt;/p&gt;

&lt;p&gt;If unsatisfied, it provides revision suggestions, prompting the Planner/Visualizer to iterate. Usually 2–3 rounds produce high-quality figures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Multi-Role Collaboration Works
&lt;/h2&gt;

&lt;p&gt;Compared to single-model end-to-end generation, PaperBanana has three major advantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reference-driven&lt;/strong&gt;: The Retriever provides structural and stylistic examples, making generation more reliable&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Clear division of labor&lt;/strong&gt;: Logic, style, and rendering are separated, avoiding the chaos of black-box generation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Closed-loop self-checking&lt;/strong&gt;: Critic + iteration makes figure quality controllable&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In other words, this is a &lt;strong&gt;process innovation&lt;/strong&gt; for AI-assisted research figure creation. In experiments, PaperBanana significantly outperformed baselines in fidelity, readability, and aesthetics.&lt;/p&gt;

&lt;p&gt;If you're interested in the design of this scenario, I've compiled &lt;a href="https://luhuidev.com/zh-cn/essays/paperbanana-ai-academic-method-figure-collaboration" rel="noopener noreferrer"&gt;the complete Prompt set&lt;/a&gt;—grab it below 👇&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond Academic Figures
&lt;/h2&gt;

&lt;p&gt;This multi-role collaboration pattern isn't limited to academic illustrations.&lt;/p&gt;

&lt;p&gt;For flowcharts, experimental design diagrams, teaching demonstrations, automated data visualization, and even complex tasks like code generation and decision planning, multi-agent collaboration proves more reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://arxiv.org/abs/2601.23265" rel="noopener noreferrer"&gt;PaperBanana: Automating Academic Illustration for AI Scientists (arXiv)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://paper-banana.ai/" rel="noopener noreferrer"&gt;PaperBanana Official Site&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://hyper.ai/en/papers/2601.23265" rel="noopener noreferrer"&gt;PaperBananaBench Dataset and Evaluation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>agents</category>
    </item>
    <item>
      <title>Dino-GSP Major Update: dynamic geometry demos, geometry embeds, and AI drawing upgrades</title>
      <dc:creator>Luhui Dev</dc:creator>
      <pubDate>Tue, 07 Apr 2026 12:52:04 +0000</pubDate>
      <link>https://dev.to/luhuidev/dino-gsp-major-update-dynamic-geometry-demos-geometry-embeds-and-ai-drawing-upgrades-33ep</link>
      <guid>https://dev.to/luhuidev/dino-gsp-major-update-dynamic-geometry-demos-geometry-embeds-and-ai-drawing-upgrades-33ep</guid>
      <description>&lt;p&gt;&lt;strong&gt;Dino-GSP 2.4.0 was released on March 23, 2026.&lt;/strong&gt; This update is not just a list of extra features. It connects &lt;strong&gt;dynamic geometry demos, online geometry embeds, region area calculation, and AI geometry drawing&lt;/strong&gt; into a more complete workflow.&lt;/p&gt;

&lt;p&gt;If you are comparing &lt;strong&gt;dynamic geometry software, online geometry tools, math teaching tools, or interactive geometry platforms&lt;/strong&gt; for lessons, content, or websites, this release deserves attention.&lt;/p&gt;



&lt;h2&gt;
  
  
  Dino-GSP 2.4.0 at a glance
&lt;/h2&gt;

&lt;p&gt;This release focuses on four high-frequency needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Slider-based dynamic demos&lt;/strong&gt; that make geometry figures actually move&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Geometry embed mode&lt;/strong&gt; for blogs, course pages, and product sites&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Boolean region operations and area calculation&lt;/strong&gt; for more complex analysis&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broader AI geometry assistance&lt;/strong&gt; that fits real creation workflows&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  1. Dynamic geometry demos upgraded: sliders are now a first-class feature
&lt;/h2&gt;

&lt;p&gt;The point of dynamic geometry is not just drawing figures. It is showing parameter changes, geometric relationships, and reasoning processes in motion. The latest Dino-GSP release fully rounds out slider support and makes it much closer to a real &lt;strong&gt;dynamic geometry software&lt;/strong&gt; workflow for classrooms and content creation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fa58a39769f251141c6d3bcc585fbe820c405b114b6dcf46b09dd74b187e26622" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fa58a39769f251141c6d3bcc585fbe820c405b114b6dcf46b09dd74b187e26622" alt="10.gif" width="760" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This upgrade includes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create and edit dynamic parameters&lt;/strong&gt;: sliders can directly control lengths, angles, and point positions, with figures updating in real time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text-linked values&lt;/strong&gt;: slider values can be inserted into explanatory text so teaching copy updates together with the figure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Autoplay support&lt;/strong&gt;: presentation and sharing modes support autoplay, speed adjustment, and looping for lessons and recorded demos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More complete exports&lt;/strong&gt;: sliders can be exported to SVG and TikZ while preserving labels and control styles for papers, handouts, and blogs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This pushes Dino-GSP beyond a static geometry board and makes it more suitable for &lt;strong&gt;interactive geometry demos&lt;/strong&gt;, classroom walkthroughs, and parameter-driven explanations.&lt;/p&gt;



&lt;h2&gt;
  
  
  2. Geometry embed mode arrives: the online geometry tool can now live inside web pages
&lt;/h2&gt;

&lt;p&gt;For course builders, bloggers, and documentation teams, the ability to embed geometry into a page is a practical requirement. The latest Dino-GSP release adds a full &lt;strong&gt;geometry embed mode&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.1 Where this helps
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Embedding interactive geometry into teaching blogs&lt;/li&gt;
&lt;li&gt;Showing manipulable math demos inside online courses&lt;/li&gt;
&lt;li&gt;Adding interactive diagrams to product sites or knowledge bases&lt;/li&gt;
&lt;li&gt;Preserving parameter control and geometry state in shared pages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F838d76b316c3d441659c1ccc341f35117ebd7dda3619aee0fbb80b01e6267b2f" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F838d76b316c3d441659c1ccc341f35117ebd7dda3619aee0fbb80b01e6267b2f" alt="image.png" width="2648" height="1540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 What is included
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A complete embed architecture&lt;/strong&gt;: dedicated routing, state synchronization, and communication bridging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;iframe export&lt;/strong&gt;: exportable iframe links with configurable aspect ratios for different layouts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;REPL integration&lt;/strong&gt;: embedded surfaces can load and edit geometry content, so the experience goes beyond passive viewing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fed3e488fd355a98c966cece2aed70ffe343370f5474174f95e26d44740a859c7" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fed3e488fd355a98c966cece2aed70ffe343370f5474174f95e26d44740a859c7" alt="image.png" width="2574" height="1449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F1247a1fc8ef4f49ef2c48f31b8be4aea7e074c1068dbabe260e3bf7067c6d8d2" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F1247a1fc8ef4f49ef2c48f31b8be4aea7e074c1068dbabe260e3bf7067c6d8d2" alt="image.png" width="2495" height="1543"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  3. Region area calculation and boolean operations improved: analysis is more complete
&lt;/h2&gt;

&lt;p&gt;If you need to work with overlapping shapes, composite figures, or region logic, this release strengthens the analytical layer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F534a98eb2178cfe915e6e3724f00f8dfac755cb0dd98c4ac29d24e7b2e5986be" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F534a98eb2178cfe915e6e3724f00f8dfac755cb0dd98c4ac29d24e7b2e5986be" alt="image.png" width="1280" height="751"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The update includes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Boolean path operations&lt;/strong&gt;: intersection, union, and difference for more complex region construction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Region area calculation&lt;/strong&gt;: direct area calculation plus &lt;code&gt;contains&lt;/code&gt; checks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Precision fixes&lt;/strong&gt;: better handling of boundary precision issues, negative radii, and undefined dependencies.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This matters for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solving geometry problems involving overlapping areas&lt;/li&gt;
&lt;li&gt;Verifying region relationships in teaching contexts&lt;/li&gt;
&lt;li&gt;Building composite paths for cleaner exports&lt;/li&gt;
&lt;li&gt;Running more stable geometry computation workflows&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  4. Master management is now available: keep diagram styles consistent at scale
&lt;/h2&gt;

&lt;p&gt;If you produce many teaching diagrams or worksheet visuals, repeated style setup quickly becomes inefficient. The latest release adds &lt;strong&gt;master management&lt;/strong&gt; to improve content production efficiency.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F107f62f13c64ff4c1d3f379ac9ca8002ef6a553bfd65b96479ee1f35231eb9ba" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2F107f62f13c64ff4c1d3f379ac9ca8002ef6a553bfd65b96479ee1f35231eb9ba" alt="image.png" width="1280" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the master panel directly from the editor tabs&lt;/li&gt;
&lt;li&gt;Create, update, apply, and delete masters&lt;/li&gt;
&lt;li&gt;Set default styles and preview them in real time&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For teachers, geometry creators, and worksheet teams, this improves batch production more than one-off drawing speed.&lt;/p&gt;



&lt;h2&gt;
  
  
  5. AI geometry drawing keeps improving: a smarter geometry assistant
&lt;/h2&gt;

&lt;p&gt;Dino-GSP has been pushing AI toward an executable geometry assistant, not just a chat box. This AI update is part of that broader workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fc7ba50c8650058ab2e99fee1b28fd9d8026cfad1d0f35eda4d51b3e20b017e07" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fc7ba50c8650058ab2e99fee1b28fd9d8026cfad1d0f35eda4d51b3e20b017e07" alt="image.png" width="2077" height="1220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The main AI improvements include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Usage and credit records&lt;/strong&gt;: clearer tracking for AI costs and consumption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image upload entry points&lt;/strong&gt;: users can upload sketches or images and be routed to image-capable models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better conversation tools&lt;/strong&gt;: copy, reaction, and feedback support for a more stable interaction loop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clearer instruction display&lt;/strong&gt;: formatting, truncation, and expansion improve readability for complex prompts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Animation support&lt;/strong&gt;: AI can help create geometry animations and assist with keyframes and motion paths.&lt;/li&gt;
&lt;/ol&gt;



&lt;h2&gt;
  
  
  6. Axes, grids, and algebra definitions continue to improve
&lt;/h2&gt;

&lt;p&gt;Beyond the larger features, this release also includes lower-level upgrades that affect daily use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fac9ae40a0c1226863e8592fa029a3429f7024777df4148f8ee21303f20ab24a1" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fac9ae40a0c1226863e8592fa029a3429f7024777df4148f8ee21303f20ab24a1" alt="image.png" width="2077" height="1220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6.1 Coordinate system and grid
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Custom grid ranges are supported&lt;/li&gt;
&lt;li&gt;Axis point selection can lock intelligently&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pi&lt;/code&gt; and &lt;code&gt;pi/2&lt;/code&gt; spacing are supported&lt;/li&gt;
&lt;li&gt;X and Y ranges, labels, and intervals are more configurable&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6.2 Automatic algebra definition reordering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Object order is adjusted automatically when algebra definitions change&lt;/li&gt;
&lt;li&gt;Circular dependency detection and error prompts are supported&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  7. More upgrades across drawing and sharing workflows
&lt;/h2&gt;

&lt;h3&gt;
  
  
  7.1 Geometry and drawing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;New orthogonal drawing mode&lt;/li&gt;
&lt;li&gt;Better ellipse arc editing&lt;/li&gt;
&lt;li&gt;Added arrow styles&lt;/li&gt;
&lt;li&gt;Dynamic anchor support for labels&lt;/li&gt;
&lt;li&gt;Formula editor symbols better aligned with classroom math notation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fd9942534705e4ecccee109eaa89209a0284f04917b4c031b2f923ce029534f1c" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.gooo.ai%2Fweb-images%2Fd9942534705e4ecccee109eaa89209a0284f04917b4c031b2f923ce029534f1c" alt="image.png" width="2574" height="1347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  7.2 Interaction and interface
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Floating toolbar for union selection, color settings, and hover hints&lt;/li&gt;
&lt;li&gt;More line and point styling options&lt;/li&gt;
&lt;li&gt;Clearer property panel structure&lt;/li&gt;
&lt;li&gt;Input width adjusts dynamically with expression count&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7.3 Sharing and SEO
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Community sharing can control whether AI chat records are public&lt;/li&gt;
&lt;li&gt;Shared works can restrict saving and remixing&lt;/li&gt;
&lt;li&gt;Shared pages support dynamic titles and descriptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes Dino-GSP better not just for drawing, but also for &lt;strong&gt;distribution, discoverability, and search visibility&lt;/strong&gt;.&lt;/p&gt;



&lt;h2&gt;
  
  
  8. Which day-to-day issues were fixed
&lt;/h2&gt;

&lt;p&gt;This release also fixes a large number of practical issues, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Region computation&lt;/strong&gt;: negative area, path restoration, arc judgment, and precision flicker&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sliders&lt;/strong&gt;: style copying, step and speed defaults, snapping, previews, and history behavior&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selection&lt;/strong&gt;: deselect with Shift, incorrect select-all behavior, and function graph box selection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exports&lt;/strong&gt;: inconsistencies across SVG, LaTeX, and Canvas, plus font embedding and clipping offsets&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool compatibility&lt;/strong&gt;: grid snapping, compass and transform tool errors, file jumps, and copy/paste&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Try Dino-GSP
&lt;/h2&gt;

&lt;p&gt;If you are comparing geometry software, math teaching tools, or embeddable dynamic geometry options, this version is now a much stronger reference point.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://dajiaoai.com/?utm_source=luhuidev" rel="noopener noreferrer"&gt;Try Dino-GSP now&lt;/a&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  About Dino-GSP
&lt;/h3&gt;

&lt;p&gt;Dino-GSP is a tool for math teaching, geometry creation, and online sharing. It combines a geometry engine, AI assistance, and professional export capabilities into a more modern geometry workflow.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>news</category>
      <category>science</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
