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.
Explore this link on the map →saved by
related reading
- Making Sense of Memory in AI Agents – Leonie Monigattileoniemonigatti.com
- How AI Agents Remember Thingsdamiangalarza.com
- Adding Long-Term Memory to a chatbot with Mem0 | by Rajesh Nayak | Mediummedium.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
- Mem0 - AI Memory Layer for your Agents & Apps | Persistent Contextmem0.ai
- Honchohoncho.dev
- GitHub - mem0ai/mem0: Universal memory layer for AI Agents · GitHubgithub.com
- GitHub - brexhq/prompt-engineering: Tips and tricks for working with Large Language Models like OpenAI's GPT-4. · GitHubgithub.com
- GPT-4: A Copilot for the Mindevery.to
- OpenAI | Research & Deploymentopenai.com
- GitHub - f/prompts.chat: f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy. · GitHubgithub.com