Build a Chatbot with Memory
Build a Claude-powered chatbot with two distinct memory layers: short-term conversational state via a LangGraph checkpointer, and long-term semantic memory via a vector store that persists facts across sessions.
Prerequisites: Text-to-Image Pipeline with Stable Diffusion is not required for this one — just Python and an Anthropic API key; basic familiarity with LLM chat APIs.
Targeted versions: LangChain 1.0, LangGraph (current release), langchain-anthropic, Chroma — verified against LangChain and Anthropic documentation, mid-2026.
"Memory" in an LLM chatbot is really two separate problems. Short-term memory is just replaying the current conversation's message history back into every API call — the model itself is stateless between requests. Long-term memory is different: it's the ability to recall a fact from three sessions ago ("the user's name is Priya, she prefers TypeScript") without replaying the entire message history every time, which would eventually blow past the context window and get expensive.
You'll build both layers: LangGraph's built-in checkpointer for short-term, per-thread conversational state, and a small Chroma vector store for long-term semantic memory that the model can write to and read from as a tool. As of mid-2026, LangChain 1.0 has folded its agent-building APIs onto LangGraph as the underlying execution engine, so this pattern is the current recommended default rather than the older, now-deprecated AgentExecutor approach.
Set up LangGraph with the Claude API
Wire up short-term memory with thread IDs
Add long-term memory with a vector store
Let the model decide what's worth remembering
Secret Mission: add memory decay and summarization
Before You Go
Test what you just learned
Self-testing is one of the best ways to retain new skills. Unlock project quizzes to check your understanding.
Log in to unlock0 / 7 complete
