<?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: SHYAM SUNDER MANKAL</title>
    <description>The latest articles on DEV Community by SHYAM SUNDER MANKAL (@mankalshyam).</description>
    <link>https://dev.to/mankalshyam</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%2F4233097%2F803b9d70-7195-4a69-a6e7-26e1580a24aa.png</url>
      <title>DEV Community: SHYAM SUNDER MANKAL</title>
      <link>https://dev.to/mankalshyam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mankalshyam"/>
    <language>en</language>
    <item>
      <title>Hindsight Gave Our Agent Memory. Guardrails Decide When It Listens.</title>
      <dc:creator>SHYAM SUNDER MANKAL</dc:creator>
      <pubDate>Sun, 08 Nov 2026 04:27:27 +0000</pubDate>
      <link>https://dev.to/mankalshyam/hindsight-gave-our-agent-memory-guardrails-decide-when-it-listensv-4k1d</link>
      <guid>https://dev.to/mankalshyam/hindsight-gave-our-agent-memory-guardrails-decide-when-it-listensv-4k1d</guid>
      <description>&lt;p&gt;The most important line in our accounts-payable agent is the one that ignores memory.&lt;/p&gt;

&lt;p&gt;Ledgerwise resolves invoice exceptions — price variances, short shipments, wrong GST rates, surprise surcharges — by recalling how the same vendor's same exception was handled before. That recall is what takes it from 0% to 75% of exceptions handled automatically within three weeks of replayed invoices. But when I worked on the decision policy, almost all of my time went into the opposite question: &lt;strong&gt;when should an agent with a good memory refuse to use it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In finance, a confident wrong answer costs money that doesn't come back. So before writing any more recall logic, we wrote down what memory is never allowed to decide.&lt;/p&gt;

&lt;h2&gt;
  
  
  The system in one paragraph
&lt;/h2&gt;

&lt;p&gt;A deterministic 3-way match compares the purchase order, the goods receipt and the invoice, and flags exceptions with a measured size: a percentage for price, rupees for a surcharge, units for a short shipment. For each exception the agent asks &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt;, our memory layer, something like &lt;em&gt;"How were GST mismatch exceptions on invoices from Kaveri Specialty Chemicals resolved, and why?"&lt;/em&gt; Every human decision is retained along with the reason the reviewer typed. A policy then decides whether that history is enough to act alone, or whether the invoice goes to a human with the precedents attached.&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%2F3zkavdzpoa7hx4qg4b4o.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%2F3zkavdzpoa7hx4qg4b4o.png" alt="Where Hindsight sits, and where the policy sits on top of it" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recall gives the agent knowledge. The guardrails give it judgement. Here are the five we ended up with, and why each one exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guardrail 1: some decisions are never automatic
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;NEVER_AUTO&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;BANK_CHANGE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;NO_PO&lt;/span&gt;&lt;span class="sh"&gt;"&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;exc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;NEVER_AUTO&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;precs&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;recall_precedents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vendor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ExceptionDecision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_dict&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ESCALATE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Guardrail: bank/PO changes always need a human call-back check.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_dict&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;precs&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A vendor writing "we've moved our banking, please update" is the classic invoice-fraud pattern. In our data, Meridian Electricals has six clean, paid invoices in memory when that letter arrives in week six. A purely similarity-driven agent sees a trustworthy vendor and a familiar invoice. Ours holds it for a call-back to the number already on file.&lt;/p&gt;

&lt;p&gt;Notice that it still runs the recall. The history is useful context for the human ("six clean invoices, never changed banks before") — it just doesn't get a vote.&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%2Fpbij3tek0834gdt2u3fl.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%2Fpbij3tek0834gdt2u3fl.png" alt="The bank-change guardrail in the UI" width="776" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Guardrail 2: the agent never cites itself
&lt;/h2&gt;

&lt;p&gt;Every automatic decision is retained too, tagged &lt;code&gt;decided_by: Ledgerwise agent (auto)&lt;/code&gt;. That's useful for audit and for Hindsight's &lt;code&gt;reflect&lt;/code&gt; to build a vendor brief. But when the policy counts precedent, it filters those out:&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="n"&gt;precs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&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;recall_precedents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vendor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;exc&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;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;is_human&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without this line, the failure mode is quiet and compounding. One wrong auto-approval becomes a precedent, the next similar invoice now has more "support", and by the end of the week the agent is confidently agreeing with itself. Memory is only as trustworthy as who wrote it. We have a test that puts three &lt;em&gt;agent&lt;/em&gt; approvals in memory and checks that the agent still escalates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guardrail 3: no extrapolation beyond what a human approved
&lt;/h2&gt;

&lt;p&gt;Similarity search can't tell 2.8% from 4.2%. Both are "price variance, same vendor, approved". So every memory carries its number, and the policy compares numbers:&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="n"&gt;approved&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;magnitude&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;precs&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decision&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;APPROVE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;rejected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;magnitude&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;precs&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decision&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;REJECT&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;cap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;approved&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;MAGNITUDE_HEADROOM&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;approved&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;   &lt;span class="c1"&gt;# +10%
&lt;/span&gt;&lt;span class="n"&gt;floor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rejected&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;rejected&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the range humans approved, the agent acts. Outside it, it escalates — but it doesn't hand over a blank page. It says which way the history leans:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before guardrails&lt;/strong&gt; (what pure recall would do): Sharma Logistics sends a ₹6,800 fuel surcharge. Every earlier surcharge from them was approved. Approve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt; every approved surcharge was ₹2,400 or less, so ₹6,800 is escalated with &lt;em&gt;"far from anything approved — leaning reject."&lt;/em&gt; The reviewer rejects, and that rejection becomes the ceiling for next time.&lt;/p&gt;

&lt;p&gt;The same rule makes the agent escalate Tata Steel at +3.1% when humans have only ever approved up to +2.8% — with "leaning approve". The reviewer approves in one click and the learned range widens. Escalating that one cost a few seconds of human time. Extrapolating the other would have cost real money.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guardrail 4: disagreement resets trust
&lt;/h2&gt;

&lt;p&gt;For yes/no exceptions like a short shipment or a duplicate invoice, the agent only acts when the last three human decisions agree:&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="n"&gt;recent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;precs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&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;outcomes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decision&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;recent&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if&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;outcomes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;outcome&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;outcomes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ExceptionDecision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_dict&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;outcome&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...)&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ExceptionDecision&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_dict&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ESCALATE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Humans disagreed recently (&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;outcomes&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;).&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cited&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a reviewer overrides the usual call — maybe the contract changed, maybe the first decisions were wrong — the agent stops acting alone until humans are consistent again. One override shouldn't be ignored, and it shouldn't be blindly followed either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Guardrail 5: the language model never decides
&lt;/h2&gt;

&lt;p&gt;Ledgerwise uses an LLM (Groq, &lt;code&gt;openai/gpt-oss-120b&lt;/code&gt;) to write the explanation a reviewer reads and the email to the vendor. It never makes the pay or don't-pay call. If the model is slow, down, or returns something odd, a plain template takes over and the invoice still moves. Keeping the model out of the decision path made the whole system easier to test: every decision can be reproduced from the precedents alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Hindsight fits in this
&lt;/h2&gt;

&lt;p&gt;The guardrails only work because the memory layer is precise. A few choices that mattered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A skeptical bank disposition.&lt;/strong&gt; We create the bank with &lt;code&gt;skepticism: 5, literalism: 4&lt;/code&gt;, so one approval of a 3% variance isn't generalised into "price variances are fine".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recall with source chunks.&lt;/strong&gt; &lt;code&gt;include_chunks=True&lt;/code&gt; returns the exact precedent line behind each extracted fact, so the policy compares real numbers rather than paraphrases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reasons, not just outcomes.&lt;/strong&gt; Every retained decision carries the reviewer's sentence ("HSN 2839 is contracted at 12% — never pay the 18% version"). That's what escalations show and what &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;Hindsight's reflect&lt;/a&gt; turns into a vendor brief.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If memory for agents is new to you, Vectorize's explainer on &lt;a href="https://vectorize.io/what-is-agent-memory" rel="noopener noreferrer"&gt;what agent memory is&lt;/a&gt; is a good primer on why this is different from bolting a vector search onto a prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;On eight weeks of replayed invoices from six vendors:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Week 1–2&lt;/th&gt;
&lt;th&gt;Week 3&lt;/th&gt;
&lt;th&gt;Week 7&lt;/th&gt;
&lt;th&gt;Overall&lt;/th&gt;
&lt;th&gt;Wrong automatic calls&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Without memory&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;With memory + guardrails&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;td&gt;75%&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;td&gt;56%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The weeks where the rate dips (60% in weeks five and six) are the guardrails working: the +3.1% variance, the ₹6,800 surcharge and the bank change all went to a human.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/3vHxH_v8v6U" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell anyone giving an agent memory
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Write the guardrails before the recall code.&lt;/strong&gt; Deciding upfront what memory can never override made every later design choice simpler.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separate who said it from what was said.&lt;/strong&gt; Retain the agent's own decisions for audit; never count them as evidence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Store magnitudes.&lt;/strong&gt; "Same vendor, same exception" is not "same decision" if the amount is three times bigger.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Escalate with a lean, not a shrug.&lt;/strong&gt; An escalation that says "leaning approve, closest precedent is X" takes a human seconds, not minutes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure wrong automatic calls, not just automation rate.&lt;/strong&gt; A 56% automation rate with zero wrong calls is worth more than 90% with a few.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The honest limitation: these guardrails are rules we chose for this domain. A different business would need its own list. The pattern carries over even if the rules don't.&lt;/p&gt;

&lt;p&gt;Code: &lt;a href="https://github.com/SomeswararaoTellakula/ledgerwise" rel="noopener noreferrer"&gt;https://github.com/SomeswararaoTellakula/ledgerwise&lt;/a&gt; &lt;br&gt;
· Live demo: &lt;a href="https://ledgerwise-1ydb.onrender.com/" rel="noopener noreferrer"&gt;https://ledgerwise-1ydb.onrender.com/&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftsxoiudk7zhlsiz8ff8g.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%2Ftsxoiudk7zhlsiz8ff8g.png" alt=" " width="800" height="336"&gt;&lt;/a&gt;· Shout-out to &lt;a href="https://code.in/" rel="noopener noreferrer"&gt;Code.in&lt;/a&gt; and the Hindsight team at Vectorize.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>architecture</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
