User
If you provided a userId
while creating memories, you can filter by user:
curl -X POST https://v2.api.supermemory.ai/search \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "machine learning",
"userId": "user_123"
}'
Document
Filter within a specific document:
curl -X POST https://v2.api.supermemory.ai/search \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "machine learning",
"docId": "doc_123"
}'
Filter results using metadata conditions:
curl -X POST https://v2.api.supermemory.ai/search \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "machine learning",
"filters": {
"AND": [
{
"key": "category",
"value": "technology",
"negate": false
},
{
"filterType": "numeric",
"key": "readingTime",
"value": "5",
"negate": false,
"numericOperator": "<="
}
]
}
}'
Category
Filter by predefined categories:
curl -X POST https://v2.api.supermemory.ai/search \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "research papers",
"categoriesFilter": ["technology", "science"]
}'