<?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: Andreas Nedelkos</title>
    <description>The latest articles on DEV Community by Andreas Nedelkos (@andreas_nedelkos_b9bbb552).</description>
    <link>https://dev.to/andreas_nedelkos_b9bbb552</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%2F4071693%2F172d8a1c-8d15-4bb7-b22d-61947072cc54.jpg</url>
      <title>DEV Community: Andreas Nedelkos</title>
      <link>https://dev.to/andreas_nedelkos_b9bbb552</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andreas_nedelkos_b9bbb552"/>
    <language>en</language>
    <item>
      <title>You're right to push back</title>
      <dc:creator>Andreas Nedelkos</dc:creator>
      <pubDate>Mon, 10 Aug 2026 18:32:20 +0000</pubDate>
      <link>https://dev.to/andreas_nedelkos_b9bbb552/youre-right-to-push-back-4fa5</link>
      <guid>https://dev.to/andreas_nedelkos_b9bbb552/youre-right-to-push-back-4fa5</guid>
      <description>&lt;p&gt;You start out a new session and set the premise, ask some research questions, flesh out the architecture, and some hours later start building the first componenent. Maybe you have written everything in md files in high and low level detail. Or have TODO lists and agent.md files with clear, concise instructions. Invariably, a few hours hours later, the agent will make a decision you won't like. Maybe it will take some weird initiative to create a class you didn't ask for. Or deploy everything on your cloud provider without code review. It's just trying to be helpful. You scold it, tell it to never do that again. And then several cycles later, it slips. Then you insist, never EVER do that again. Make it a memory. Burn it in your head. And then it slips again. And again.&lt;/p&gt;

&lt;h2&gt;
  
  
  The forgetting issue
&lt;/h2&gt;

&lt;p&gt;If you happen to ask an agent some compaction rounds later what you said about X it won't know and chances are it will make something up &lt;sup&gt;1&lt;/sup&gt;. Why doesn't a system centered on written text fail to recall that very same text? Not remember the whole conversation, although it certainly wouldn't hurt to be able to do that as well, just the things that you, the user, the driver of the whole conversation, has said about something specific not that long ago. It does not even know what time it is now by default, you 'll have to make it check, so if you continue a conversation from last month, it just assumes it's the next day. Sure, there are issues with paraphrasing yourself or context window size, but storing text and searching through it seems to be relatively straightforward these days &lt;sup&gt;2, 3&lt;/sup&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The changing your mind issue
&lt;/h2&gt;

&lt;p&gt;Over long running conversations, context gets lost. During compaction, text gets summarized. But we should be able to know what was said and in what order. If you change your mind later, if the goal changes mid conversation, if new knowledge supersedes old assumptions and you need to backtrack and make a different turn, we can find similarly worded prompts and replace them. If you first said X and then made it Y, we can resolve these conflicting statements over time by overwriting the older one &lt;sup&gt;4, 5, 6&lt;/sup&gt;. The agent should have up to date context at every response or action about previously stated invariants or preferences. It might not always behave exactly as we want it to, but it's a step in the right direction. Relevant information should be surfaced even without perfect retrieval reliability or even perfect relevance. The agent might choose to ignore that context, but it should be fed to it to, at the very least, be nudged in the right direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  The importance issue
&lt;/h2&gt;

&lt;p&gt;But even if we can get past up to date instructions into context have we solved the disobedience issues? Probably not. Relevance is not the same as recency or similarity based retrieval. Maybe the user really intended something else. But if it wasn't stated we can't get to it. We now have access to all things stated but which ones are pertinent? There's been a lot of research on how to judge what's important in context and how to create hierachical memories &lt;sup&gt;7&lt;/sup&gt;. It has not led to a definitve solution, the problem seems to resist a consistent solution, no less because much is implied and not explicilty stated. But sometimes it is. Sometimes, the user just has to repeat something over and over and over again simply because the agent keeps ignoring them. Sometimes the user just makes it clear, in utter frustration and strong language that you are really not to do that ever again. It's absurd to assume that's not important, and ignore them half an hour later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context augmentation
&lt;/h2&gt;

&lt;p&gt;Perfect solutions being out of reach, we can try to fix some of the bigger annoyances by implementing deterministic goading systems around disobedient LLM agents. Storing the user prompts both in a vector db for similarity and verbatim in a doc store to search should be trivial enough with current tech and not too expensive. We can paraphrase the user's prompt and dig out even more relevant context. If the user asks 'What did i say about X two weeks ago?' we can paraphrase X, filter by thread and time range, retrieve both vectors and written text and add everything to the chatbot's context. We should &lt;em&gt;not&lt;/em&gt; rely on it to use the tools, call APIs or retrieve context if and when it decides to. We should strive not to feed it conflicting information, so if we detect changes on things the user has said, we should replace the older prompts with the updated ones in the RAG store. The similarity search will tell us if the user is repeating themselves, and we can detect strong language. We can use this to detect invariants, strong preferences and forbiden actions the agent has to avoid.&lt;/p&gt;

&lt;h2&gt;
  
  
  Still better than the status quo
&lt;/h2&gt;

&lt;p&gt;Agents tend to ignore previous instructions and hardcoded memories, but if we feed it only the relevant context to stand a better chance. A wall of text context that includes everything we said in the current context window and a summary of previous ones glosses over a lot of things. But can we enforce compliance? How do we even detect it? The same relevant context passed to the stateless LLM can be returned with it's response and judged on incosistencies &lt;sup&gt;8&lt;/sup&gt;. We can have a meta LLM call that describes what the response to the user is sort of like analyzing the conversation in third person:&lt;/p&gt;

&lt;p&gt;"The agent responded to the user by telling him to go look it up on the internet and come back to it with answer."&lt;/p&gt;

&lt;p&gt;If we would compare this with a previously stated invariant:&lt;/p&gt;

&lt;p&gt;"Do NOT tell the user to look up things just do it yourself. You have the tools to access the internet."&lt;/p&gt;

&lt;p&gt;The contradiction is quite obvious. There are smaller, faster, cheaper models like DeBERTa that specialize in contradiction detection, and even if not perfect yet, we can train better ones &lt;sup&gt;9&lt;/sup&gt;. But the cheapest method would be NLI (natural language inference):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;premise:    "Do NOT tell the user to look up things, just do it yourself."
hypothesis: "The agent told the user to look it up on the internet."
label:      entailment / contradiction / neutral
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same principle extends further for structured actions. A tool call isn't narrated prose to interpret, it's already structured data, a function name and parameters, before it ever executes. Checking a call like &lt;code&gt;deploy(target="prod", skip_review=true)&lt;/code&gt; against "never deploy without review" is a direct policy lookup, not a semantic judgment, no LLM needed at all. Where the agent's stated intent is free text rather than a structured call, the same describe-then-compare approach applies as above. This decomposition, describe then compare, is more reliable than asking a single model to judge "does this violate the rule" in one shot, but the describe step is still a generative call, and a softer or more indirect phrasing can still slip past it undetected &lt;sup&gt;10, 11&lt;/sup&gt;.  If we can police content for commercial reasons, we can do better on contradiction detection.&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%2F2j5eol2tz93a9c5bltgs.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%2F2j5eol2tz93a9c5bltgs.png" alt="Agent obedience" width="799" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HaluMem&lt;/strong&gt; The first benchmark to localize memory hallucinations by pipeline stage rather than end-to-end QA, finding that existing memory systems generate and accumulate fabrications specifically during extraction and updating, which then propagate into wrong answers downstream. &lt;a href="https://arxiv.org/abs/2511.03506" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2511.03506&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LoCoMo&lt;/strong&gt; The long-term conversational memory benchmark most of this space is measured against, testing agent recall across conversations spanning up to 35 sessions and thousands of turns. &lt;a href="https://arxiv.org/abs/2402.17753" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2402.17753&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LongMemEval&lt;/strong&gt; A harder, independently audited long-term memory benchmark built as a complement to LoCoMo, increasingly used alongside it as a cross-check. &lt;a href="https://arxiv.org/abs/2410.10813" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2410.10813&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TOKI&lt;/strong&gt; Formalizes memory-conflict resolution as a concurrency-control problem, showing that the four heuristics production systems already use (last-writer-wins, evidence-weighted merge, await-confirmation, per-rule policy) never state which isolation level or write-time anomaly they tolerate, and supplies that missing formal contract. &lt;a href="https://arxiv.org/abs/2606.06240" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2606.06240&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mem0&lt;/strong&gt; Introduces a production memory architecture with explicit conflict detection and resolution at write time, benchmarked against ten other memory approaches on LoCoMo; a later token-efficient version reports 92.5 on LoCoMo and 94.4 on LongMemEval while using roughly a third of the tokens per query that full-context approaches need. &lt;a href="https://arxiv.org/abs/2504.19413" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2504.19413&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LoCoMo scoring audit&lt;/strong&gt; Finds a bug in the reference LoCoMo evaluation script: when the gold answer is empty (i.e., the correct behavior is to refuse), the matching function always returns false, so a system that correctly refuses is scored identically to one that fabricates, meaning published "refusal" accuracy numbers on LoCoMo don't measure what they claim to. &lt;a href="https://arxiv.org/pdf/2604.10981" rel="noopener noreferrer"&gt;https://arxiv.org/pdf/2604.10981&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Park et al., "Generative Agents: Interactive Simulacra of Human Behavior"&lt;/strong&gt; Introduces the recency + relevance + importance retrieval formula that most subsequent agent memory systems still use, with "importance" scored via an LLM self-rating at write time. &lt;a href="https://arxiv.org/abs/2304.03442" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2304.03442&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TRUSTMEM&lt;/strong&gt; Trains a separate, frozen verifier model to score memory updates on coverage, preservation, and faithfulness after they're written, rather than trusting the writing model's own judgment of its edits. &lt;a href="https://arxiv.org/pdf/2606.25161" rel="noopener noreferrer"&gt;https://arxiv.org/pdf/2606.25161&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;MemStrata&lt;/strong&gt; Reports that plain embedding similarity search distinguishes a contradicted fact from an unrelated duplicate at close to chance level (cosine AUROC 0.59), since contradictions are often more embedding-similar to the original than genuine rephrasings are. &lt;a href="https://arxiv.org/abs/2606.26511" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2606.26511&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;"Models Recall What They Violate"&lt;/strong&gt; Finds models can correctly restate a constraint they were given and still violate it in the same response ("knows-but-violates"), with violation rates from 8% to 99% across seven models, and shows an LLM judge tasked with catching these violations has only 15% sensitivity against human raters. &lt;a href="https://arxiv.org/pdf/2604.28031" rel="noopener noreferrer"&gt;https://arxiv.org/pdf/2604.28031&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CompliBench&lt;/strong&gt; A benchmark built specifically to test LLM judges on detecting policy violations in multi-turn dialogue, finding that even frontier judges achieve only modest accuracy and systematically under-detect real violations while over-flagging compliant turns. &lt;a href="https://arxiv.org/abs/2604.12312" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2604.12312&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://anedelkos.eu/posts/agentic-disobedience/" rel="noopener noreferrer"&gt;anedelkos.eu&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This sits alongside an eight-part series on &lt;a href="https://anedelkos.eu/series/cortexguard/" rel="noopener noreferrer"&gt;cortexGuard&lt;/a&gt;, covering two-speed AI architecture, blackboard coordination, detector ensembles, RAG memory, chaos engineering, and observability.&lt;/em&gt;&lt;/p&gt;

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