Repository navigation
Module 09 LLM Memory Mechanics
What models forget, why, and what you can do about it.
Module 09 of 16 · track Build · Estimated time: 3–4 hours · Prerequisites: Module 08 (or Module 06).
Models are stateless. Every 'memory' feature is engineering you or your framework did. This short, sharp module makes that machinery explicit so you stop being surprised by it.
Open the module on GitHub ↗: the slides, notebooks, exercises and solutions are there. This page is the reading order, with the tutorial and the workbench alongside.
The lesson that frames this module is Why Your AI Agent Costs 4× the Estimate, and How to Fix It (7 min): context is the largest line on the bill. Then try the cache break-even calculator in the workbench: the same decision, with your numbers.
- Explain why an LLM has no memory and what each memory strategy actually does
- Implement buffer, summary and vector-backed memory and compare them
- Choose a memory strategy from cost and recall requirements
| Portable GenAI concepts | AWS-specific surface |
|---|---|
| Statelessness | AgentCore Memory |
| Buffer memory | Bedrock Knowledge Bases as long-term recall |
| Summary memory | |
| Vector memory | |
| Context budgeting |
Portable concepts transfer to any stack. The AWS column is where this module touches the cloud — see docs/concepts/portability-matrix.md.
| # | Step | What it is | |
|---|---|---|---|
| 1 | 📖 | slides/Mechanics_of_LLM_Memory.pptx |
Mechanics of LLM memory |
| 2 | 📖 | slides/langchain_memory_session_deck_v2.md |
Memory session deck |
| 3 | 💻 | notebooks/01_demonstration_llm_memory.ipynb |
Memory demonstration |
| 4 | ✏️ | exercises/02_activities_llm_memory.ipynb |
Memory activities |
📖 read 💻 run ✏️ practise 📊 workbook 🔖 reference
There is no separate solutions/ folder because the answers are inline: the
activities notebook carries # SOLUTION cells and collapsed
<details> reveals next to each task. Write your own answer into the my_answer_ variables before you
expand anything.
- Summary memory that silently drops the one fact the user cares about.
Every error anyone has hit in this course is in the Error Index, by the exact string. Model access and region problems are in Model and Region Notes. If it is a question rather than an error, check the answered ones first, then ask in Q&A.
Frameworks
- Context Budget Ledger — The overflow protocol
- Silent Degradation Watchlist — Summary memory drops the decisive fact
Quick reference
- AgentCore — Managed memory and retention
Recipes and procedures
- Memory that does not grow forever — Caps, TTLs, and the test everyone skips
← Module 08 · LangChain and LangGraph · All modules · Module 10 · RAG, OpenSearch and LiteLLM →
✏️ This page is generated from modules/09-llm-memory/README.md. To change it, edit the module README: an edit made here is replaced at the next sync.
This wiki is the connective layer. The repository is canonical and versioned; these pages are the cross-surface maps and the notes that change too often to live in a reviewed file. Anyone can edit — see Editing this wiki.
▶ Start here · 55 lessons, on the site ↗
- Getting started · 2
- Agentic PDLC fundamentals · 9
- Methods decoded · 7
- Running delivery · 13
- By role · 9
- Teams and organisation · 4
- Practice · 4
- Interviews and careers · 7
The method
The Agentic PDLC
The Eight Loops
Gates & Governance
The Evidence Pack
The journey · end to end
Product manager
Solution architect
Engineering lead
QA lead
DevOps & platform
The method · by role
Product manager
Solution architect
Engineering lead
QA lead
DevOps and platform
Sponsor
How to
Run an NFR workshop
Design an agent on paper
Build, buy or borrow
Cut sprints into bolts
Review by risk band
Prove the bar
Control the token bill
Hold the security boundary
Run a missing-control postmortem
Reference
Mental Models
Glossary
Formulas & Calculators
Decision Trees
Scenario Library
Exercises & Answers
Anti-Patterns
Sources & Confidence
Where do I find…?
The 16 modules
- Agentic Foundations
- LLM Intuition and the AWS Bridge
- Amazon Bedrock Essentials
- Amazon Bedrock Agents
- Agent Builder, Knowledge Bases and Guardrails
- The Agent Loop: No Framework to Strands
- Strands Foundations: Tools, Memory and MCP
- Multi-Agent Patterns with Strands
- LangChain and LangGraph
- LLM Memory Mechanics
- RAG, OpenSearch and LiteLLM
- Amazon Bedrock AgentCore
- A2A and A2UI: Agent Interoperability
- Agentic QA and Evaluation
- End-to-End Production Pipeline
- Agentic Product Lifecycle
Learning paths · Field guide
Study Plans
Eight sessions
Living notes
Error Index
Community Answers
Field Notes
Model & Region Notes
Cost Log
Scoreboard 🧪
The project
Roadmap
Editing this wiki
Maintainer Runbook
📘 The manual · live
🛫 Ninety Days, the simulator
🧰 The workbench
👔 For leadership
🧠 Mental models
Templates · Prompts
Frameworks & acronyms
The repository · Setup
Pinned discussions
Discussion map — where to post what
Exercise & lab index
Simulator Arena — get a lab graded
Pitch an idea
All discussions →