2. 👋 Charles Packer
● PhD candidate @ Sky / BAIR, focus in AI
● Author of MemGPT
○ First paper demonstrating how to give GPT-4
self-editing memory (AI that can learn over time)
● Working on agents since 2017
○ “the dark ages”
○ 5 BC = Before ChatGPT
📧 cpacker@berkeley.edu
🐦 @charlespacker
34. Function
Send message
��
Edit context
Pause interrupts
��
Agent can edit their own memory
including their own context
{
“function”: “ core_memory_replace”,
“params”: {
“old_content”: “OAI Assistants API”,
“new_content”: “MemGPT API”
}
}
35. Function
Send message
��
Edit context
Pause interrupts
��
Core memory is a reserved block
System
prompt
In-context
memory block
Working
context queue
{
“function”: “ core_memory_replace”,
“params”: {
“old_content”: “OAI Assistants API”,
“new_content”: “MemGPT API”
}
}
36. Function
Send message
��
Query database
Pause interrupts
��
{
“function”: “ send_message”,
“params”: {
“message”: “How may I assist you?”
}
}
User messages are a function
Allows interacting with system
autonomously w/o user inputs
37. { “type”: “user_message”,
“content”: “ what’s happening on may 21 2024?” }
{
“function”: “archival_memory_search”,
“params”: {
“query”: “ may 21 2024”,
}
}
{
“function”: “send_message”,
“params”: {
“message”: “ Have you heard about Milvus?”
}
}
🧑
🤖
38. what’s happening on may 21 2024?
Have you heard about Milvus?
🧑
🤖
(User’s POV)
39. Event
User message
��
Document upload
��
System alert
🔔
Function
Send message
��
Query database
Pause interrupts
��
LLM
Virtual context
Main context
External context
∞ tokens
Max token limit
MemGPT
parse parse
MemGPT LLM OS setup
Event loop + functions + memory hierarchy
47. Docker integration - the fastest way to create a MemGPT server
Step 1: docker compose up
Step 2: create/edit/message agents using the MemGPT API
MemGPT ❤
48. MemGPT streaming API - token streaming
CLI: memgpt run --stream
REST API: use the stream_tokens flag [PR #1280 - staging]
49. MemGPT streaming API - token streaming
MemGPT API works with both non-streaming + streaming endpoints
If the true LLM backend doesn’t support streaming, “fake streaming”
50. MemGPT /chat/completions proxy API
Connect your MemGPT server to any /chat/completions service!
For example - 📞 voice call your MemGPT agents using VAPI!
MemGPT ��