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 Mem0 also does

This course teaches the open source library and the parts of it an application needs. Mem0 is bigger than that, and knowing the shape of the rest is worth ten minutes.

Graph memory

Alongside the vector store, Mem0 can keep a graph of entities and the relationships between them: Ravi works at a company, the company has an account, the account has orders. A vector search finds sentences that sound like your question; a graph answers questions about how things connect, which sentences alone cannot.

It needs a graph database, Neo4j or Memgraph or Kuzu, which is why it is not in this course. Turn it on with a graph_store block in the same configuration dictionary, and memories then go to both stores.

Async

AsyncMemory is the same API with await in front of it. In a web application that matters, because add waits on a model call and blocking a request handler on that is how a service falls over under load.

python
from mem0 import AsyncMemory

shop = await AsyncMemory.from_config(config)
await shop.add("Deliver to my office.", user_id="ravi")

Rerankers

search takes rerank=True, which runs a second, slower model over the top results to order them better than the embedding distance alone did. It is the standard answer when search returns the right memory in third place.

The hosted platform

MemoryClient talks to Mem0's hosted service instead of your own store. The API is close but not identical to the open source Memory, and most tutorials you will find teach that one, which is worth knowing when a snippet you copy does not run.

Not covered hereWhat it is
Graph memoryEntities and relationships, in Neo4j, Memgraph or Kuzu
AsyncMemoryThe same API, awaitable
RerankersA second pass that reorders search results
The platformThe hosted service and its MemoryClient
MultimodalStoring memories from images
The REST serverMem0 as a service you call over HTTP
OpenAI compatibilityA drop-in wrapper around the chat completions API
Around thirty vector storesChroma, pgvector, Redis, Pinecone, Weaviate and the rest
The TypeScript SDKThe same ideas, in Node
The open source library and the platform are not the same product. They share a name and most of a vocabulary. Before copying any Mem0 snippet, check whether it builds a Memory or a MemoryClient, because the arguments differ and the error messages will not tell you why.
Try it yourself
  • Look up the graph_store config block and decide whether your data needs one.
  • Rewrite one lesson from part 3 using AsyncMemory.
  • Add rerank=True to a search and see whether the order changes.

Every expert started right here.