个人智能体的记忆并非越长越好,规则与代码各有适用场景
作者指出个人智能体的记忆并非越多越好,相关笔记超过一定长度后反而会让智能体漏掉规则,建议凡是需要计数或追踪的事项改用代码实现,记忆保持简短。文中给出数据:对于持续累加的消费总额,仅用文字规则时失败率达 44%,改用代码维护则失败 0%;在 Claude Haiku 4.5 上,无记忆时违规率 77%,10 行记忆降到 20%,记忆更长后又升至约 25%。
编辑精选:对个人智能体设计有直接参考价值,区分适合用记忆表达的偏好与应由代码维护的状态,并给出记忆长度的实验对比。结论限于文中测试条件。
More memory does not keep helping personal agents, because relevant notes help up to a point and then extra lines start making the agent miss rules.
A personal agent can't learn every user preference through memory notes, and more notes eventually make it worse, so use code for anything it must count or track and keep memory short.
Written rules work for style, like signing texts with the user's first name. For a running spending total, a stated rule still failed 44% of the time, while code that kept the total failed 0%.
Memory size has a sweet spot. With Claude Haiku 4.5, violations dropped from 77% with no memory to 20% at 10 lines, then rose to about 25% with longer memories.
Agents that rewrite their own memory from user complaints improve early, then stall. The best methods ended near 48% violations, against 7.1% when the agent was simply told every preference.
来源:rohanpaul_ai · x.com