Skip to main content

How Memory Works

How your agents learn and remember from conversations.

CrabShack's memory system has three main stages: extraction (learning from conversations), injection (recalling relevant memories), and maintenance (keeping memories accurate and current).

Automatic Extraction​

After each agent session ends, CrabShack reviews the conversation and extracts key information — things like user preferences, decisions that were made, important facts, corrections, and lessons learned. This happens automatically in the background without any action on your part.

Each session can produce up to 20 memories. The system is selective — it focuses on information that would be genuinely useful in future conversations, not every detail mentioned.

note

Extraction quality depends on the conversation. Short exchanges or highly repetitive sessions may produce fewer useful memories. Rich, substantive conversations tend to yield better results.

Deduplication​

Before saving a new memory, CrabShack checks whether something very similar already exists. If your agent already knows that "the client prefers weekly updates," it won't store a near-duplicate version from a later conversation. This keeps the memory store clean and avoids wasting context on redundant information.

Context Injection​

When a new conversation starts, CrabShack determines which memories are relevant and includes them in the agent's context. The agent doesn't need to explicitly "remember" — relevant memories are provided automatically based on the topic of conversation.

Not all memories are included every time. The system uses a relevance scoring approach:

  • High-priority memories (the "hot" tier) are always included, regardless of the conversation topic
  • Other memories are included only when they're relevant to the current conversation, with higher-priority memories given preference

This ensures the agent has the most useful context without being overwhelmed by every memory it has ever stored. See Tiers & Lifecycle for details on how memory priority works.

Security​

Recalled memories are scanned for manipulation patterns before they reach the agent. This protects against a specific kind of attack where someone tries to plant malicious instructions in a conversation, hoping they'll be extracted as a memory and followed later.

If a recalled memory contains suspicious content, it's flagged and excluded from the agent's context. You can review flagged memories in the Memory dashboard.

For more on this protection, see the Memory Guard in the security documentation.

Startup Processing​

When CrabShack restarts, it checks for any sessions that occurred since the last extraction run and processes them. This ensures no conversations are missed, even if the system was offline when a session ended.