Mem0mem0ai 2.0.20 · Python 3.10+
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
24 small wins to finish your pathNext lesson

What you are going to build

Mem0 is a memory layer for an assistant. It reads a conversation, decides what is worth keeping, stores it, and finds it again next time the same person turns up. This course builds that for one support assistant, and every lesson runs on your machine with no API key.

An assistant without memory meets every customer for the first time, every time. They tell it their delivery address on Monday and it asks again on Tuesday. Mem0 is the piece that fixes that, and it is a small library with a large amount of behaviour hidden inside two method calls.

Memory, working

Example
from pretend_mem0 import memory

shop = memory()
shop.add("I prefer email updates, not SMS. Deliver to my office.", user_id="ravi")

for hit in shop.search("email updates", filters={"user_id": "ravi"})["results"]:
    print(round(hit["score"], 2), hit["memory"])

One sentence went in and came back as separate memories, scored against a question. Nobody wrote a database schema and nobody called an API.

pretend_mem0 is a stand-in model and a stand-in embedder that you write in lessons 5 and 6. Mem0 needs a model to decide what is worth remembering and an embedder to search; by default both are OpenAI, and the stand-ins make the whole course free to run.

No API key, and no downloads either

Other offline Mem0 guides exist, and every one of them asks you to install Ollama, pull a model of several gigabytes, and run a vector database in Docker before lesson one. This course asks for none of that. The model and the embedder are about forty lines of Python between them, and the store runs inside the process.

Lesson 19 shows the two lines that swap in a real model, and says plainly what changes when you do.

What you will have built

PieceWhat it doesLesson
A stand-in modelDecides what is worth keeping, with no key5
A stand-in embedderTurns text into a vector so search works6
add and searchThe two calls that do nearly everything8 and 9
IdentifiersWhose memory this is: user, agent, run12
MetadataTags you can filter on later13
update, delete, historyMemories change, and you can see how15 and 16
Custom instructionsSteering what gets kept17
A tested assistantMemory in the reply loop, with evals21 to 23
Where the course goes
The three piecesThe callsScopeReal workMem0

What you need

  • Python 3.10 or newer.
  • pip install mem0ai langchain langchain-core. Lesson 3 explains why the langchain packages are there.
  • No account, no key, no card, no Docker.
Try it yourself
  • Read the table above and pick the row you most want. That is the lesson to look forward to.
  • Think of one thing your own assistant asks users twice. That is what this course is for.
Back toAll frameworks

Every expert started right here.