Episodic
Episodic memories capture things that happened during past interactions. Think of them as a timestamped event log: a complaint the user filed, a product they purchased, a support ticket they opened, or a decision made in a previous session. Because episodic memories are inherently time-bound, MemLayer’s recency signal naturally surfaces the most recent events first when you query. Usememory_type="episodic" when you want to remember what occurred:
Semantic
Semantic memories hold stable facts about the user — information that rarely changes and doesn’t have a meaningful timestamp. A user’s city, job title, preferred language, dietary restrictions, or subscription tier are all semantic. Because these facts stay relevant across many sessions, they benefit less from recency scoring and more from direct similarity matching. Usememory_type="semantic" when you want to remember what is true about the user:
Summary
Summary memories are compressed representations of older episodic memories. MemLayer auto-generates summaries as your episodic log grows, collapsing older events into a single dense memory so your agent’s recalled context stays within token limits. You can also store summaries manually — for example, to inject a session recap at the start of a new conversation.Auto-generated summaries are created by MemLayer in the background — you don’t need to trigger them manually. They appear alongside episodic and semantic memories in recall results.
Choosing the Right Type
| Type | Best for | Example |
|---|---|---|
episodic | Events, interactions, and timestamped occurrences | ”User cancelled their order on 2024-10-15” |
semantic | Stable facts and persistent user attributes | ”User prefers dark mode and communicates in Spanish” |
summary | Compressed digests of older episodic history | ”User had 4 support tickets in Q3, all billing-related” |
Filtering by Type
Passmemory_type to recall() to restrict results to a specific category. This is especially useful when your agent has separate retrieval paths — for example, fetching stable user facts before a conversation starts, then fetching relevant events during it.
memory_type entirely to search across all three types in a single call — MemLayer’s hybrid scorer will rank the best matches regardless of type.