memory_type: what is real and what is not
Mem0 has a memory_type argument and an enum with three values. Two of them do not work, and knowing which saves you an afternoon.
Search for Mem0 and you will read about semantic, episodic and procedural memory, as though picking one were part of the design. In the shipped library only one of the three is wired up.
from pretend_mem0 import memory
shop = memory()
try:
shop.add("I prefer email updates.", user_id="ravi",
memory_type="semantic_memory")
except Exception as refused:
print(type(refused).__name__)
print(refused)Rejected, and the message tells you the only accepted value. episodic_memory behaves the same way. They exist in the enum and nothing else in the library reads them.
The one that works
procedural_memory stores how a task is done rather than a fact about a person, and it needs an agent_id because a procedure belongs to the assistant, not the customer.
shop.add(
[
{"role": "user", "content": "Refund order A17"},
{"role": "assistant", "content": "1. Check the order. 2. Confirm. 3. Refund."},
],
agent_id="support-agent",
memory_type="procedural_memory",
)memory_type out and you get an ordinary memory. There is no semantic or episodic path for it to fall into, and no default that quietly does something else. Every memory in the rest of this course is an ordinary one.What the three words actually mean
They come from psychology and they are useful vocabulary even where the library does not implement them. Semantic is a fact: Ravi prefers email. Episodic is an event: on Tuesday Ravi complained about a late order. Procedural is a method: this is how a refund is processed.
Mem0 stores facts and events in the same pile and lets you tell them apart with the metadata from lesson 13, which is honestly the more flexible answer. If you want episodic memories, tag them.
- Run the same snippet with
episodic_memoryand confirm the error matches. - Store a procedure with
agent_idand look at what gets kept. - Use
metadata={"kind": "event"}to build your own episodic memories, and filter on it.
This is what real progress feels like.