Course contentsShow
← AI Engineering
Lesson 603 of 1,88615. AI Agents - ArchitectureFree lesson

Memory Write Operations and Updates

Define when and how agents decide to store new information versus update or discard existing memories.

Memory Write Operations and Updates

You'll learn: How AI agents decide whether to store, update, or discard information in their memory systems.

The Memory Management Decision

When an agent processes new information, it faces a critical choice: should this go into memory? Should it replace something already there? Or should it be ignored?

Think of an agent's memory like your email inbox. Not every message deserves to be saved—some are deleted immediately, some update existing conversations, and only important new information gets filed away. Agents need similar rules to avoid memory bloat and maintain relevance.

Write Operation Types

Store (Insert): When the agent encounters genuinely new information that doesn't overlap with existing memories. For example, learning a user's name for the first time goes straight into memory.

Update (Modify): When new information refines or contradicts existing memories. If a user says "I live in Seattle" and later "Actually, I moved to Portland," the agent should update rather than store both facts.

Discard (Skip): When information is transient, redundant, or below a relevance threshold. Casual greetings like "how are you" typically don't warrant permanent storage.

Decision Criteria

Agents typically evaluate:

  • Relevance: Does this matter for future interactions?
  • Novelty: Is this truly new information?
  • Confidence: How certain are we this information is correct?
  • Similarity: Does this overlap with existing memories? (Using vector similarity scores or entity matching from your memory retrieval strategies)

The agent might use embedding similarity to check if incoming information is semantically close to existing memories, then decide whether to merge, replace, or keep both.

Key Takeaway: Agents use relevance, novelty, and similarity checks to decide whether new information should be stored fresh, merged with existing memories, or discarded—preventing memory bloat while maintaining accuracy.