Give a Claude agent persistent memory across sessions
언제 쓸까: You want Claude to remember user preferences, past decisions, or ongoing projects even after the chat ends.
사전 조건
- Running Qdrant (local Docker or cloud) — docker run -p 6333:6333 qdrant/qdrant OR a Qdrant Cloud cluster URL + API key
- COLLECTION_NAME env var set — Any string, e.g.
claude_memory
흐름
-
Teach it to store important factsWhenever I tell you something important about a project (deadlines, stakeholders, decisions), store it with qdrant-store, metadata {project, category}.✓ 복사됨→ Claude starts echoing 'stored' for durable facts
-
Verify recall worksWhat do you remember about project 'atlas'? Use qdrant-find with a query like 'project atlas decisions'.✓ 복사됨→ Relevant prior messages returned with scores
-
Curate and forgetSearch for anything about project 'atlas' that's more than 90 days old or marked obsolete, and delete those entries.✓ 복사됨→ List of pruned items with confirmation
결과: An assistant that actually remembers what you told it last week — scoped per-project, prunable.
함정
- Storing every message bloats the collection and degrades recall quality — Only store explicit facts/decisions, not chit-chat. Make the 'store or not' decision part of the system prompt.
- Collection created with wrong vector size after switching embedding models — Qdrant rejects mismatched vectors — drop and recreate the collection when you change EMBEDDING_MODEL