I Reverse Engineered ChatGPT's Memory System, and Here's What I Found! - Manthan
When I asked ChatGPT what it remembered about me, it listed 33 facts from my name and career goals to my current fitness routine. But how does it actually store and retrieve this information? And why does it feel so seamless? After extensive experimentation, I discovered that ChatGPT’s memory system is far simpler than I expected. No vector databases. No RAG over conversation history. Instead, it uses four distinct layers: session metadata that adapts to your environment, explicit facts stored long-term, lightweight summaries of recent chats, and a sliding window of your current conversation. This blog breaks down exactly how each layer works and why this approach might be superior to traditional retrieval systems. Everything here comes from reverse engineering ChatGPT’s behavior through conversation. OpenAI did not publish these implementation details. Before understanding memory, it’s important to understand the entire context ChatGPT receives for every message. The structure looks l
When I asked ChatGPT what it remembered about me, it listed 33 facts from my name and career goals to my current fitness routine. But how does it actually store and retrieve this information? And why does it feel so seamless? After extensive experimentation, I discovered that ChatGPT's memory system is far simpler than I expected. No vector databases. No RAG over conversation history. Instead, it uses four distinct layers: session metadata that adapts to your environment, explicit facts stored long-term, lightweight summaries of recent chats, and a sliding window of your current conversation.
saved by
related reading
- Making Sense of Memory in AI Agents – Leonie Monigattileoniemonigatti.com
- How AI Agents Remember Thingsdamiangalarza.com
- What Is ChatGPT Doing … and Why Does It Work?-Stephen Wolfram Writingswritings.stephenwolfram.com
- Training is not the same as chatting: ChatGPT and other LLMs don’t remember everything you saysimonwillison.net
- Adding Long-Term Memory to a chatbot with Mem0 | by Rajesh Nayak | Mediummedium.com
- RLHF: Reinforcement Learning from Human Feedbackhuyenchip.com
- Deep Dive into LLMs like ChatGPTyoutube.com
- Extracting Training Data from ChatGPTnot-just-memorization.github.io
- Overview | Hindsighthindsight.vectorize.io
- The Continual Learning Problemjessylin.com
- Why We Need Continual Learning | Andreessen Horowitza16z.com
- [2304.13343] Unleashing Infinite-Length Input Capacity for Large-scale Language Models with Self-Controlled Memory Systemarxiv.org