Give a Claude agent persistent memory across sessions
Quand l'utiliser : You want Claude to remember user preferences, past decisions, or ongoing projects even after the chat ends.
Prérequis
- 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
Déroulement
-
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}.✓ Copié→ 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'.✓ Copié→ 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.✓ Copié→ List of pruned items with confirmation
Résultat : An assistant that actually remembers what you told it last week — scoped per-project, prunable.
Pièges
- 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