Mem0 + Neo4j | Memory Layer for Agentic AI System

AI Anytime · Intermediate ·🛠️ AI Tools & Apps ·6mo ago

Key Takeaways

The video demonstrates integrating Mem0 with Neo4j to create a self-improving memory layer for agentic AI systems, utilizing vector stores and graph-based memory for personalized and contextualized information retention. Tools such as MEM0, Neo4j, and OpenAI are used to build a complete Mem0 Playground application.

Full Transcript

Hey, how it's going guys? In this video, we're going to build an agentic system with memory in place, right? And memory is one of the most challenging thing when it comes to building agentic AI application. If you look at here on my screen, I have built this agentic AI application with a memory layer. And for all the things memory, I'm using MEM zero. Uh this video is not at all sponsored by MERO. I like using MERO uh because I believe that it's really powerful if you want to build aic AI applications with memory. Uh if you are building aic system today in 2026, memory should be your focus because memory is the only thing which is holding agentic AI system back. Okay. Uh and memory can be of different types. It can be long-term, short-term, episodic and it can have a lot of problems like uh forgetting the memory, the context management, the DKs and whatnot, right? And building an enterprisegrade memory is even a bigger challenge. That's what I have been uh working on. I'm going to show you this in this video and this will be entirely available on my GitHub repository, my GitHub uh account of course and it's already there. It's called Mimiro aentic graph rag or whatever. Okay. And uh if you look at this, it's called build AI that remembers. Okay, that's the elevator pitch. Me zero basically is provides a selfimproving memory layer for agentic AI application. So for the agents, you need LLM, you need some tools and you need memory in place. If you have that, you are good to go with this you know agentic system. Now here the thing is uh it also helps you in personalization. So personalizing the AI experiences with persisting the context across conversations across roles across users right that's what it is now here if you see I have two tabs one is called AI assistant with memory says by powered by me0ero plus neoforj graph store. So I'm using Neo4j for all the graph thingy right I I'm using Neo4j you can see my instance is running here it's called instance 01 okay I'm using Aura DB uh from new Neo4j right now why I'm using it because MJ zero has this graph memory so where you can have uh this memory layer it can have a relationships onto me zero search so agents remember who did what when and with whom so the relationships between uh you know uh it plays a huge role right with notes and ages and and whatnot. So here is the documentation you can go ahead and look at this uh look at this documentation later. Now I'm using MEMJ zero because it supports vector stores. Okay. And that's why I support MEM zero uh because it's it's really good open source. Have a look at it. If you look at the documentation here, it takes you to the build with mero documentation. Universal self improving memory layer as I said in the beginning. Okay. It also has now platform. Now you can also use it through their cloud service like as an API because not everybody might be technical where they can go and work with open source. So they might need some serverless or some kind of API SDKs to work with. Then we also have a way to use open source meros like self hosting it right and then we have open memory works mostly with MCPS I have that uh a video on my channel as well have a look at that I'll give the link in description now coming back to it if you look at here so this AI assistant uh it says share something about yourself and I will remember it try telling me your name interests or any important information right and let's say here it says no memory yet You can look at this memory store. So we also have a memory store. Uh and it says no memories yet. It says start chatting and the AI will remember important information about you. So the good thing is we're bringing graphs here, right? Neo4j. Now see why why I will tell you that is important. Whatever we have been working in the last couple of years when it comes to LLMs and agents and LM as a core because agents are like mostly like a technique but LLMs are the probabistic models. They are probabistic. they are not deterministic. They even don't know what will be the next token they will predict. Okay. So uh and that's a challenging thing. So when you bring graph because graph is deterministic because you're going to work with uh relationships of intents entities and whatnot and that's why it's really important to combine that with your LM workflows. Now uh how does it work? How mem works? We'll come to demo in a bit. I'll give you a walk through of the code as well. Not a big deal. But how how MJO works is important, right? Now [snorts] me zero you can add a memory. If you look at here it says store conversations and important user. You can search memory so you can find relevant information using semantic search because again the search happens in n dimensional vector spaces. Let's say if you're using graph stores or a DB it happens the same way. You can retrieve specific memories by ID and that's really important and you can handle the content or context management really well and then graph relationship store and query relationships between entities using Neo4j. Uh this is how you initialize it. If you look at the setup okay uh this also supports you can do it in Python you can do it in uh you know different languages as well like let's say it has it supports both Python and Node. So it supports both JavaScript and Python. So anybody who is good with [snorts] any of these languages, they can work with it. Right? Now add memory. This is how you add memory. You can look at this right search. This is how the semantic search happens across memories. Uh see that here and AI SDK tools. Now uh as I said right vector store so it's supported me supports vector store and that's why it's really powerful. Okay. All right. So let's ask a question here. Right. So if you look at this tab here AI assistant with memory basically uses GPT40 model because that can also use tools. So if I ask here let's say uh I like uh AI and have interest in let's say I'm writing this knowledge distillation or something. Now when I enter it you can look at here it says creating memory right? So what it's going to do is it's going to create that memory object for us. If you look at this memory store currently it says zero memory stored right no memory stored and it's going to happen through me zero right so you look at here it says creating memory done I will remember that you like AI and have an interest in knowledge distillation if there's anything specific you would like to know or discuss about this topics feel free to ask right if I refresh this you will see user likes AI user has interest in knowledge distillation so these kind of memory kind of gets created now the thing here is that it all you have to you have to be careful about what kind of information you want to keep it in your context right so those kind of engineering may you bring into this if you're working in a production setting but that should be fine for now right so let's ask more question uh knowledge distillation uh is a technique uh is a technique used by let's say deepsek uh China uh to create the frugal based lm something I'm saying yeah so again creating memory so the memory gets created now the thing here is if you look at this right everything is happening in JavaScript the entire thing that you see so see if I'll show you over here let's go up if you look at this the memory created successfully the objects gets created uh with all the metadata the tags and everything gets gets created over here and this is our file so we have a vector stored db as I said previously and then we have a memory dot uh DB as well that of course you can look at these databases uh through some database explorer if you want to have it now that's what it is creating memory and if you refresh here are the memory created you can look at knowledge distillation is a technique used by divic China to create the frugal based LLM now the thing is when you work with Neo4j make sure that your instance is not stopped it's running that's very important to see uh so I'll just come back over here okay and ask like you keep on asking question uh what do I like I mean let's see if it's able to answer it uh okay I'll just write this so now it says searching memories right now search sometimes may fail because of neoforj if you want but most of the time make sure if it's failing then look at your neoforj thing right it may be stopped if you look at it says you like AI and have an interest in knowledge distillation if there's anything else you'd like to add or discuss just let me know so the beauty of this is that you know it's it's able to kind of get your I'll just take a of course a screenshot for this this will be used now the beauty of this is that it's really really powerful uh when you're building aentic system because I said agentic system it's mostly today's about uh you know it's today about memory so uh if you are interested uh in memory look at super me look at me zero look at hello me there are different uh you know frameworks libraries to work with. So if I'll show you over here, let's just go back to my repositories. I'll show you a couple of repositories that I have recently created on hello as well. So if you look at this uh here hello memory demo this is something that's also very important. Uh this is what I built the memory crisis in AI because that's a big issue right when it comes to building memory layer for agentic system. But M0ero comes really closer one of my favorite because it has compatibility with vector stores and you can look at Neo4j for example which is fantastic. I'll give this code of course this is available on my GitHub repos. So please have a look at that. Uh and if you have any question, thoughts or feedbacks, let me know in the comment box. Now if you like this video, please hit the like icon and if you haven't subscribed the channel yet, please do subscribe the channel guys. That motivates me to create more such videos in near future. Uh please share this video and channel with your friends and to peer. That's all for this video. Thank you so much for watching. See you in the next one.

Original Description

In this video, I walk you through building a complete Mem0 Playground application - an enterprise-grade demonstration of how to add persistent memory capabilities to AI applications using Mem0, Neo4j Graph Store, and OpenAI. What You'll See in This Video 🔹 Integrating Mem0 AI memory layer with vector store capabilities 🔹 Setting up Neo4j Graph Store for entity relationship mapping 🔹 Creating memory tools (search, create, get, delete) with AI SDK 🔹 Implementing streaming AI chat with tool calling 🙏 Support the Channel If you found this tutorial helpful, please LIKE 👍, COMMENT 💬, and SUBSCRIBE 🔔 to stay updated with more AI development tutorials! Get the Agentic AI Master Bundle Kit: https://aianytime5.gumroad.com/l/uqmyk AI Agents Projects Mega Bundle – 6 SaaS/Tools in One: https://aianytime5.gumroad.com/l/fbeifc GitHub: https://github.com/AIAnytime/Mem0-Agentic-Memory-Layer Build real-world AI with tutorials, tools, and research from India’s fastest-growing AI community. 👤 Creator’s LinkedIn (Sonu Kumar) Portfolio Site: https://sonukumar.site/ 🌐 AI Anytime's Website: https://aianytime.net/ 🗓️ Office Hours (AI Consulting): https://officehours.aianytime.net/ 👥 LinkedIn (Community Page): https://www.linkedin.com/company/ai-anytime/ 💬 Join Our Discord: https://discord.com/invite/4aGc9PSMgE 👤 Creator’s LinkedIn (Sonu Kumar): https://www.linkedin.com/in/sonukr0/ 🎁 Support the Channel 💸 UPI ID: sonu1000raw@ybl ₿ Bitcoin Wallet: bc1qsneqznxpzyxzzv006jthz4c8v8h5cs57myw342 ✅ Join this Channel for Perks Get access to members-only content and community perks: https://www.youtube.com/channel/UC-zVytOQB62OwMhKRi0TDvg/join #neo4j #agenticai #mem0
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from AI Anytime · AI Anytime · 0 of 60

← Previous Next →
1 Spelling and Grammar Checking Streamlit App: Building Docker Image
Spelling and Grammar Checking Streamlit App: Building Docker Image
AI Anytime
2 Spelling and Grammar Checking Streamlit App: Docker Image and Docker Hub
Spelling and Grammar Checking Streamlit App: Docker Image and Docker Hub
AI Anytime
3 Image Caption Generator: Google Colab and Hugging Face
Image Caption Generator: Google Colab and Hugging Face
AI Anytime
4 Low Code/No Code AI Platform Teachable Machine: Brain MRI Image Classification
Low Code/No Code AI Platform Teachable Machine: Brain MRI Image Classification
AI Anytime
5 Low Code/No Code AI Platform Teachable Machine: Testing the Model
Low Code/No Code AI Platform Teachable Machine: Testing the Model
AI Anytime
6 Low Code/No Code AI Platform: Streamlit App for Brain MRI Image Classification
Low Code/No Code AI Platform: Streamlit App for Brain MRI Image Classification
AI Anytime
7 Readme Generator Streamlit App using ChatGPT
Readme Generator Streamlit App using ChatGPT
AI Anytime
8 Generate Minutes of Meeting (MoM) from Video using ChatGPT: AI as an API
Generate Minutes of Meeting (MoM) from Video using ChatGPT: AI as an API
AI Anytime
9 The Great AI Showdown: ChatGPT vs ChatSonic 🔥
The Great AI Showdown: ChatGPT vs ChatSonic 🔥
AI Anytime
10 Generating Transcripts and News Article with Whisper, GPT-3.5, ChatGPT and Streamlit
Generating Transcripts and News Article with Whisper, GPT-3.5, ChatGPT and Streamlit
AI Anytime
11 Toxicity Classifier using Machine Learning and NLP
Toxicity Classifier using Machine Learning and NLP
AI Anytime
12 Toxicity Classifier API using FastAPI
Toxicity Classifier API using FastAPI
AI Anytime
13 Toxicity Classifier Streamlit App
Toxicity Classifier Streamlit App
AI Anytime
14 Low-Code Insurance Prediction with PyCaret and Streamlit
Low-Code Insurance Prediction with PyCaret and Streamlit
AI Anytime
15 Deploy Streamlit Python Application for Free
Deploy Streamlit Python Application for Free
AI Anytime
16 GPT3 Powered Text Analytics App
GPT3 Powered Text Analytics App
AI Anytime
17 AI Image Generation Streamlit App
AI Image Generation Streamlit App
AI Anytime
18 Streamlit and txtai: Building an Abstractive Summarization App in Python
Streamlit and txtai: Building an Abstractive Summarization App in Python
AI Anytime
19 Building a Topic Modeling and Labeling app with Streamlit
Building a Topic Modeling and Labeling app with Streamlit
AI Anytime
20 The Art of AI: Exploring Midjourney, Dall-E, and Lexica
The Art of AI: Exploring Midjourney, Dall-E, and Lexica
AI Anytime
21 Exploring the latest Large Language Models (LLaMA and Alpaca)
Exploring the latest Large Language Models (LLaMA and Alpaca)
AI Anytime
22 Comparing LLMs like GPT-X, LLaMA, and Alpaca: Analyzing the Perplexity Score
Comparing LLMs like GPT-X, LLaMA, and Alpaca: Analyzing the Perplexity Score
AI Anytime
23 GPT-3 powered Q&A App using Langchain, GPT-Index, and Gradio
GPT-3 powered Q&A App using Langchain, GPT-Index, and Gradio
AI Anytime
24 All things #ai . Latest and greatest in AI. #tech #python #chatgpt #youtubeshorts #shorts #gpt3
All things #ai . Latest and greatest in AI. #tech #python #chatgpt #youtubeshorts #shorts #gpt3
AI Anytime
25 Text-to-Video Generation using a Generative AI Model
Text-to-Video Generation using a Generative AI Model
AI Anytime
26 #ai brand name generator. #artificialintelligence #tech #shorts #youtubeshorts #youtube #chatgpt
#ai brand name generator. #artificialintelligence #tech #shorts #youtubeshorts #youtube #chatgpt
AI Anytime
27 Talking AGI with Sam Altman: A Deepfake Showcase
Talking AGI with Sam Altman: A Deepfake Showcase
AI Anytime
28 A conversation with ChatGPT creator Sam Altman. #tech #technology #ai #shorts #viral
A conversation with ChatGPT creator Sam Altman. #tech #technology #ai #shorts #viral
AI Anytime
29 Get to Know Anthropic's Claude: The Ultimate ChatGPT Competitor
Get to Know Anthropic's Claude: The Ultimate ChatGPT Competitor
AI Anytime
30 #shorts #chatgpt #python #datascience #tech #coding
#shorts #chatgpt #python #datascience #tech #coding
AI Anytime
31 Recipe Generator App from Cooking Videos using Whisper and ChatGPT
Recipe Generator App from Cooking Videos using Whisper and ChatGPT
AI Anytime
32 Segment Anything Model by Meta AI: An Image Segmentation Model
Segment Anything Model by Meta AI: An Image Segmentation Model
AI Anytime
33 One of the best #ai #books based on #tensorflow. #tech #coding #shorts #chatgpt #machinelearning
One of the best #ai #books based on #tensorflow. #tech #coding #shorts #chatgpt #machinelearning
AI Anytime
34 Music Generation using Mubert #ai . #music #shorts #youtubeshorts #chatgpt #generativeai
Music Generation using Mubert #ai . #music #shorts #youtubeshorts #chatgpt #generativeai
AI Anytime
35 Image to Text Prompt: Reverse Engineering AI Image Generation
Image to Text Prompt: Reverse Engineering AI Image Generation
AI Anytime
36 Image Generation for #ramadan using #ai. #midjourney #chatgpt #shorts #youtubeshorts #islam
Image Generation for #ramadan using #ai. #midjourney #chatgpt #shorts #youtubeshorts #islam
AI Anytime
37 How to build an AI-ready organization: Cultivating a Data-Driven Culture
How to build an AI-ready organization: Cultivating a Data-Driven Culture
AI Anytime
38 Midjourney: Generate AI-powered Images
Midjourney: Generate AI-powered Images
AI Anytime
39 Getting Started with Graphs: A Beginner's Guide (Part 1 of GNN Series)
Getting Started with Graphs: A Beginner's Guide (Part 1 of GNN Series)
AI Anytime
40 Build India's First ChatGPT like App for Politics: BJP-GPT
Build India's First ChatGPT like App for Politics: BJP-GPT
AI Anytime
41 Meet BJP-GPT.... @AIAnytime  #bjp #news #shorts #tech #chatgpt #ai #youtubeshorts #coding #video
Meet BJP-GPT.... @AIAnytime #bjp #news #shorts #tech #chatgpt #ai #youtubeshorts #coding #video
AI Anytime
42 ChatPDF... #chatgpt  for PDF files. #ai #generativeai #shorts #youtubeshorts #coding #tech #ai
ChatPDF... #chatgpt for PDF files. #ai #generativeai #shorts #youtubeshorts #coding #tech #ai
AI Anytime
43 Free AI Image Generation #ai #chatgpt #coding #tech #shorts #youtubeshorts #shortvideo #generativeai
Free AI Image Generation #ai #chatgpt #coding #tech #shorts #youtubeshorts #shortvideo #generativeai
AI Anytime
44 Transform old photos into Vibrant Memories with Deoldify AI: Build a Streamlit App
Transform old photos into Vibrant Memories with Deoldify AI: Build a Streamlit App
AI Anytime
45 Open Assistant: The Real Open-sourced LLM
Open Assistant: The Real Open-sourced LLM
AI Anytime
46 Thanks to @YannicKilcherand team for the open sourced LLM Open Assistant. #ai #shorts #tech
Thanks to @YannicKilcherand team for the open sourced LLM Open Assistant. #ai #shorts #tech
AI Anytime
47 Search Engine for AI generated images. #ai #tech #technology #generativeai #chatgpt  #shorts #video
Search Engine for AI generated images. #ai #tech #technology #generativeai #chatgpt #shorts #video
AI Anytime
48 Generative AI Video Platform "Synthesia" #shorts #youtubeshorts #ai #tech #chatgpt #generativeai
Generative AI Video Platform "Synthesia" #shorts #youtubeshorts #ai #tech #chatgpt #generativeai
AI Anytime
49 Text to speech Voice AI platform. #shorts #youtubeshorts #ai #tech #technology #python #coding
Text to speech Voice AI platform. #shorts #youtubeshorts #ai #tech #technology #python #coding
AI Anytime
50 Create Amazing Videos with ChatGPT and Pictory: Free AI-powered Video Creation
Create Amazing Videos with ChatGPT and Pictory: Free AI-powered Video Creation
AI Anytime
51 Want to create beautiful video using #chatgpt and #pictory ? Watch the tutorial on channel. #ai
Want to create beautiful video using #chatgpt and #pictory ? Watch the tutorial on channel. #ai
AI Anytime
52 Animate your photos using AI. Bring old family photos to life. #ai #tech #shorts #shortvideo #coding
Animate your photos using AI. Bring old family photos to life. #ai #tech #shorts #shortvideo #coding
AI Anytime
53 Create a PDF Search and Summarization Tool in less than 100 Lines of Code: GPT-Index and Streamlit
Create a PDF Search and Summarization Tool in less than 100 Lines of Code: GPT-Index and Streamlit
AI Anytime
54 Text to Video Generation using Videocrafter: Intuitive Math behind Latent Diffusion Model
Text to Video Generation using Videocrafter: Intuitive Math behind Latent Diffusion Model
AI Anytime
55 Gamma AI: Create presentation PPT easily with #ai . #chatgpt #shorts #shortvideo #tech #coding
Gamma AI: Create presentation PPT easily with #ai . #chatgpt #shorts #shortvideo #tech #coding
AI Anytime
56 Tripnotes: Free AI tools for your trip planning. #ai #chatgpt #shorts #youtubeshorts #video
Tripnotes: Free AI tools for your trip planning. #ai #chatgpt #shorts #youtubeshorts #video
AI Anytime
57 Meet Bark (New Text to Speech Model): Clone Any Voice to Generate Music and Speech
Meet Bark (New Text to Speech Model): Clone Any Voice to Generate Music and Speech
AI Anytime
58 Fliki: The free AI video creation tool. #ai #shorts #shortvideo #youtubeshorts #chatgpt #tech #news
Fliki: The free AI video creation tool. #ai #shorts #shortvideo #youtubeshorts #chatgpt #tech #news
AI Anytime
59 Ask Anything Tool: Chat with Your Video using ChatGPT, MiniGPT4, and StableLM
Ask Anything Tool: Chat with Your Video using ChatGPT, MiniGPT4, and StableLM
AI Anytime
60 HuggingChat: Open Source ChatGPT (Interface and Model)
HuggingChat: Open Source ChatGPT (Interface and Model)
AI Anytime

This video teaches how to integrate Mem0 with Neo4j to create a self-improving memory layer for agentic AI systems, enabling personalized and contextualized information retention. By following the steps outlined in the video, viewers can build a complete Mem0 Playground application. The memory layer is crucial for agentic AI systems as it allows for the storage and retrieval of memories, enabling the system to learn and improve over time.

Key Takeaways
  1. Initialize memory layer with Mem0 and Neo4j
  2. Add memory to the system
  3. Search memory using semantic search
  4. Retrieve specific memories by ID
  5. Handle content/context management
  6. Combine deterministic graph with probabilistic LLMs
  7. Implement vector stores and graph-based memory
💡 The combination of deterministic graph-based memory with probabilistic LLMs enables more accurate information retention and retrieval in agentic AI systems.

Related Reads

Up next
Google Just Dropped A FREE Marketing Agent And It's INSANE (Pomelli)
Income stream surfers
Watch →