From aab469e4d9e0f4e442ebf6800ec21baa3481e3a2 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Thu, 8 Jan 2026 18:34:50 -0800 Subject: [PATCH] Update apps/docs/user-profiles/api.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> --- apps/docs/user-profiles/api.mdx | 55 +++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/apps/docs/user-profiles/api.mdx b/apps/docs/user-profiles/api.mdx index f5adebd4..7501e791 100644 --- a/apps/docs/user-profiles/api.mdx +++ b/apps/docs/user-profiles/api.mdx @@ -25,7 +25,7 @@ Retrieves a user's profile, optionally combined with search results. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `containerTag` | string | Yes | The container tag (usually user ID) to get profiles for | -| `threshold` | float | Yes | Threshold for search results. Only results with a score above this threshold will be included. | +| `threshold` | float | No | Threshold for filtering search results. Only results with a score above this threshold will be included. | | `q` | string | No | Optional search query to include search results with the profile | ## Response @@ -75,8 +75,7 @@ const response = await fetch('https://api.supermemory.ai/v4/profile', { 'Content-Type': 'application/json' }, body: JSON.stringify({ - containerTag: 'user_123', - threshold: 0.7 + containerTag: 'user_123' }) }); @@ -97,8 +96,7 @@ response = requests.post( 'Content-Type': 'application/json' }, json={ - 'containerTag': 'user_123', - 'threshold': 0.7 + 'containerTag': 'user_123' } ) @@ -113,8 +111,7 @@ curl -X POST https://api.supermemory.ai/v4/profile \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ - "containerTag": "user_123", - "threshold": 0.7 + "containerTag": "user_123" }' ``` @@ -135,7 +132,6 @@ const response = await fetch('https://api.supermemory.ai/v4/profile', { }, body: JSON.stringify({ containerTag: 'user_123', - threshold: 0.7, q: 'deployment errors yesterday' }) }); @@ -158,7 +154,6 @@ response = requests.post( }, json={ 'containerTag': 'user_123', - 'threshold': 0.7, 'q': 'deployment errors yesterday' } ) @@ -171,6 +166,48 @@ search_results = data.get('searchResults', {}).get('results', []) +## Profile with Threshold + +Use the optional `threshold` parameter to filter search results by relevance score: + + + +```typescript TypeScript +const response = await fetch('https://api.supermemory.ai/v4/profile', { + method: 'POST', + headers: { + 'Authorization': `Bearer ${process.env.SUPERMEMORY_API_KEY}`, + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + containerTag: 'user_123', + threshold: 0.7, // Only include results with score > 0.7 + q: 'deployment errors yesterday' + }) +}); + +const data = await response.json(); +``` + +```python Python +response = requests.post( + 'https://api.supermemory.ai/v4/profile', + headers={ + 'Authorization': f'Bearer {os.getenv("SUPERMEMORY_API_KEY")}', + 'Content-Type': 'application/json' + }, + json={ + 'containerTag': 'user_123', + 'threshold': 0.7, # Only include results with score > 0.7 + 'q': 'deployment errors yesterday' + } +) + +data = response.json() +``` + + + ## Error Responses | Status | Description |