Overview
TheUser class represents a user in your RecallrAI project. It provides methods for managing sessions, memories, messages, and merge conflicts.
Properties
string
Unique identifier for the user.
object
User metadata as an object.
boolean | undefined
Per-user merge conflict override.
true = always raise merge conflicts for this user. false = never raise. undefined = inherit the project-level setting.datetime
UTC timestamp when the user was created.
datetime
UTC timestamp of the user’s last activity.
User Management Methods
update()
object
New metadata to replace the existing metadata.
string
Optional new user ID. Must be unique within your project.
boolean
Per-user merge conflict override.
true = always raise merge conflicts for this user. false = never raise. Set undefined to reset to the project-level default (omit the field from the call).void
Raises: UserNotFoundError, UserAlreadyExistsError
refresh()
void
Raises: UserNotFoundError
delete()
void
Raises: UserNotFoundError
Session Management Methods
createSession()
number
Seconds of inactivity before auto-processing. Default:
600.object
Optional metadata for the session.
getSession()
string
required
The UUID of the session to retrieve.
boolean
default:"true"
Whether to validate session existence via API before creating the instance. Set
false only when userId and sessionId are already trusted.Session
Raises: UserNotFoundError, SessionNotFoundError
When
{ validate: false } is used, fields that require an API lookup (for example status, createdAt, and metadata) are set to UNAVAILABLE until you call refresh().
Import UNAVAILABLE from recallrai when checking these values.Memory Management Methods
listMemories()
List user memories with optional filtering.string[]
Filter by memory categories. Only memories matching these categories are returned.
string[]
Filter by specific session IDs.
object
Filter by session metadata.
number
Number of memories to skip. Default:
0number
Maximum number of memories to return. Range: 1-200. Default:
20boolean
Include version history for each memory. Default:
trueboolean
Include related memories. Default:
trueUserMemoriesList object
Raises: UserNotFoundError, InvalidCategoriesError
getMemory()
Retrieve a single memory by its ID.string
required
UUID of the memory to retrieve.
boolean
Include version history for the memory. Default:
trueboolean
Include related memories. Default:
trueUserMemoryItem
Raises: RecallrAIError
deleteMemory()
Delete a specific memory version, with an option to also remove all previous versions in the chain.string
required
UUID of the memory to delete. Can be any version in the version chain.
boolean
If
true, deletes the specified version and all previous versions in the chain. If false (default), deletes only the specified version.void
Raises: RecallrAIError
UserMemoryItem Fields
Each memory item contains:memoryId: Unique identifier for the current versioncategories: Array of category stringscontent: Current version’s content texteventDateStart: UTCDatewhen the event started (actual event time, not when it was recorded)eventDateEnd: UTCDatewhen the event ended (actual event time, not when it was recorded)createdAt: UTCDatewhen this memory version was created (when it was recorded in the system)expiredAt: UTCDatewhen this version expired — only set when viewing an expired/previous versionexpirationReason: Why this version was superseded (MERGE_CONFLICT,ADDITION_TO_EXISTING_MEMORY,TEMPORAL_CONFLICT) — only set for expired versionssessionId: ID of the session that created this versionversionNumber: Current version numbertotalVersions: Total number of versionshasPreviousVersions: Boolean indicating multiple versions existpreviousVersions: Array ofMemoryVersionInfoobjects (optional)connectedMemories: Array ofMemoryRelationshipobjects (optional)mergeConflictInProgress: Boolean indicating an active (unresolved) conflict on this memorymergeConflictId: ID of the merge conflict that caused this memory to expire — only set whenexpirationReasonisMERGE_CONFLICTand a conflict record exists (manually resolved conflicts only)
MemoryVersionInfo object in previousVersions contains:
memoryId: ID of that specific version (can be passed togetMemory()for full details)versionNumber: Version number (1 = oldest)content: Content of that versioneventDateStart/eventDateEnd: Event timestamps for that versioncreatedAt: When that version was createdexpiredAt: When that version expiredexpirationReason: Why it was supersededmergeConflictId: Conflict that caused expiration, if applicable
The difference between
eventDateStart/eventDateEnd and createdAt:- Event dates represent when the event actually occurred in the real world (e.g., “I met John on Monday”)
- Created at represents when the memory was extracted and stored in the system

