\documentclass[aspectratio=169,11pt]{beamer}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb,graphicx,booktabs}

\definecolor{AcademicBlue}{RGB}{26,57,86}
\definecolor{AcademicTeal}{RGB}{0,105,112}
\setbeamercolor{structure}{fg=AcademicBlue}
\setbeamercolor{frametitle}{fg=AcademicBlue,bg=white}
\setbeamercolor{title}{fg=AcademicBlue}
\setbeamercolor{alerted text}{fg=AcademicTeal}
\setbeamercolor{block title}{fg=white,bg=AcademicBlue}
\setbeamercolor{block body}{fg=black,bg=AcademicBlue!5}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{itemize items}[circle]
\setbeamertemplate{footline}{%
  \hfill\usebeamerfont{page number in head/foot}%
  \insertframenumber\,/\,\inserttotalframenumber\hspace{4mm}\vspace{3mm}}
\setbeamersize{text margin left=8mm,text margin right=8mm}
\setbeamerfont{frametitle}{size=\Large,series=\bfseries}
\setbeamerfont{title}{size=\LARGE,series=\bfseries}
\newcommand{\papersource}[1]{\par\smallskip{\scriptsize\color{gray}#1\par}}

\title[MemGPT]{MemGPT: Towards LLMs as Operating Systems}
\subtitle{Virtual context management for fixed-window LLMs}
\author[ Packer et al. ]{Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang,\\
  Shishir G. Patil, Ion Stoica, Joseph E. Gonzalez}
\date{\href{https://arxiv.org/abs/2310.08560v2}{arXiv:2310.08560v2}
  \quad|\quad 10 November 2026}

\begin{document}
\begin{frame}
  \titlepage
  \vspace{-2mm}
  \begin{center}
    \scriptsize
    Publication: no formal venue found as of 10 Nov 2026; Berkeley lists CoRR
    (\href{https://sky.cs.berkeley.edu/project/memgpt/}{source}).\par
    \href{https://github.com/cpacker/MemGPT}{Official code (now Letta, formerly MemGPT)}
  \end{center}
\end{frame}

\begin{frame}{The core move is to manage context, not enlarge it}
  \begin{block}{Main idea}
    Treat the prompt as a scarce working set. Keep recent and salient information
    in the LLM window; keep full history and documents outside it; let the model
    page information in and out through function calls.
  \end{block}
  \begin{itemize}
    \item The model's per-call context limit stays fixed.
    \item An event and function loop lets one task span multiple retrieval steps.
    \item Evidence: better deep-memory recall and multi-step retrieval on the paper's tasks.
  \end{itemize}
  \papersource{Paper, Abstract and Sec. 5, PDF pp. 1, 8.}
\end{frame}

\begin{frame}{Longer windows do not remove the whole problem}
  \begin{itemize}
    \item Conversations and document collections can outgrow one prompt.
    \item Transformer context scaling increases attention cost; the paper also cites
      evidence that models use long contexts unevenly.
    \item MemGPT asks whether external storage plus iterative retrieval can extend
      task-time access without changing the base model.
  \end{itemize}
  \begin{block}{Historical context}
    The paper's context-window comparison was collected in January 2024. Its
    reported model limits are experimental context, not current model specifications.
  \end{block}
  \papersource{Paper, Sec. 1 and Table 1, PDF pp. 1, 4.}
\end{frame}

\begin{frame}{MemGPT maps operating-system ideas onto LLM context}
  \centering
  \begin{tabular}{p{0.31\linewidth}p{0.57\linewidth}}
    \toprule
    Operating-system idea & MemGPT counterpart \\
    \midrule
    Physical memory & The fixed prompt window: instructions, working context, FIFO queue \\
    Disk / persistent store & Recall logs; archival documents \\
    Paging & Function calls move selected information into or out of the prompt \\
    Memory pressure & A system message warns the model before older queue entries are flushed \\
    Interrupt / event & User input, capacity warning, upload event, or timer can trigger inference \\
    \bottomrule
  \end{tabular}
  \vspace{2mm}
  \begin{itemize}
    \item “Virtual context” is the model's ability to access stored material over multiple calls.
  \end{itemize}
  \papersource{Paper, Sec. 2, PDF pp. 2--4.}
\end{frame}

\begin{frame}{A queue manager and function executor surround the LLM}
  \centering
  \includegraphics[width=0.94\linewidth,height=0.62\textheight,keepaspectratio]{figures/fig-03-system-flow.pdf}
  \begin{itemize}
    \item The queue manager persists messages and enforces capacity; the executor performs memory operations.
  \end{itemize}
  \papersource{Paper, Fig. 3, PDF p. 3. Original author figure.}
\end{frame}

\begin{frame}{Three prompt regions and two external stores have different jobs}
  \begin{columns}[T,onlytextwidth]
    \column{0.49\textwidth}
      \begin{block}{Main context: visible to the model}
        \textbf{System instructions}\\
        Static control policy and function descriptions.

        \medskip
        \textbf{Working context}\\
        Fixed-size, editable facts and persona state.

        \medskip
        \textbf{FIFO queue}\\
        Recent messages, system events, and tool results.
      \end{block}
    \column{0.49\textwidth}
      \begin{block}{External context: fetched as needed}
        \textbf{Recall storage}\\
        Persistent conversation messages; searchable and paginated.

        \medskip
        \textbf{Archival storage}\\
        Arbitrary-length text or documents; accessed with memory functions.
      \end{block}
  \end{columns}
  \papersource{Paper, Sec. 2.1--2.2, PDF pp. 2--3.}
\end{frame}

\begin{frame}{Capacity pressure triggers save, then flush}
  \begin{enumerate}
    \item \textbf{Before overflow:} a warning message prompts the LLM to preserve
      important queue content in working context or archival storage.
    \item \textbf{At the flush threshold:} the queue manager evicts older messages
      and creates a recursive summary to keep recent context available.
    \item \textbf{After eviction:} full messages remain in recall storage and can
      be searched back into the prompt later.
  \end{enumerate}
  \begin{block}{Thresholds in the paper}
    About 70\% for the warning, 100\% for flush, and evicting about 50\% of the
    window are illustrative examples, not universal constants.
  \end{block}
  \papersource{Paper, Sec. 2.2, PDF p. 3.}
\end{frame}

\begin{frame}{Heartbeats let the model chain retrieval calls}
  \begin{itemize}
    \item A function call is parsed and validated; results or runtime errors return to context.
    \item With \texttt{request\_heartbeat=true}, MemGPT immediately runs another
      inference, so the model can search another page or follow a retrieved key.
    \item Without a heartbeat, the agent yields and waits for the next external event.
  \end{itemize}
  \begin{block}{Why this matters}
    The LLM chooses whether to save, search, revise, or continue. The system
    provides the storage and control loop, but successful retrieval still depends
    on the model making useful tool calls.
  \end{block}
  \papersource{Paper, Sec. 2.3--2.4, PDF pp. 3--4.}
\end{frame}

\begin{frame}{The experiments test memory across two kinds of long task}
  \begin{tabular}{p{0.23\linewidth}p{0.38\linewidth}p{0.29\linewidth}}
    \toprule
    Domain & Task & Main comparison \\
    \midrule
    Multi-session chat & Recall facts from earlier sessions; write personalized openers & MemGPT vs fixed-context summaries; GPT-3.5 / GPT-4 / GPT-4 Turbo \\
    Document analysis & NaturalQuestions document QA & Paginated archival search vs one-shot top-K context \\
    Document analysis & Nested UUID key-value lookup & Repeated search calls vs fixed prompt \\
    \bottomrule
  \end{tabular}
  \vspace{2mm}
  \begin{itemize}
    \item Tasks evaluate historical recall, document grounding, and multi-hop retrieval.
  \end{itemize}
  \papersource{Paper, Sec. 3, PDF pp. 4--8.}
\end{frame}

\begin{frame}{Searchable history improves deep-memory answers}
  \small
  \begin{tabular}{lrrrr}
    \toprule
    Base model & Base accuracy & + MemGPT & Base ROUGE-L R & + MemGPT \\
    \midrule
    GPT-3.5 Turbo & 38.7\% & 66.9\% & 0.394 & 0.629 \\
    GPT-4 & 32.1\% & 92.5\% & 0.296 & 0.814 \\
    GPT-4 Turbo & 35.3\% & 93.4\% & 0.359 & 0.827 \\
    \bottomrule
  \end{tabular}
  \begin{itemize}
    \item The base sees a lossy summary of five prior sessions; MemGPT can search the full logs.
    \item GPT-4 and GPT-4 Turbo gain 60.4 and 58.1 percentage points in accuracy.
    \item The task uses a generated sixth-session question; answers are assessed with ROUGE-L recall and an LLM judge.
  \end{itemize}
  \papersource{Paper, Sec. 3.1, Table 2 and Appendix 6.1, PDF pp. 5, 11.}
\end{frame}

\begin{frame}{Openers include more persona details by similarity scores}
  \small
  \begin{tabular}{lrrr}
    \toprule
    Method & SIM-1 & SIM-3 & SIM-H \\
    \midrule
    Human opener & 0.800 & 0.800 & 1.000 \\
    MemGPT + GPT-3.5 Turbo & 0.830 & 0.812 & 0.817 \\
    MemGPT + GPT-4 & 0.868 & 0.843 & 0.773 \\
    MemGPT + GPT-4 Turbo & 0.857 & 0.828 & 0.767 \\
    \bottomrule
  \end{tabular}
  \begin{itemize}
    \item SIM-1 / SIM-3 compare with gold persona labels; SIM-H compares with the human opener.
    \item The scores support greater persona coverage, while SIM-H stays below the human reference.
  \end{itemize}
  \papersource{Paper, Sec. 3.1 and Table 3, PDF p. 5.}
\end{frame}

\begin{frame}{Document QA gives both methods the same retriever}
  \begin{itemize}
    \item 50 NaturalQuestions-Open questions with a late-2018 Wikipedia dump.
    \item Both use cosine search over text-embedding-ada-002 vectors.
    \item Fixed-context baselines receive top-K documents in one prompt. MemGPT stores
      documents in PostgreSQL / pgvector (HNSW) and can request further pages.
    \item An LLM judge checks both answer correctness and support from retrieved text.
  \end{itemize}
  \begin{block}{What is being tested?}
    Whether iterative search can recover useful evidence beyond the first batch
    that fits in a single context window.
  \end{block}
  \papersource{Paper, Sec. 3.2.1, PDF pp. 6--7.}
\end{frame}

\begin{frame}{Iterative archive search is stable as more documents are considered}
  \centering
  \includegraphics[width=0.92\linewidth,height=0.58\textheight,keepaspectratio]{figures/fig-05-document-qa.pdf}
  \begin{itemize}
    \item MemGPT stays near 0.72 with GPT-4 / Turbo and 0.40 with GPT-3.5.
    \item One-shot baselines lose accuracy when larger K forces document truncation.
  \end{itemize}
  \papersource{Paper, Fig. 5, PDF p. 6. Values read from the plotted curves.}
\end{frame}

\begin{frame}{Nested KV isolates the need to follow several retrieval hops}
  \begin{itemize}
    \item 140 key-value pairs (about 8K tokens); each key and value is a UUID.
    \item A value may itself be a key, so the agent repeats lookup until it reaches a terminal value.
    \item The task varies nesting depth from 0 to 4 and samples 30 orderings.
  \end{itemize}
  \begin{center}
    \large
    \[
      k_0 \rightarrow v_0(=k_1) \rightarrow v_1(=k_2) \rightarrow \cdots \rightarrow v_{\mathrm{final}}
    \]
  \end{center}
  \papersource{Paper, Sec. 3.2.2 and Fig. 8, PDF pp. 7--8.}
\end{frame}

\begin{frame}{GPT-4 MemGPT sustains nested lookup where baselines collapse}
  \centering
  \includegraphics[width=0.92\linewidth,height=0.57\textheight,keepaspectratio]{figures/fig-07-nested-kv.pdf}
  \begin{itemize}
    \item GPT-3.5 baseline reaches zero at depth 1; GPT-4 / Turbo baselines by depth 3.
    \item MemGPT + GPT-4 stays at 1.0 through depth 3; other MemGPT bases fall.
  \end{itemize}
  \papersource{Paper, Sec. 3.2.2 and Fig. 7, PDF p. 7.}
\end{frame}

\begin{frame}{The evidence supports a control loop, not automatic memory quality}
  \begin{columns}[T,onlytextwidth]
    \column{0.49\textwidth}
      \begin{block}{What the tasks support}
        \begin{itemize}
          \item Full-history search beats a lossy summary on DMR.
          \item Multi-call retrieval helps with document QA and nested lookups.
          \item Working context can retain evolving persona facts.
        \end{itemize}
      \end{block}
    \column{0.49\textwidth}
      \begin{block}{Where results depend on the setup}
        \begin{itemize}
          \item GPT-3.5 tool calling is weaker; MemGPT can stop paging early.
          \item DMR questions are generated; document QA uses 50 questions.
          \item Similarity metrics and LLM judges are proxies for quality.
        \end{itemize}
      \end{block}
  \end{columns}
  \papersource{Paper, Sec. 3 and Appendix 6.1, PDF pp. 5--8, 11--13.}
\end{frame}

\begin{frame}{Takeaways}
  \begin{enumerate}
    \item MemGPT treats a fixed prompt window as a working set managed by an LLM operating-system loop.
    \item Persistent recall, archival search, queue eviction, and heartbeats enable multi-step use of external context.
    \item The reported gains are strongest when the base model can call functions reliably and keep searching.
  \end{enumerate}
  \vspace{4mm}
  \small
  \textbf{Paper:} Packer et al., \href{https://arxiv.org/abs/2310.08560v2}{arXiv:2310.08560v2}.\\
  \textbf{Project:} \href{https://research.memgpt.ai/}{MemGPT research page};
  \href{https://github.com/cpacker/MemGPT}{official repository, now Letta}.
  \papersource{Publication lookup: no formal venue found as of 10 Nov 2026; Berkeley lists CoRR.}
\end{frame}
\end{document}
