Session 5 assignment support: Give your capstone memory and deploy it
1. Start here: what this assignment is
This guide has two paths. Path A is enough to pass. Do that first. Path B is stretch: pick one or two only if you have time.
Session 5 is memory. Path A proves your capstone can remember across sessions (not only within one chat turn), runs from a public URL, and shows that recall in a Streamlit UI (or your existing UI).
Ready when
Memory vs context (do not mix these up)
Context is what the model sees this turn. Memory is durable state outside the window that you write, gate, and retrieve later. Stuffing a longer chat history is not the assignment. A store that survives a new session is.
Tip
Session resources
Live deck: Week 5: Anatomy of Agentic Memory. Lab: Agentic Memory UI + notebook. Context engineering: Anthropic. LangGraph memory: add memory · persistence. Tools to skim later: gbrain · gstack.
Critical
The Golden Rule
Whenever anything goes wrong, paste the full error into Claude Code or Cursor: "I got this error, please fix it and explain what happened in simple terms."
Path A - enough to pass
Basic submission: enough to pass
- Extend your capstone (Sessions 1 to 4). Do not submit an empty toy repo with no connection to your project.
- Add a durable memory store (JSON file, SQLite, Postgres, LangGraph store, or equivalent). It must survive process restart.
- Show cross-session recall: Session A writes a fact or preference; Session B (new thread / new process) retrieves it without the user restating it.
- Put critical rules above the compaction line when you use a coding agent (CLAUDE.md / AGENTS.md / system prompt), not only in chat.
- Deploy so a stranger can hit a public HTTPS URL (Render, Railway, Fly, Modal, or similar). Localhost does not count.
- Streamlit (or your existing UI) demos the recall across two turns or sessions. Screenshot or short Loom for Maven.
- One paragraph in the README: what you store, when you write, where it lives, how you retrieve, and when you forget (or why you do not yet).
2. Pick what is worth remembering
An agent that remembers everything remembers nothing useful. Start with 1 to 3 durable facts that help your product (user preference, last successful plan, account id, domain rule). Keep ephemeral tool dumps out of long-term memory.
- Support bot → remember the user's preferred language and the open ticket id.
- Research helper → remember the active project name and last sources used.
- Ops agent → remember the last successful run config and who approved it.
- Coding agent companion → remember repo conventions that belong in CLAUDE.md / AGENTS.md, not only in chat.
3. Implement a write gate
- 1
Decide write policy
Only persist facts that are stable, high confidence, and useful across sessions. Task-local scratch stays in session state or an artifact.
- 2
Choose a store
JSON on disk is fine for Path A. SQLite or Postgres is better if you already deploy a database. LangGraph stores work well if your agent is already on LangGraph.
- 3
Prove cross-session recall
Write in one run. Kill the process or open a new thread_id. Read back without pasting the fact again. That is the bar.
4. Deploy and demo
- 1
Ship a public URL
Same habit as Session 1: public HTTPS, secrets in the host env, not in git.
- 2
UI proof
Two screenshots or one short Loom: (1) write / first session, (2) fresh session that recalls. Post both in the Maven submission channel.
- 3
README five questions
Answer: What do I keep? When do I write it? Where does it live? How do I get it back? When do I forget?
Path B - stretch (optional)
Pick one or two if you have time
- Add a typed graph or hybrid retrieval (vector + relations) for multi-hop questions. See gbrain as inspiration; a local graph or wikilink store is enough.
- Add a consolidation / decay pass (merge duplicates, drop low-confidence facts).
- Add provenance on writes (source, timestamp, trust) and refuse untrusted ingest (poisoning demo from the lab).
- Use checkpointers for crash recovery and document what is lost inside a node vs between nodes (LangGraph durable execution).
- Ship a tiny markdown wiki (LLM wiki / OKF-style files) that your agent updates. Pattern: Karpathy llm-wiki gist.
5. Copy-paste prompts (Claude Code / Cursor)
Example
Scaffold durable memory
I have a FastAPI / Streamlit capstone at [path]. Add a durable human memory store (JSON or SQLite) with get / replace / list. Gate writes: only persist stable user preferences and project facts. Show a CLI or endpoint that writes in one session and reads in another after restart. Explain the design in simple terms.
Example
Wire into the agent loop
Before each agent turn, load relevant memory for this user_id. After the turn, propose at most 3 memory writes and apply only those that pass the write gate. Do not store raw tool dumps. Keep critical rules in CLAUDE.md / AGENTS.md.
Example
Streamlit recall demo
Add a Streamlit page with two buttons: (1) Save preference, (2) New session recall. New session must not reuse in-memory chat history. Show the retrieved memory on screen.
6. How to submit
- Maven submission channel: public URL + short note on what is remembered.
- Screenshot or Loom of cross-session recall in the UI.
- Link to the README section with the five memory questions.
- Optional Path B: one sentence on what you stretched.
7. Further reading (external)
- Anthropic: Effective context engineering for AI agents
- Anthropic: Effective harnesses for long-running agents
- Machine Learning Mastery: Choosing the right AI agent memory strategy
- Hugging Face: KV Caching Explained
- Karpathy llm-wiki gist · tweet
- Open Knowledge Format (OKF) spec
- LangGraph: add memory · persistence
- Letta (MemGPT) docs
- Session 5 videos: four memory types · architecting agent memory · OKF
- Microsoft GraphRAG
- gbrain · gstack