My support bot stopped forgetting everything when I changed AI memory write triggers
说明与用途
支持机器人通过将内存写入限制为五种事件类型:确认事实、偏好更改、状态更改、决策和结果,停止忘记细节。
问题
The support bot repeatedly asked customers to repeat actions they had already performed, indicating it was not retaining relevant case history.
结果
After restricting memory writes to five event types, retrieval became cleaner, the bot no longer repeated redundant steps, and customer interactions were more efficient.
工作流
- 1. Identify event type from conversation turn
- 2. Apply shouldWriteMemory filter to decide if event should be stored
- 3. If true, create structured event JSON and write to pgvector
- 4. During retrieval, fetch recent relevant events and build memory context
- 5. Pass context to LLM for next turn
证据
The rule that fixed my support agent: write memory only on 5 event types — confirmed facts, preference changes, state-changing troubleshooting steps, decisions, and outcomes.
I stopped writing every turn and only wrote memory on 5 event types.
Once I did that, retrieval got smaller, cleaner, and actually useful.
- 记录日期: 2026-10-03T23:55:53.028Z