The problem
Your AI agent forgets everything between conversations. Users repeat themselves, context is lost, and the experience feels broken.
The solution
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.
How it works
Add memories - Pass conversation messages, we extract discrete facts
Search memories - Query by meaning, not just keywords
Filter by tags - Scope memories using 12 generic indexed tag fields
The API handles:
Fact extraction (turning “I like X but hate Y” into separate facts)
Deduplication (updating existing facts instead of creating duplicates)
Semantic search (finding “investment preferences” when you stored “conservative strategies”)
Quick start
cURL
CLI
Typescript
Python
Go
# Add a memory
curl -X POST https://api.case.dev/memory/v1 \
-H "Authorization: Bearer $CASEDEV_API_KEY " \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "Remember that this client prefers conservative investments."}
],
"tag_1": "client_123",
"tag_2": "matter_456",
"category": "preference"
}'
# Search memories
curl -X POST https://api.case.dev/memory/v1/search \
-H "Authorization: Bearer $CASEDEV_API_KEY " \
-H "Content-Type: application/json" \
-d '{
"query": "investment preferences",
"tag_1": "client_123",
"top_k": 5
}'
Tag fields
Memory provides 12 generic indexed tag fields (tag_1 through tag_12) for filtering. You decide what each tag means for your application:
Use Case tag_1 tag_2 tag_3 tag_4 Legal client_id matter_id attorney_id session_id Healthcare patient_id encounter_id provider_id department E-commerce customer_id order_id product_id session_id Support user_id ticket_id agent_id channel
All tag fields are indexed for fast filtering. Use them for any dimension you need to query by.
Example: Legal application
cURL
CLI
Typescript
Python
Go
# Store a memory scoped to client + matter
curl -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 deadlines
curl -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 matter
curl "https://api.case.dev/memory/v1?tag_1=client_acme_corp&tag_2=matter_patent_2026_001" \
-H "Authorization: Bearer $CASEDEV_API_KEY "
Categories
The category field is free-form text - you define your own categories. Here are suggested categories for different domains:
Legal categories
Category Description Example factGeneral facts about client/matter ”Client founded company in 2019” preferenceCommunication or work preferences ”Client prefers email updates” deadlineFiling deadlines, court dates ”Motion due March 15th” decisionDecisions made by client/court ”Client approved settlement terms” contactContact information ”Client’s assistant is Jane (jane@acme.com )“ relationshipRelationships between parties ”Defendant is client’s former business partner” court_rulingCourt rulings and precedents ”Judge denied motion to dismiss” proceduralProcedural information ”Case assigned to Judge Thompson”
Healthcare categories
Category Description allergyPatient allergies medicationCurrent medications preferenceTreatment preferences historyMedical history family_historyFamily medical history socialSocial/lifestyle factors
Filtering by category
cURL
CLI
Typescript
Python
Go
# Get only deadline memories for a client
curl "https://api.case.dev/memory/v1?tag_1=client_123&category=deadline" \
-H "Authorization: Bearer $CASEDEV_API_KEY "
# Search preferences only
curl -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"
}'
Listing memories
cURL
CLI
Typescript
Python
Go
# List all memories for a client
curl "https://api.case.dev/memory/v1?tag_1=client_123&limit=50" \
-H "Authorization: Bearer $CASEDEV_API_KEY "
# List with multiple filters
curl "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 "
Deleting memories
Delete a single memory
cURL
CLI
Typescript
Python
Go
curl -X DELETE https://api.case.dev/memory/v1/mem_abc123 \
-H "Authorization: Bearer $CASEDEV_API_KEY "
cURL
CLI
Typescript
Python
Go
curl -X POST https://api.case.dev/memory/v1/delete-many \
-H "Authorization: Bearer $CASEDEV_API_KEY " \
-H "Content-Type: application/json" \
-d '{}'
Bulk delete removes all matching memories. Use with caution.
Memory events
When you add memories, the API returns what happened to each extracted fact:
Event Description ADDNew memory created UPDATEExisting memory was updated/merged DELETEContradicting info caused memory deletion NONEDuplicate - memory already exists
cURL
CLI
Typescript
Python
Go
curl -X POST https://api.case.dev/memory/v1/add \
-H "Authorization: Bearer $CASEDEV_API_KEY " \
-H "Content-Type: application/json" \
-d '{}'
To store a fact directly without LLM extraction, set infer: false:
cURL
CLI
Typescript
Python
Go
curl -X POST https://api.case.dev/memory/v1/add \
-H "Authorization: Bearer $CASEDEV_API_KEY " \
-H "Content-Type: application/json" \
-d '{}'
For domain-specific extraction, provide a custom prompt:
cURL
CLI
Typescript
Python
Go
curl -X POST https://api.case.dev/memory/v1/add \
-H "Authorization: Bearer $CASEDEV_API_KEY " \
-H "Content-Type: application/json" \
-d '{}'
Pricing
Operation Cost Add memory $0.001 per operation Search $0.001 per operation List/Get/Delete Free
LLM usage for fact extraction and embeddings is billed separately through the LLM service at standard rates.
LLMs Use memories as context for chat completions
Vault Store documents, use Memory for extracted facts