Uploaded September 2026 | Updated September 2026, 2 weeks ago
🚀 The LangChain 10 Days FREE Bootcamp is live: 10 lessons, free AI models only, from your first API call to a production grade RAG agent. Start with Day 0 for the roadmap and setup.
📺 Full playlist: youtube.com/watch?v=KJ3_NExk7-Q&list=PLW4pPr9JCovI&index=1
----------
Welcome to Day 6 of the LangChain bootcamp.
An LLM forgets your name the moment a call ends, so memory is something you build around it, and this lesson shows both halves of that job in LangChain.
We start with why the model has no memory at all, then build the message history by hand, then hand that job to create_agent with a MemorySaver checkpointer and a thread_id. From there we look at what goes wrong when history grows: input tokens climb every turn, performance drops, and the KV cache slows generation down. You fix that with trim_messages or with SummarizationMiddleware. The last part covers long term memory, the facts about a user that survive across threads, using InMemoryStore and a dynamic_prompt middleware hook, and finally we swap MemorySaver for SQLite so nothing is lost when the notebook restarts. Everything runs on a free OpenRouter model. This video stands on its own. Tools and agents come later in the bootcamp.
📺 Full playlist: youtube.com/playlist?list=PLW4pPr9JCovI
⏱ Chapters:
0:00 Intro and what memory means here
0:29 Why the model forgets your name
2:24 Parametric memory: what the model actually knows
3:48 Short term memory is a list you maintain
5:21 Threads and thread IDs
8:00 Why you cannot keep every message
9:39 Bigger context, weaker performance
10:20 KV cache and slower generation
11:18 Two fixes: trim and summarize
13:49 Long term memory across threads
17:13 Setup: OpenRouter, Nemotron 3.5 Lightning, LangSmith
19:18 Proof that the model has no memory
20:12 Building the message history by hand
23:42 create_agent with a MemorySaver checkpointer
26:31 Passing thread_id in the config
30:58 First chat and the LangGraph trace in LangSmith
33:28 Two threads that never mix
35:10 Reading the stored state in code
35:54 Input tokens grow on every single turn
38:59 Benchmark: context size against tokens per second
41:50 trim_messages by message count
45:07 Trimming by token count instead
46:53 SummarizationMiddleware inside create_agent
52:55 Reading the summary back from state
54:30 Long term memory with InMemoryStore
56:36 Middleware hooks and dynamic_prompt
58:22 Remembering Priya on a brand new thread
1:00:11 Saving memory to SQLite
1:03:34 Wrap up
🔗 Resources:
Code and slides: github.com/laxmimerit/Langchain-10-Days-Bootcamp
Short term memory docs: docs.langchain.com/oss/python/langchain/short-term-memory
Long term memory docs: docs.langchain.com/oss/python/langchain/long-term-memory
Summarization middleware: docs.langchain.com/oss/python/langchain/middleware#summarization
The speed benchmark I show at 38:59: kgptalkie.com/tutorials/generative-ai/nemotron-3-5-lightning-vs-muse-glimmer-30b
Free models on OpenRouter: openrouter.ai/models
LangSmith for tracing: smith.langchain.com
Install LangChain: docs.langchain.com/oss/python/langchain/install
📺 Watch next:
LangChain Tutorial for Beginners: Structured Output with Pydantic youtu.be/__DATHvlGEY
🎓 Go deeper, my Udemy course:
Master Langchain v1 and Ollama - Chatbot, RAG and AI Agents kgptalkie.com/langchain
Like the video if the thread ID part finally made sense, and tell me in the comments whether you went with trimming or summarization in your own app. Subscribe and hit the bell for the rest of the bootcamp.
#LangChain #AIAgents #LangGraph #Python #GenAI
🚀 The LangChain 10 Days FREE Bootcamp is live: 10 lessons, free AI models only, from your first API call to a production grade RAG agent. Start with Day 0 for the roadmap and setup.
📺 Full playlist: youtube.com/watch?v=KJ3_NExk7-Q&list=PLW4pPr9JCovI&index=1
----------
Welcome to Day 6 of the LangChain bootcamp.
An LLM forgets your name the moment a call ends, so memory is something you build around it, and this lesson shows both halves of that job in LangChain.
We start with why the model has no memory at all, then build the message history by hand, then hand that job to create_agent with a MemorySaver checkpointer and a thread_id. From there we look at what goes wrong when history grows: input tokens climb every turn, performance drops, and the KV cache slows generation down. You fix that with trim_messages or with SummarizationMiddleware. The last part covers long term memory, the facts about a user that survive across threads, using InMemoryStore and a dynamic_prompt middleware hook, and finally we swap MemorySaver for SQLite so nothing is lost when the notebook restarts. Everything runs on a free OpenRouter model. This video stands on its own. Tools and agents come later in the bootcamp.
📺 Full playlist: youtube.com/playlist?list=PLW4pPr9JCovI
⏱ Chapters:
0:00 Intro and what memory means here
0:29 Why the model forgets your name
2:24 Parametric memory: what the model actually knows
3:48 Short term memory is a list you maintain
5:21 Threads and thread IDs
8:00 Why you cannot keep every message
9:39 Bigger context, weaker performance
10:20 KV cache and slower generation
11:18 Two fixes: trim and summarize
13:49 Long term memory across threads
17:13 Setup: OpenRouter, Nemotron 3.5 Lightning, LangSmith
19:18 Proof that the model has no memory
20:12 Building the message history by hand
23:42 create_agent with a MemorySaver checkpointer
26:31 Passing thread_id in the config
30:58 First chat and the LangGraph trace in LangSmith
33:28 Two threads that never mix
35:10 Reading the stored state in code
35:54 Input tokens grow on every single turn
38:59 Benchmark: context size against tokens per second
41:50 trim_messages by message count
45:07 Trimming by token count instead
46:53 SummarizationMiddleware inside create_agent
52:55 Reading the summary back from state
54:30 Long term memory with InMemoryStore
56:36 Middleware hooks and dynamic_prompt
58:22 Remembering Priya on a brand new thread
1:00:11 Saving memory to SQLite
1:03:34 Wrap up
🔗 Resources:
Code and slides: github.com/laxmimerit/Langchain-10-Days-Bootcamp
Short term memory docs: docs.langchain.com/oss/python/langchain/short-term-memory
Long term memory docs: docs.langchain.com/oss/python/langchain/long-term-memory
Summarization middleware: docs.langchain.com/oss/python/langchain/middleware#summarization
The speed benchmark I show at 38:59: kgptalkie.com/tutorials/generative-ai/nemotron-3-5-lightning-vs-muse-glimmer-30b
Free models on OpenRouter: openrouter.ai/models
LangSmith for tracing: smith.langchain.com
Install LangChain: docs.langchain.com/oss/python/langchain/install
📺 Watch next:
LangChain Tutorial for Beginners: Structured Output with Pydantic youtu.be/__DATHvlGEY
🎓 Go deeper, my Udemy course:
Master Langchain v1 and Ollama - Chatbot, RAG and AI Agents kgptalkie.com/langchain
Like the video if the thread ID part finally made sense, and tell me in the comments whether you went with trimming or summarization in your own app. Subscribe and hit the bell for the rest of the bootcamp.
#LangChain #AIAgents #LangGraph #Python #GenAI










