Short-term memory
Short-term memory holds the raw, verbatim text of every message in a conversation. Nothing is summarized or interpreted — STM is an exact record of what was said. When you ask your AI to recall something from earlier in a session, STM is what surfaces that context. It’s also the source used bycrystal_search_messages and crystal_recent.
STM has a rolling retention window based on your plan:
| Plan | STM retention |
|---|---|
| Free | 30 days |
| Pro | 60 days |
| Ultra | 90 days |
Long-term memory
Long-term memory holds distilled facts extracted from your conversations. After each turn, Memory Crystal runs an extraction pass and pulls out what’s worth keeping — decisions, lessons, people, rules, goals, and more. Those extractions are embedded as vectors and stored permanently. LTM is what lets your AI remember something you said three months ago in a completely different session. It’s not searching raw text — it’s searching a structured knowledge base built from everything you’ve discussed. LTM memories persist indefinitely unless you explicitly archive or delete them.Comparison
| Short-term memory (STM) | Long-term memory (LTM) | |
|---|---|---|
| Content | Raw messages, verbatim | Extracted facts, decisions, lessons, people, rules |
| Retention | Rolling window (7–90 days by tier) | Forever |
| Search | Hybrid BM25 + vector | Vector-indexed semantic search |
| Written by | Capture hook, automatically | LLM extraction after each turn |
| Purpose | Recent context and continuity | Persistent knowledge across sessions |
How they work together
Before every response, the Context Engine searches both layers simultaneously. STM provides recent conversational continuity — what you’ve been discussing right now. LTM provides durable knowledge — what your AI has learned over time.You don’t choose which layer to search. The Context Engine queries both and merges the results before ranking them. The most relevant memories from either layer are injected into the model context automatically.
Memory lifecycle
Extraction runs
After the response, Memory Crystal passes the conversation turn to an LLM that extracts up to three durable memories and writes them to LTM.
