Give a Claude agent persistent memory across sessions
Wann einsetzen: You want Claude to remember user preferences, past decisions, or ongoing projects even after the chat ends.
Voraussetzungen
- 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
Ablauf
-
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}.✓ Kopiert→ 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'.✓ Kopiert→ 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.✓ Kopiert→ List of pruned items with confirmation
Ergebnis: An assistant that actually remembers what you told it last week — scoped per-project, prunable.
Fallstricke
- 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