MemGPT ๐Ÿง  LLM as Operating System. It's INSANE! Step-by-Step Tutorial ๐Ÿคฏ

Mervin Praison ยท Beginner ยท๐Ÿง  Large Language Models ยท2y ago

Key Takeaways

This video demonstrates the installation and use of MemGPT, a large language model that utilizes external context to manage its own memory like an operating system, allowing for the creation and loading of personas and humans, and storing and retrieving data.

Full Transcript

mgpt makes llms as operating system hi everyone I'm really excited to show you about mem GPT so what is M GPT we already have a token limit on each large language model so this use something called external context using external context it works same as a ram in your computer so you should be able to store your data and then retrieve it it gives additional memory for a large language model so we going to see how we are going to install this step by step let's get started first get clone and then mgpt once that is Clon go into mem GPT now we going to create the cond environment cond create minus- n mgpt python 3.11 creating that environment proceeding that further next cond activate mgpt that will activate your virtual environment now we are going to install pip install minus r requirements.txt this installs all the required python packages now we are going to export the key open API key which you can generate from open API platform and enter it like this next type Python main.py and enter as soon as you type main.py it will start M GPT then hit enter to begin it's thinking now well come Chad I'm going to say I am mvin present you can see that it's updating the name Chad to mvin it is storing the name in the memory core memory successfully updated now I'm going to save by typing back slave this will create a checkpoint you can use this checkpoint later if required and I'm going to again going to say I am interested in AI now that also will get saved in in the memory I'm going to save that checkpoint you can copy the name of the checkpoint so that when you come back in again you can enter and load it from where you left so I'm going to type back slash exit to exit and immediately I'm going to start again with python main.py hit enter to continue now you can see it's again starting from beginning and it doesn't have the memory the reason is be because when you go to memory back slash memory and enter there you can see a predefined memory given to that Persona you are Sam and the bot is given a personality as a human the person who's talking to it is given a personality here so that's in the memory that's why it's loading that from the start we will soon see how we can change this but Meanwhile we're going to load our previous checkpoint back slash load and click enter what is my name and what I am interested in see you can see your name is mvin prison and you expressed interest in artificial intelligence which is taken from the memory if you see the previous conversation it says hello Chad and when I load the memory you can see everything got updated next we are going to see how to create a Persona and how to create a human so create a file called human. txt this is me who I am talking to so I am Marvin and I am interested in a and Dev Ops and programming so I'm going to save that file and I'm going to create another file called persona. txt that's where I'm going to give the bot a name you are mem GPT you are a helpful assistant that's it I'm going to save that file and exit now in the terminal I'm going to type Python main.py and and then hyphen hyen Persona and persona. txt then human human. txt this is how it should be but just because of the folder structure this is how we are going to do we're going to do dot do/ do do SL do do slash similarly for human we are going to enter do do SL do do SL do do slash because it is going to check the M GPT folder in the examples there's a Persona fold folder there which I can quickly show you so if you see the folder structure inside mem GPT there's a folder called humans and there's another folder called personas that's where the file what we created persona. txt and human. txt should be there but just because we have created on the home folder we have to mention where the file we have created the personal. txt and the human. txt so to refer that that's why we mention Python main.py and then hyphen Persona doers. txt and refer that file that it is in current directory and then click enter hit enter to begin now you can see the Persona it is saying welcome mvin and it is saying I'm interested in devops I'm going to ask what is your name you call me m GPT yeah that's it you are retrieving the Persona and and human characteristics from those files this is a just a beginner's guide I'm going to extend this further and show you more advanced tutorial on how to read from a SQL database and also memory from your own documents and make this chatbot be able to respond to those data if you like this video do like share and subscribe and thanks for watching

Original Description

๐Ÿ‘‹ Hey everyone! Welcome to this INCREDIBLE tutorial on MemGPT, the AI that manages its own memory just like an operating system! ๐Ÿค– ๐Ÿ”ฅ What You'll Learn: How MemGPT works like RAM in your computer ๐Ÿ–ฅ๏ธ Step-by-step installation guide ๐Ÿ› ๏ธ How to create and load Personas and Humans in MemGPT ๐Ÿ‘ฅ How to save and retrieve data in MemGPT ๐Ÿ“ฆ ๐Ÿ‘‰ Don't forget to LIKE, SHARE, and SUBSCRIBE for more mind-blowing AI content! ๐Ÿ™ ๐Ÿ•’ Timestamps: 0:00 Introduction 0:07 What is MemGPT? 0:35 Installation Steps 1:00 Python Packages 1:22 Running MemGPT 2:01 Saving Checkpoints 3:15 Creating Personas 4:00 Running with Custom Persona 5:34 Advanced Tutorial Teaser 1. MemGPT aims to make LLMs (Large Language Models) manage their own memory. 2. Inspired by OS virtual memory. 3. Solves limited context issue in extended conversations and document analysis. 4. Uses tiered memory system and function calls. 5. Evaluated in document analysis and multi-session chat. pip install -r requirements.txt export OPENAI_API_KEY=YOUR_API_KEY python3 main.py python main.py --human ../../../human.txt --persona ../../../persona.txt --persona # load specific persona file --human # load specific human file /exit # exit CLI /save # save state /load # load state /dump # view message log /memory # view agent memory # assuming you created a new file /memgpt/humans/examples/human.txt python main.py --human human.txt #MemGPT, #AIMemoryManagement, #LargeLanguageModels, #AITutorial, #MemGPTInstallation, #Python, #AI, #MemGPTCheckpoints, #MemGPTPersona, #CustomAI, #AdvancedAI, #OpenAI, #API, #OperatingSystem, #RAM, #Computer, #Memory, #Data, #Storage, #AIConversation, #Chatbot, #Virtual, #Environment, #CLI, #Debugging, #MemGPTFlags, #Extended, #Context, #VirtualMemory, #OSInspired, #Incredible, #Amazing, #MindBlowing, #Unbelievable, #MemoryManagement, #Management, #Installation, #Checkpoints, #Persona, #Custom, #Advanced, #Conversation, #Flags, #Inspired MemGPT is designed to help Large Language
Watch on YouTube โ†— (saves to browser)
Sign in to unlock AI tutor explanation ยท โšก30

Playlist

Uploads from Mervin Praison ยท Mervin Praison ยท 20 of 60

1 Build GCP Infra using Pulumi in YAML format
Build GCP Infra using Pulumi in YAML format
Mervin Praison
2 How to Convert a Pulumi YAML File to Python Format
How to Convert a Pulumi YAML File to Python Format
Mervin Praison
3 Speed Up AWS EKS: A Complete Guide to Performance Tuning & Debugging!
Speed Up AWS EKS: A Complete Guide to Performance Tuning & Debugging!
Mervin Praison
4 Learn GCP GKE to AWS EKS Migration in Just 5 Minutes: Quick Guide
Learn GCP GKE to AWS EKS Migration in Just 5 Minutes: Quick Guide
Mervin Praison
5 AWS & Kubernetes: The Definitive Guide to Data Persistence with PV and PVC
AWS & Kubernetes: The Definitive Guide to Data Persistence with PV and PVC
Mervin Praison
6 ChatGPT Voice Conversation RELEASED! It's AMAZING!! (Demo)
ChatGPT Voice Conversation RELEASED! It's AMAZING!! (Demo)
Mervin Praison
7 How to Install Mistral 7B in Minutes: Quick & Easy Guide! โœ…
How to Install Mistral 7B in Minutes: Quick & Easy Guide! โœ…
Mervin Praison
8 Code Llama Install Locally: ๐Ÿ๐Ÿ’ป Elevate Your Python Skills!
Code Llama Install Locally: ๐Ÿ๐Ÿ’ป Elevate Your Python Skills!
Mervin Praison
9 Orca Mini: Your Ultimate Guide to Install and Test on Mac & Linux ๐Ÿ’ป
Orca Mini: Your Ultimate Guide to Install and Test on Mac & Linux ๐Ÿ’ป
Mervin Praison
10 Quick & Easy Vicuna Setup on Mac and Linux ๐Ÿ’ป
Quick & Easy Vicuna Setup on Mac and Linux ๐Ÿ’ป
Mervin Praison
11 Quick Guide: Llama2 Local Installation and ChatGPT with pip! Python๐Ÿ› ๏ธ
Quick Guide: Llama2 Local Installation and ChatGPT with pip! Python๐Ÿ› ๏ธ
Mervin Praison
12 Query PDFs Like a Pro with Local GPT: Full Setup Guide! ๐Ÿ“œ
Query PDFs Like a Pro with Local GPT: Full Setup Guide! ๐Ÿ“œ
Mervin Praison
13 LM Studio: EASIEST way to Run Large Language Models Locally!
LM Studio: EASIEST way to Run Large Language Models Locally!
Mervin Praison
14 AMAZING ChatGPT Vision is OUT! ๐Ÿคฏ 14+ Examples (Step-by-Step) FULL Tutorial
AMAZING ChatGPT Vision is OUT! ๐Ÿคฏ 14+ Examples (Step-by-Step) FULL Tutorial
Mervin Praison
15 Unbelievable! Build ANY App Instantly with Smol AI! ๐Ÿ˜ฒ๐Ÿ”ฅ
Unbelievable! Build ANY App Instantly with Smol AI! ๐Ÿ˜ฒ๐Ÿ”ฅ
Mervin Praison
16 Amazing! AutoGen Made Easy: A Step-by-Step Beginners Guide ๐Ÿ“š
Amazing! AutoGen Made Easy: A Step-by-Step Beginners Guide ๐Ÿ“š
Mervin Praison
17 How to Set Up LoLLMS and Run LLMs Locally! ๐Ÿš€ Step-by-Step Tutorial
How to Set Up LoLLMS and Run LLMs Locally! ๐Ÿš€ Step-by-Step Tutorial
Mervin Praison
18 GPT4All: INSANE Way to Run Large Language Models Locally! ๐Ÿ˜ฒ Step-By-Step Tutorial
GPT4All: INSANE Way to Run Large Language Models Locally! ๐Ÿ˜ฒ Step-By-Step Tutorial
Mervin Praison
19 Incredible AI-Powered NPCs in Unity Game Engine: Step by Step Tutorial!๐Ÿคฏ
Incredible AI-Powered NPCs in Unity Game Engine: Step by Step Tutorial!๐Ÿคฏ
Mervin Praison
โ–ถ MemGPT ๐Ÿง  LLM as Operating System. It's INSANE! Step-by-Step Tutorial ๐Ÿคฏ
MemGPT ๐Ÿง  LLM as Operating System. It's INSANE! Step-by-Step Tutorial ๐Ÿคฏ
Mervin Praison
21 Text Generation Web UI: MIND-BLOWING Way to Run LLM Locally! ๐Ÿคฏ
Text Generation Web UI: MIND-BLOWING Way to Run LLM Locally! ๐Ÿคฏ
Mervin Praison
22 Unlock the INSANE Power of OpenAI GPT-4 with C#/.NET! ๐Ÿ˜ฒ
Unlock the INSANE Power of OpenAI GPT-4 with C#/.NET! ๐Ÿ˜ฒ
Mervin Praison
23 Integrate Langchain and Ollama for Local AI Power ๐Ÿคฏ Indeed POWERFUL!
Integrate Langchain and Ollama for Local AI Power ๐Ÿคฏ Indeed POWERFUL!
Mervin Praison
24 ChatDev: INSANE Virtual AI Agents! Future of Software Development ๐Ÿ˜ฒ
ChatDev: INSANE Virtual AI Agents! Future of Software Development ๐Ÿ˜ฒ
Mervin Praison
25 Query PDFs Using Mistral: Unlock INSANE Power! ๐Ÿคฏ
Query PDFs Using Mistral: Unlock INSANE Power! ๐Ÿคฏ
Mervin Praison
26 AutoGen + Open-Source LLMs: UNBELIEVABLE! Step-by-Step Tutorial You Can't Miss! ๐Ÿคฏ
AutoGen + Open-Source LLMs: UNBELIEVABLE! Step-by-Step Tutorial You Can't Miss! ๐Ÿคฏ
Mervin Praison
27 AutoGen + Text Generation WebUI: Unbelievable 100% Local Private Setup ๐Ÿคฏ
AutoGen + Text Generation WebUI: Unbelievable 100% Local Private Setup ๐Ÿคฏ
Mervin Praison
28 MemGPT: Amazing! External Context for LLM #ai #llm #memgpt  #generativeai #mem #gpt #openai #chatgpt
MemGPT: Amazing! External Context for LLM #ai #llm #memgpt #generativeai #mem #gpt #openai #chatgpt
Mervin Praison
29 GeniA: Kubernetes + AI for MIND-BLOWING Operational Efficiency! ๐Ÿคฏ FULL Tutorial
GeniA: Kubernetes + AI for MIND-BLOWING Operational Efficiency! ๐Ÿคฏ FULL Tutorial
Mervin Praison
30 VertexAI Meets LangChain for Mind-Blowing AI Conversations! ๐Ÿ˜ฒ Step by Step Tutorial
VertexAI Meets LangChain for Mind-Blowing AI Conversations! ๐Ÿ˜ฒ Step by Step Tutorial
Mervin Praison
31 Simplified ChatGPT API Setup on Node.js for Newbies! ๐Ÿ˜ Step by Step Tutorial
Simplified ChatGPT API Setup on Node.js for Newbies! ๐Ÿ˜ Step by Step Tutorial
Mervin Praison
32 Autogen: Ollama integration ๐Ÿคฏ Step by Step Tutorial. Mind-blowing!
Autogen: Ollama integration ๐Ÿคฏ Step by Step Tutorial. Mind-blowing!
Mervin Praison
33 LiteLLM: One-Function Call to ANY Large Language Model! ๐Ÿคฏ UNBELIEVABLE!
LiteLLM: One-Function Call to ANY Large Language Model! ๐Ÿคฏ UNBELIEVABLE!
Mervin Praison
34 ChatGPT Chatbot in Less Time Than You Think! ๐Ÿš€๐Ÿ˜Ž Step-by-Step Tutorial
ChatGPT Chatbot in Less Time Than You Think! ๐Ÿš€๐Ÿ˜Ž Step-by-Step Tutorial
Mervin Praison
35 LiteLLM Chatbot: Build Your Own in MINUTES! INSANE! ๐Ÿค–๐Ÿ”ฅ
LiteLLM Chatbot: Build Your Own in MINUTES! INSANE! ๐Ÿค–๐Ÿ”ฅ
Mervin Praison
36 Create Chatbot: Turn ANY Open-Source LLM into a Conversation Pro! ๐Ÿค–
Create Chatbot: Turn ANY Open-Source LLM into a Conversation Pro! ๐Ÿค–
Mervin Praison
37 Create Chatbot: Ollama Integration Made UNBELIEVABLY Easy! ๐ŸŽ‰
Create Chatbot: Ollama Integration Made UNBELIEVABLY Easy! ๐ŸŽ‰
Mervin Praison
38 LlamaIndex + ChatGPT: Ingest Data and Experience UNBELIEVABLE Query Results! ๐ŸŒŸ
LlamaIndex + ChatGPT: Ingest Data and Experience UNBELIEVABLE Query Results! ๐ŸŒŸ
Mervin Praison
39 INSANE! OpenAgents: Automated Data Analysis with Kaggle ๐Ÿคฏ
INSANE! OpenAgents: Automated Data Analysis with Kaggle ๐Ÿคฏ
Mervin Praison
40 React.js LLM Agent for Next-Gen Coding using ChatGPT ๐Ÿš€ Mind-Blowing ๐Ÿคฏ
React.js LLM Agent for Next-Gen Coding using ChatGPT ๐Ÿš€ Mind-Blowing ๐Ÿคฏ
Mervin Praison
41 MemGPT + Any LLM ๐Ÿš€ 100% Local & Private Integration Unveiled! Unlimited Memory
MemGPT + Any LLM ๐Ÿš€ 100% Local & Private Integration Unveiled! Unlimited Memory
Mervin Praison
42 MemGPT  + AutoGen ๐Ÿง ๐Ÿค– Unlimited Memory & Autonomous AI Agents! INSANE๐Ÿคฏ
MemGPT + AutoGen ๐Ÿง ๐Ÿค– Unlimited Memory & Autonomous AI Agents! INSANE๐Ÿคฏ
Mervin Praison
43 AutoGen + Google's Palm LLM & More! Revolutionary AI Integration ๐Ÿš€
AutoGen + Google's Palm LLM & More! Revolutionary AI Integration ๐Ÿš€
Mervin Praison
44 MemGPT & LM Studio Integration Revealed! ๐Ÿ”ฅ Next-Level AI
MemGPT & LM Studio Integration Revealed! ๐Ÿ”ฅ Next-Level AI
Mervin Praison
45 ๐Ÿš€ AutoLLM: Unlock the Power of 100+ Language Models! Step-by-Step Tutorial
๐Ÿš€ AutoLLM: Unlock the Power of 100+ Language Models! Step-by-Step Tutorial
Mervin Praison
46 AutoLLM & Gradio Integration You Won't Believe! ๐Ÿคฏ Mind-Blowing
AutoLLM & Gradio Integration You Won't Believe! ๐Ÿคฏ Mind-Blowing
Mervin Praison
47 AutoLLM & FastAPI Tutorial: Query 100+ Language Models! ๐Ÿ˜ฑ
AutoLLM & FastAPI Tutorial: Query 100+ Language Models! ๐Ÿ˜ฑ
Mervin Praison
48 Quivr: LLM's Second Brain - Transforming Data Management & Advanced Query with AI! ๐Ÿคฏ
Quivr: LLM's Second Brain - Transforming Data Management & Advanced Query with AI! ๐Ÿคฏ
Mervin Praison
49 AutoGen & MemGPT with Local LLM: A Complete Setup Tutorial! ๐Ÿง  AMAZING ๐Ÿคฏ
AutoGen & MemGPT with Local LLM: A Complete Setup Tutorial! ๐Ÿง  AMAZING ๐Ÿคฏ
Mervin Praison
50 LocalAI: Free, Open Source OpenAI Alternative ๐Ÿš€ INSANE ๐Ÿคฏ Step-by-Step Tutorial
LocalAI: Free, Open Source OpenAI Alternative ๐Ÿš€ INSANE ๐Ÿคฏ Step-by-Step Tutorial
Mervin Praison
51 Yarn Mistral 7B 128k LARGE context window, Small size ๐Ÿคฏ INSANE ๐Ÿš€ Setup Tutorial!
Yarn Mistral 7B 128k LARGE context window, Small size ๐Ÿคฏ INSANE ๐Ÿš€ Setup Tutorial!
Mervin Praison
52 Zephyr-7B: The Small and Mighty LLM ๐Ÿคฏ Step by Step Tutorial! ๐Ÿ“˜
Zephyr-7B: The Small and Mighty LLM ๐Ÿคฏ Step by Step Tutorial! ๐Ÿ“˜
Mervin Praison
53 Promptfoo: How to Test Your LLM ? ๐Ÿš€  VERY EASY!
Promptfoo: How to Test Your LLM ? ๐Ÿš€ VERY EASY!
Mervin Praison
54 Pydantic: How to Validate LLM Responses? ๐Ÿš€ Quality Response. VERY EASY!!!!
Pydantic: How to Validate LLM Responses? ๐Ÿš€ Quality Response. VERY EASY!!!!
Mervin Praison
55 Pydantic: FORCE Your AI to Respond Back in UPPERCASE! ๐Ÿคฏ Step-by-Step Tutorial ๐Ÿ”ฅ
Pydantic: FORCE Your AI to Respond Back in UPPERCASE! ๐Ÿคฏ Step-by-Step Tutorial ๐Ÿ”ฅ
Mervin Praison
56 Pydantic: How to use LLM to convert unstructured data to structured data?
Pydantic: How to use LLM to convert unstructured data to structured data?
Mervin Praison
57 AutoGen Function Calling: INSANE ๐Ÿš€ Custom Integrations! Step-by-Step Tutorial ๐Ÿคฏ
AutoGen Function Calling: INSANE ๐Ÿš€ Custom Integrations! Step-by-Step Tutorial ๐Ÿคฏ
Mervin Praison
58 OpenAI Assistants API + Python ๐Ÿค– How to get started? (FULL Tutorial) ๐Ÿคฏ INSANE
OpenAI Assistants API + Python ๐Ÿค– How to get started? (FULL Tutorial) ๐Ÿคฏ INSANE
Mervin Praison
59 GPT-4 Vision API ๐Ÿคฏ INSANE Video Recognition Powers! Step-by-Step Tutorial ๐Ÿš€
GPT-4 Vision API ๐Ÿคฏ INSANE Video Recognition Powers! Step-by-Step Tutorial ๐Ÿš€
Mervin Praison
60 GPT-4 Vision API ๐Ÿš€ The Future of Image Recognition! ๐Ÿคฏ Step-by-Step Tutorial
GPT-4 Vision API ๐Ÿš€ The Future of Image Recognition! ๐Ÿคฏ Step-by-Step Tutorial
Mervin Praison

This video teaches how to install and use MemGPT, a large language model that manages its own memory like an operating system, and demonstrates how to create and load personas and humans, and store and retrieve data using external context.

Key Takeaways
  1. Clone the MemGPT repository
  2. Create a virtual environment using conda
  3. Install required Python packages using pip
  4. Export the OpenAPI key
  5. Run MemGPT using Python main.py
  6. Create and load personas and humans using persona.txt and human.txt files
  7. Store and retrieve data using external context
๐Ÿ’ก MemGPT uses external context to manage its own memory like an operating system, allowing for more efficient and flexible use of large language models.
๐Ÿ”’ Pro feature: Ask AI to explain this lesson โ†’

Related AI Lessons

โšก
Stop Guessing: Guaranteed Structured Output from LLMs in Node.js
Learn to guarantee structured output from LLMs in Node.js and stop parsing JSON manually
Dev.to ยท Hardik Mehta
โšก
Spring AI Tutorial โ€” Your First REST Endpoint with OpenAI (2026)
Build a REST endpoint with Spring Boot 3 and OpenAI to create an LLM-powered API, leveraging the power of AI in your applications
Dev.to AI
โšก
10 ChatGPT Prompts for Job Seekers: Resumes, Interviews & Career Growth
Learn how to leverage ChatGPT for job searching, resume building, and career growth with 10 actionable prompts
Medium ยท ChatGPT
โšก
Lost in Transcription: The Week the Machine Started Lying
Learn how Whisper AI transcription can be flawed and understand the importance of validation in AI-generated text
Medium ยท AI

Chapters (9)

Introduction
0:07 What is MemGPT?
0:35 Installation Steps
1:00 Python Packages
1:22 Running MemGPT
2:01 Saving Checkpoints
3:15 Creating Personas
4:00 Running with Custom Persona
5:34 Advanced Tutorial Teaser
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch โ†’