AI Agent Memory: Practical Limits of Self-Improvement
Memory-driven self-improvement requires more than storing conversation history. This article examines why agent rules can fail across models, how memory quality and retrieval affect reliability, and why automated evaluation can reinforce the wrong behaviors. It outlines engineering boundaries for versioning, validation, security, cost control, and rollback.
An AI agent that retains memory and improves autonomously needs more than a longer conversation history. It must turn successful actions, failure causes, and task constraints into reusable rules, then retrieve, revise, and validate those rules in later tasks.
An observation in the source material illustrates the challenge: a set of working rules tuned on Model A initially scored only about 68 when transferred to Model B for office tasks. Yet Model B scored about 74 using the original rules, before that round of transfer-specific refinement. Rules are therefore not model-independent text assets. Transferring them can change the agent’s behavior.
What Does Self-Improvement Actually Optimize?
A working self-improvement loop typically has four stages: execute a task, record the execution trace, derive rules, and rerun tasks with the new rules for evaluation.
Memory should distinguish at least three types of information:
- Factual memory: User preferences, document locations, and interface conventions.
- Procedural memory: Task decomposition, when to call tools, and how to recover from failures.
- Evaluation memory: What counts as completion and which outputs are considered unacceptable.
When these are combined into a single “lesson learned,” later iterations cannot reliably determine whether to change a fact, a workflow, or an evaluation criterion.
For example, detailed meeting minutes may reflect comprehensive source material—or a rule that rewards excessive detail. If the system reduces that outcome to “always write more detailed minutes,” the next iteration may systematically move away from the actual objective.
Why Cross-Model Rule Transfer Can Lower Scores
Rule text can be copied; a model’s interpretation of that text cannot.
Models differ in instruction following, tool-call formatting, attention over long contexts, and refusal thresholds. A rule that works for Model A may depend on its implicit reasoning habits. Model B may interpret the same wording as a stricter constraint, leading it to call fewer tools, stop too early, or produce overly cautious answers when uncertain.
Transfer experiments should therefore version the rule set and model together, rather than versioning rules alone. At minimum, comparisons should include:
- The target model’s native rules.
- The transferred rules without target-model calibration.
- The transferred rules after recalibration on a small validation set using the target model.
Looking only at the transferred setup’s absolute score mixes differences in model capability with rule incompatibility. The scores above show that uncalibrated transfer can perform worse than the target model’s own starting point. Continuing along the source model’s optimization path may amplify that mismatch.
Engineering Bottlenecks in Memory Writes and Retrieval
Memory write quality
Execution traces contain intermediate drafts, retries, and accidental successes. Storing everything lets noise overwhelm reusable procedures during retrieval. Storing only final answers loses the reasons for failure.
A more reliable approach is to create a structured summary before writing to memory:
- Task objective.
- Key constraints.
- Steps taken.
- Steps abandoned.
- Verifiable evidence of the result.
An independent check should approve that summary before it enters long-term memory. The generation that produced it should not also be responsible for approving it.
Retrieval relevance
Office tasks often share similar wording, while their meaningful differences lie in permissions, deadlines, audiences, and acceptable error types. Retrieving “how we wrote a weekly report before” through semantic similarity alone may import another department’s reporting conventions.
Retrieval keys should include task type, risk level, data domain, and rule version. The number of memories injected into a single execution should also be limited so that old rules do not crowd out the current task context.
Update conflicts
When a new rule contradicts an old one, the latest write should not automatically win. Rules need applicability boundaries and conditions under which they no longer apply.
For example, “ask the user for supporting material only when the original attachments are missing” is a scoped rule. Replacing it with “always ask a follow-up question first” changes behavior globally.
Without explicit scope, successive iterations can turn memory into an expanding list of conflicting instructions.
Evaluation Loops Can Reinforce the Wrong Behaviors
Self-improvement depends on automated scoring. But when the evaluator and executor share the same underlying model, the agent may learn to satisfy the evaluator’s superficial preferences.
In office tasks, output length, formatting keywords, and citation counts are easy to inflate. Whether facts were checked or materials were used without authorization is harder to judge automatically. A higher score does not necessarily mean better task performance.
Evaluation should be separated by concern:
- Use rule-based checks for formatting and workflow compliance.
- Require traceable evidence for facts and citations.
- Retain human spot checks for subjective quality.
Each iteration should modify only a limited number of rules. A fixed regression set should track pass rate, severe-error rate, and human rejection rate together. If automated scores rise while severe errors or human rejections also increase, roll back that iteration’s memory changes rather than continuing to optimize.
The regression set can also become outdated. Changes in business policies, templates, or permissions can turn previously high-scoring examples into incorrect guidance. Memory records need expiration dates, responsible owners, and a relabeling process. Otherwise, increasing familiarity can become increasing divergence from current requirements.
Security, Cost, and Observability
Security boundaries
Autonomous rule changes expand the scope of what an agent can do. A temporary exception may become a lasting policy—for example, skipping approval, aggregating fields that should remain separate, or repeatedly calling external tools after a failure.
Memory writes must pass through policy filtering. Information involving identity, permissions, external actions, or data leaving its authorized boundary should not be automatically made persistent. It should become a proposal for review instead.
Cost control
Repeated self-reflection, full-trace storage, and recurring evaluations can quickly increase token and storage costs.
Enable iterative rule updates for high-value, repeatable tasks with clearly understood error costs. For one-off, low-risk tasks, record outcomes without automatically changing rules.
Store sampled traces rather than every trace in full. Keep raw, lengthy logs in object storage, while online memory contains only short summaries and indexes.
Observability and rollback
Observability determines whether the system can be stopped safely. Every execution should be traceable to:
- The memories it used.
- The rule version it followed.
- The evaluation that assessed it.
- Any human modifications.
Without this chain, production incidents cannot be attributed reliably to model drift, memory contamination, or evaluator changes.
Container platforms, logging, monitoring, and alerts should expose versions, failure rates, and rollback points. The iteration process should not become an unauditable black box.
In general-purpose cloud environments such as Baidu AI Cloud, memory stores, rule versions, and evaluation records should likewise be stored separately to support permission isolation and version-based rollback. Conversation history alone is not a governance mechanism.
Practical Boundaries for Deployment
Limit autonomous improvement to a propose–validate–publish workflow, rather than allowing agents to rewrite production rules while executing tasks.
Candidate rules should first run against shadow traffic or a small regression sample. Publish them only after they meet agreed thresholds. After publication, establish an observation window and automatically return to the previous stable version if severe errors exceed the threshold.
Humans should retain veto authority, especially for external communications, permission changes, and aggregation across data domains.
The core state transitions do not need to depend on a particular product interface:
draft_rule -> regression_check -> human_or_policy_gate -> publishedpublished + severe_error_spike -> rollback(previous_version)
For developers, the first priorities are structured memory, version comparisons, and rollback—not fully unattended self-rewriting.
When moving rules between models, treat source-environment rules as hypotheses. Recalibrate them on the target model while preserving that model’s native baseline. Transferred rules should enter long-term memory only when they consistently outperform the baseline on the regression set without increasing severe errors.
The value of autonomous improvement lies in preserving verifiable experience from repeated work. Its practical limits are rule portability, memory contamination, self-reinforcing evaluation, and insufficient boundaries around permissions and cost.
Treating memory as version-controlled configuration, rather than an ever-growing conversation, is what can turn a demonstration into a sustainable engineering system.
