Identifying Users
Identifying users in supermemory
You can enable built-in cross-conversational memory by sending Supermemory a user_id
or a conversation_id
in the request.
How Supermemory Identifies Users
Supermemory will find the user ID in the following places (in order of priority):
For all endpoints:
-
Query Parameters:
user_id
in the query string
-
HTTP Headers:
x-supermemory-user-id
header
For OpenAI-compatible endpoints:
- Request Body:
user
fieldmetadata.user_id
fieldmetadata.conversation_id
field (fallback)
For Anthropic-compatible endpoints:
- Request Body:
metadata.user_id
fieldmetadata.conversation_id
field (fallback)
For Gemini-compatible endpoints:
- Request Body:
labels.user_id
fieldlabels.conversation_id
field (fallback)
Stateful vs. Stateless Usage
Supermemory is stateful when a user_id
is provided. This means:
- The system will store and retrieve context across multiple conversations for the same user ID
- The full context of previous interactions is maintained
If no user ID is provided, Supermemory operates in a stateless mode, treating each conversation independently.
Important Considerations
- If multiple users have the first 20k tokens exactly (matching content) and no user ID is provided, users may potentially see each other’s data
- Using a hash-matching system, Supermemory ignores duplicate messages
- For users with many distinct conversations, Supermemory will internally track and manage these conversations
- It’s recommended to always provide a user ID for consistent memory retrieval across sessions