From d826faaaeb64b5f190edc49058a475279cd86dc9 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Thu, 8 Jan 2026 18:31:38 -0800 Subject: [PATCH] Update apps/docs/user-profiles/examples.mdx Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> --- apps/docs/user-profiles/examples.mdx | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/docs/user-profiles/examples.mdx b/apps/docs/user-profiles/examples.mdx index 75ae163a..452a456f 100644 --- a/apps/docs/user-profiles/examples.mdx +++ b/apps/docs/user-profiles/examples.mdx @@ -20,7 +20,10 @@ async function handleChatMessage(userId: string, message: string) { 'Authorization': `Bearer ${process.env.SUPERMEMORY_API_KEY}`, 'Content-Type': 'application/json' }, - body: JSON.stringify({ containerTag: userId }) + body: JSON.stringify({ + containerTag: userId, + threshold: 0.7 + }) }); const { profile } = await profileResponse.json(); @@ -60,7 +63,10 @@ async def handle_chat_message(user_id: str, message: str): 'Authorization': f'Bearer {os.getenv("SUPERMEMORY_API_KEY")}', 'Content-Type': 'application/json' }, - json={'containerTag': user_id} + json={ + 'containerTag': user_id, + 'threshold': 0.7 + } ) profile = response.json()['profile'] @@ -109,6 +115,7 @@ async function getFullContext(userId: string, userQuery: string) { }, body: JSON.stringify({ containerTag: userId, + threshold: 0.7, q: userQuery // Include the user's query }) }); @@ -151,6 +158,7 @@ async def get_full_context(user_id: str, user_query: str): }, json={ 'containerTag': user_id, + 'threshold': 0.7, 'q': user_query # Include the user's query } ) @@ -194,7 +202,10 @@ async function advancedContext(userId: string, query: string) { 'Authorization': `Bearer ${process.env.SUPERMEMORY_API_KEY}`, 'Content-Type': 'application/json' }, - body: JSON.stringify({ containerTag: userId }) + body: JSON.stringify({ + containerTag: userId, + threshold: 0.7 + }) }), fetch('https://api.supermemory.ai/v3/search', { method: 'POST', @@ -237,7 +248,10 @@ async function withUserProfile(req, res, next) { 'Authorization': `Bearer ${process.env.SUPERMEMORY_API_KEY}`, 'Content-Type': 'application/json' }, - body: JSON.stringify({ containerTag: req.user.id }) + body: JSON.stringify({ + containerTag: req.user.id, + threshold: 0.7 + }) }); req.userProfile = await response.json(); @@ -280,7 +294,10 @@ export async function POST(req: NextRequest) { 'Authorization': `Bearer ${process.env.SUPERMEMORY_API_KEY}`, 'Content-Type': 'application/json' }, - body: JSON.stringify({ containerTag: userId }) + body: JSON.stringify({ + containerTag: userId, + threshold: 0.7 + }) }); const { profile } = await profileRes.json();