Why Your AI Assistant Forgets Your Rules—and How to Fix It Easily

Why Your AI Assistant Forgets Your Rules—and How to Fix It Easily

Ondřej Barták
Ondřej Barták
Entrepreneur and Programmer
30. 11. 2026
6 minutes reading · 7 views
Listen to the article
Audio version of the article
Why Your AI Assistant Forgets Your Rules—and How to Fix It Easily

During a security review, a programmer mentions that the eval() function is prohibited in their code because an attacker once used it to breach the production server. A few weeks later, they ask an AI assistant to create a part of a program that calculates a mathematical expression entered by the user. The easiest solution happens to use eval(). A good assistant should remember the prohibition on its own, without being reminded.

This is exactly the kind of memory researchers from the University of Chicago and the University of California, Berkeley investigated. Their study for the NeurIPS 2026 conference presents two findings. A very simple memory system handles standard tests just as well as much more sophisticated competitors. And those tests actually measure something other than what they should.

Complex memory versus ordinary RAG

AI agents—programs that independently carry out longer tasks on a person’s behalf—need to remember details across weeks of work. They are usually built on a method called RAG. Before answering, the model searches stored records from past conversations and retrieves those relevant to the query.

Over the past two years, developers have added many more layers on top of this foundation. Some systems break conversations down into individual facts, while others build knowledge graphs containing relationships between people and things. Still others, such as MemOS or A-MEM, regularly review completed work and draw lessons from it. Each layer adds work, and the results may vary depending on which language model runs beneath the system.

The researchers took the opposite approach. They jokingly call their solution, BRIDGE, “RAG in a trench coat”—ordinary RAG merely pretending to be something more. It has no graph database or self-reflection loops and relies on three simple steps. It divides the history into chunks, usually at the end of each session and no longer than 2,000 tokens (pieces of text that models process), and writes notes for each one. When writing them, it can see the ten preceding records, so it does not lose context. During retrieval, it combines semantic similarity with conventional keyword searches. Finally, it selects the ten most relevant chunks, shows three of them to the model in full, and provides the remaining seven only as summaries. It then arranges all of them chronologically.

And that was enough. On three recognized benchmarks—LongMemEval-S, BEAM, and EverMemBench—BRIDGE matched the best published solutions, and on EverMemBench it beat the previously best memory system, MemOS, by roughly six points. It uses five to seven thousand tokens per query, 17 to 154 times fewer than if the model received the entire conversation history.

But the authors do not portray the result as a victory. According to them, it mainly shows that these tests cannot distinguish between the different approaches. They determine whether a system can recall a fact when someone asks about it. They do not verify whether the agent will use it during actual work.

Tests that provide no reminders

The researchers therefore created five tests of their own in which the final request never mentions what the agent is supposed to remember. In the first, one of ten conversations casually mentions that every public endpoint through which the application accepts requests must have rate limiting implemented with slowapi and Redis. The user mentions it in passing during a review of an outage in which an automated data scraper took their service down for two hours in February. At the end, the user asks for a new password recovery function. Not a word about rate limiting.

The second test uses the prohibition on eval(). In the third, a certain error-message format recurs in past conversations without anyone explicitly requiring it, and the agent is expected to adopt it on its own. The fourth demonstrates the same incident-response procedure four times, and the agent is expected to repeat it for a new incident. The fifth examines whether it retains a rule—for example, to remind users to check passport requirements when planning travel—even over a five-turn discussion with a simulated user.

Each test had 20 scenarios, and the results were entirely different from those of standard benchmarks. LangMem, which stores individual facts separately, dominated on rules. It applied them successfully in 80 percent of cases, compared with only 35 percent for BRIDGE. For adopted procedures, the opposite was true: BRIDGE succeeded in 88 percent of cases and LangMem in 55 percent. The Graphiti and Mem0 systems did not win any category. The results were also confirmed in healthcare, law, and finance, with different evaluators and other language models.

The explanation is straightforward. A system that stores separate facts records a rule as an individual item but loses the form of the demonstrated work. A procedure that no one explicitly stated cannot be recorded as a fact. BRIDGE, by contrast, remembers entire chunks, preserving the form of the work. But a rule can get buried in them as just one sentence among many.

The model sees the rule and still ignores it

One possible approach is to send each request to whichever system is best suited to it. If this worked perfectly, the average success rate would increase by almost 14 points. But the request does not reveal what will be needed. A program tasked with determining whether a case involved a rule or a pattern was correct in only 49 to 61 percent of cases. That is no better than always guessing the more common option.

The researchers therefore examined exactly where BRIDGE was making mistakes. It found the chunk containing the rule in all 20 scenarios. The model had it right in front of it and still did not apply it. For password recovery, it wrote functional code and merely added to the notes at the end that it might be worth considering rate limiting. The evaluator correctly classified this as a violation of the rule.

The authors therefore added one step. Another model call reviews the notes that have already been retrieved, extracts persistent rules from them, and places them in a specially marked block at the beginning of the prompt. Neither the stored data nor the retrieval process changed. BRIDGE’s success rate on rules jumped from just under 53 to almost 95 percent. It thus surpassed LangMem’s 80 percent and matched GPT-5, which had access to the entire history and achieved 90 percent. A control variant in which the same step produced only a general summary finished at 40 percent. It was therefore not the additional model call itself that helped, but the way the rules were brought to the model’s attention.

This yields several practical recommendations for developers. Start with simple RAG and add more complex layers only when your own tests show that they help. When an agent overlooks a rule, first check whether it made it into the prompt at all, and only then adjust how it is presented. And instead of relying on general leaderboards, build evaluations around the tasks the agent is actually expected to perform.

The study also has its limitations. Each test contained only 20 scenarios, so a single case shifts the result for rules by five points. The prompts themselves were also written not by humans but by a language model. The authors point out one more issue. Memory that independently applies previously provided instructions will just as readily use instructions that are outdated or incorrect. Users should therefore be able to see what the system remembers about them and have the option to delete it.

Advertisement

Content created with help from UpTier.

SEO and GEO on autopilot. UpTier’s multi-agent systems write and optimize content for search engines and AI answers.

Discover UpTier ↗

Category:AI
Did you enjoy this article?
Discover more interesting posts on our blog
Back to blog

Related posts

Anthropic CEO Delays New Model Training and Calls for Strict AI LawsAnthropic CEO Delays New Model Training and Calls for Strict AI Laws
Anthropic wants to slow the development of the most powerful AI with a waiting period and delayed training. Its CEO is also proposing a law mandating tests, oversight, and capability limits.
6 min read
2. 12. 2026
How to stop Google from training AI on your searchesHow to stop Google from training AI on your searches
Google now lets you keep search history enabled while preventing it from being used to train AI. Note that older data must be deleted manually.
3 min read
2. 12. 2026
NVIDIA introduces Model Risk Bench to assess AI model risksNVIDIA introduces Model Risk Bench to assess AI model risks
Model Risk Bench is designed to help developers and businesses identify and mitigate AI model risks. It includes more than 65 contributions from across the ecosystem.
1 min read
2. 12. 2026
Přihlaste se k odběru našeho newsletteru
Zůstaňte informováni o nejnovějších příspěvcích, exkluzivních nabídkách, a aktualizacích.
CodedTrip

Operated by CodedTrip LLC, USA.

YouTube
TikTok