As AI learners, we interact with multiple LLMs like ChatGPT and Gemini. Every LLM has a limited context window, which means it can only “remember” a certain amount of conversation at a time.
Moreover, LLMs are stateless by design—each request is independent. To maintain continuity, the entire conversation history must be sent again with every new prompt.
Now imagine this: you start a conversation with a model and share your personal details. After chatting for a few minutes, you ask the model for your name—and it can’t answer. Not because it’s faulty, but because that information has fallen outside the context window.
High Level solution: -
Introduce a centralized memory layer that persists across conversations.
This memory store is queried and updated on every interaction, allowing the system to retrieve relevant user information when needed
Types of Memory in AI Systems
1. Short-Term Memory (STM)
Short-term memory exists only during an active session while a task is being performed. It helps the model reason step by step within the current context, but once the session ends—or the context window is exceeded—this memory is lost.
In simple terms: STM forgets everything after the interaction ends.
2. Long-Term Memory (LTM)
Long-term memory persists across sessions and time. Even if you return after days or weeks, this information remains available.
Examples include:
Your name
Your age
Your preferences
LTM enables personalization, continuity, and user identity retention.
Types of Long-Term Memory
1. Factual Memory
Stores concrete, objective information about the user.
Examples:
Name: Amit, Age: 24 ,Profession: Full-Stack Developer
This data changes rarely and is easy to retrieve.
2. Episodic Memory
Stores past interactions and experiences tied to time or events.
Examples:
“User asked about LangGraph on Feb 3”
“User struggled with context windows in previous session”
This helps the system understand user behavior and history.
3. Semantic Memory
Stores learned concepts, meanings, and relationships over time.
Examples:
User understands LLM limitations
User prefers system-design explanations
User is interested in agentic AI
This allows the AI to adapt its responses to the user’s knowledge level and interests.
