Memory gives your agent persistent, searchable storage for facts extracted from conversations. When a user says “I prefer dark mode” or “The client is risk-averse,” those facts are stored and can be retrieved later.
# Store a memory scoped to client + mattercurl -X POST https://api.case.dev/memory/v1 \ -H "Authorization: Bearer $CASEDEV_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ {"role": "user", "content": "The patent filing deadline is March 15th, 2026."} ], "tag_1": "client_acme_corp", "tag_2": "matter_patent_2026_001", "tag_3": "atty_jane_smith", "category": "deadline" }'# Search only this client's deadlinescurl -X POST https://api.case.dev/memory/v1/search \ -H "Authorization: Bearer $CASEDEV_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "upcoming deadlines", "tag_1": "client_acme_corp", "category": "deadline", "top_k": 10 }'# List all memories for a specific mattercurl "https://api.case.dev/memory/v1?tag_1=client_acme_corp&tag_2=matter_patent_2026_001" \ -H "Authorization: Bearer $CASEDEV_API_KEY"
# Store a memory scoped to client + mattercasedev memory:v1 create \ --message '{role: user, content: "The patent filing deadline is March 15th, 2026."}' \ --tag-1 client_acme_corp \ --tag-2 matter_patent_2026_001 \ --tag-3 atty_jane_smith \ --category deadline# Search only this client's deadlinescasedev memory:v1 search \ --query "upcoming deadlines" \ --tag-1 client_acme_corp \ --category deadline \ --top-k 10# List all memories for a specific mattercasedev memory:v1 list \ --tag-1 client_acme_corp \ --tag-2 matter_patent_2026_001
// Store a memory scoped to client + matterawait client.memory.add({ messages: [ { role: 'user', content: 'The patent filing deadline is March 15th, 2026.' } ], tag_1: 'client_acme_corp', // Client ID tag_2: 'matter_patent_2026_001', // Matter ID tag_3: 'atty_jane_smith', // Attorney ID category: 'deadline'});// Search only this client's deadlinesconst deadlines = await client.memory.search({ query: 'upcoming deadlines', tag_1: 'client_acme_corp', category: 'deadline', top_k: 10});// List all memories for a specific matterconst matterMemories = await client.memory.list({ tag_1: 'client_acme_corp', tag_2: 'matter_patent_2026_001'});
# Store a memory scoped to client + matterresult = client.memory.v1.create( messages=[ {'role': 'user', 'content': 'The patent filing deadline is March 15th, 2026.'} ], tag_1='client_acme_corp', # Client ID tag_2='matter_patent_2026_001', # Matter ID tag_3='atty_jane_smith', # Attorney ID category='deadline')# Search only this client's deadlinesdeadlines = client.memory.v1.search( query='upcoming deadlines', tag_1='client_acme_corp', category='deadline', top_k=10)# List all memories for a specific mattermatter_memories = client.memory.v1.list( tag_1='client_acme_corp', tag_2='matter_patent_2026_001')
// Store a memory scoped to client + matterresult, _ := client.Memory.V1.New(ctx, casedev.MemoryV1NewParams{ Messages: casedev.F([]casedev.MemoryV1NewParamsMessage{{ Role: casedev.F(casedev.MemoryV1NewParamsMessagesRoleUser), Content: casedev.F("The patent filing deadline is March 15th, 2026."), }}), Tag1: casedev.F("client_acme_corp"), // Client ID Tag2: casedev.F("matter_patent_2026_001"), // Matter ID Tag3: casedev.F("atty_jane_smith"), // Attorney ID Category: casedev.F("deadline"),})// Search only this client's deadlinesdeadlines, _ := client.Memory.V1.Search(ctx, casedev.MemoryV1SearchParams{ Query: casedev.F("upcoming deadlines"), Tag1: casedev.F("client_acme_corp"), Category: casedev.F("deadline"), TopK: casedev.F(int64(10)),})// List all memories for a specific mattermatterMemories, _ := client.Memory.V1.List(ctx, casedev.MemoryV1ListParams{ Tag1: casedev.F("client_acme_corp"), Tag2: casedev.F("matter_patent_2026_001"),})
# Get only deadline memories for a clientcurl "https://api.case.dev/memory/v1?tag_1=client_123&category=deadline" \ -H "Authorization: Bearer $CASEDEV_API_KEY"# Search preferences onlycurl -X POST https://api.case.dev/memory/v1/search \ -H "Authorization: Bearer $CASEDEV_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "communication method", "tag_1": "client_123", "category": "preference" }'
# Get only deadline memories for a clientcasedev memory:v1 list --tag-1 client_123 --category deadline# Search preferences onlycasedev memory:v1 search --query "communication method" --tag-1 client_123 --category preference
// Get only deadline memories for a clientconst deadlines = await client.memory.list({ tag_1: 'client_123', category: 'deadline'});// Search preferences onlyconst prefs = await client.memory.search({ query: 'communication method', tag_1: 'client_123', category: 'preference'});
# Get only deadline memories for a clientdeadlines = client.memory.v1.list(tag_1='client_123', category='deadline')# Search preferences onlyprefs = client.memory.v1.search( query='communication method', tag_1='client_123', category='preference')
// Get only deadline memories for a clientdeadlines, _ := client.Memory.V1.List(ctx, casedev.MemoryV1ListParams{ Tag1: casedev.F("client_123"), Category: casedev.F("deadline"),})// Search preferences onlyprefs, _ := client.Memory.V1.Search(ctx, casedev.MemoryV1SearchParams{ Query: casedev.F("communication method"), Tag1: casedev.F("client_123"), Category: casedev.F("preference"),})
# List all memories for a clientcurl "https://api.case.dev/memory/v1?tag_1=client_123&limit=50" \ -H "Authorization: Bearer $CASEDEV_API_KEY"# List with multiple filterscurl "https://api.case.dev/memory/v1?tag_1=client_123&tag_2=matter_456&category=deadline&limit=20&offset=0" \ -H "Authorization: Bearer $CASEDEV_API_KEY"
# List all memories for a clientcasedev memory:v1 list --tag-1 client_123 --limit 50# List with multiple filterscasedev memory:v1 list \ --tag-1 client_123 \ --tag-2 matter_456 \ --category deadline \ --limit 20
// List all memories for a clientconst all = await client.memory.list({ tag_1: 'client_123', limit: 50});// List with multiple filtersconst filtered = await client.memory.list({ tag_1: 'client_123', tag_2: 'matter_456', category: 'deadline', limit: 20, offset: 0});console.log(filtered.results); // Array of memoriesconsole.log(filtered.count); // Total count matching filters
# List all memories for a clientall_memories = client.memory.v1.list(tag_1='client_123', limit=50)# List with multiple filtersfiltered = client.memory.v1.list( tag_1='client_123', tag_2='matter_456', category='deadline', limit=20, offset=0)print(filtered.results) # Array of memoriesprint(filtered.count) # Total count matching filters
// List all memories for a clientall, _ := client.Memory.V1.List(ctx, casedev.MemoryV1ListParams{ Tag1: casedev.F("client_123"), Limit: casedev.F(int64(50)),})// List with multiple filtersfiltered, _ := client.Memory.V1.List(ctx, casedev.MemoryV1ListParams{ Tag1: casedev.F("client_123"), Tag2: casedev.F("matter_456"), Category: casedev.F("deadline"), Limit: casedev.F(int64(20)), Offset: casedev.F(int64(0)),})fmt.Println(filtered.Results) // Array of memoriesfmt.Println(filtered.Count) // Total count matching filters
# Delete all memories for a clientcasedev memory:v1 delete-all --tag-1 client_123# Delete memories for a specific mattercasedev memory:v1 delete-all --tag-1 client_123 --tag-2 matter_456
// Delete all memories for a clientawait client.memory.deleteMany({ tag_1: 'client_123'});// Delete memories for a specific matterawait client.memory.deleteMany({ tag_1: 'client_123', tag_2: 'matter_456'});
# Delete all memories for a clientclient.memory.v1.delete_all(tag_1='client_123')# Delete memories for a specific matterclient.memory.v1.delete_all(tag_1='client_123', tag_2='matter_456')
// Delete all memories for a clientclient.Memory.V1.DeleteAll(ctx, casedev.MemoryV1DeleteAllParams{ Tag1: casedev.F("client_123"),})// Delete memories for a specific matterclient.Memory.V1.DeleteAll(ctx, casedev.MemoryV1DeleteAllParams{ Tag1: casedev.F("client_123"), Tag2: casedev.F("matter_456"),})
Bulk delete removes all matching memories. Use with caution.
casedev memory:v1 create \ --message '{role: user, content: "Patient reports headaches and nausea."}' \ --tag-1 patient_123 \ --extraction-prompt "You are a medical memory extraction system. Extract discrete facts about the patient."
await client.memory.add({ messages: conversation, tag_1: 'patient_123', extraction_prompt: `You are a medical memory extraction system.Extract discrete facts about the patient, focusing on:- Symptoms and conditions- Medications and dosages- Allergies and reactions- Treatment preferencesOutput ONLY a valid JSON array with this structure:[{"content": "fact", "category": "allergy|medication|symptom|preference", "confidence": 0.9}]`});
result = client.memory.v1.create( messages=conversation, tag_1='patient_123', extraction_prompt="""You are a medical memory extraction system.Extract discrete facts about the patient, focusing on:- Symptoms and conditions- Medications and dosages- Allergies and reactions- Treatment preferencesOutput ONLY a valid JSON array with this structure:[{"content": "fact", "category": "allergy|medication|symptom|preference", "confidence": 0.9}]""")
result, _ := client.Memory.V1.New(ctx, casedev.MemoryV1NewParams{ Messages: casedev.F(conversation), Tag1: casedev.F("patient_123"), ExtractionPrompt: casedev.F(`You are a medical memory extraction system.Extract discrete facts about the patient, focusing on:- Symptoms and conditions- Medications and dosages- Allergies and reactions- Treatment preferencesOutput ONLY a valid JSON array with this structure:[{"content": "fact", "category": "allergy|medication|symptom|preference", "confidence": 0.9}]`),})