Module 09 LLM Memory Mechanics - akash-coded/aws-bedrock-agentcore-strands GitHub Wiki

๐Ÿง  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.

Read first, on the site

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.

What you will be able to do

  • 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

Concepts in this module

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.

Run it in this order

# 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.

Common mistakes

  • Summary memory that silently drops the one fact the user cares about.

When it breaks

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.

Field guide for this module

Frameworks

Quick reference

  • AgentCore โ€” Managed memory and retention

Recipes and procedures


โ† 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.

โš ๏ธ **GitHub.com Fallback** โš ๏ธ