SDK
Coming from Mem0
What maps directly, and what's different, if you already know Mem0.
| Mem0 | cortexlayer |
|---|---|
Memory() (embedded) | Memory() |
MemoryClient(api_key=...) (hosted) | CortexClient(api_key=...) |
m.add(messages, user_id=...) | m.add(text, user_id=...) |
m.search(query, user_id=...) | m.search(query, user_id=...) — results add via / linked_from provenance |
m.get_all(...) / m.get(id) | m.get_all() / m.get(id) |
m.update(id, data) / m.delete(id) / m.delete_all(...) | m.update(id, text) / m.delete(id) / m.delete_all(user_id=) |
| — | m.relink() — Cortex links pages in a batch pass, never per insert |
Differences worth knowing:
- Cortex takes plain text, not chat-message lists.
- The default
rawengine stores your text as small pages and links them by shared entities, so adding never needs an LLM.Memory(backend="facts")is the Mem0-style engine that extracts facts with an LLM, for when you want that behavior specifically. - On
CortexClientthere is nouser_idargument: each API key belongs to exactly one user.