Overview
TheUser class represents a user in your RecallrAI project. It provides methods for managing sessions, memories, messages, and merge conflicts.
Properties
Unique identifier for the user.
User metadata as an object.
Per-user merge conflict override.
true = always raise merge conflicts for this user. false = never raise. undefined = inherit the project-level setting.UTC timestamp when the user was created.
UTC timestamp of the user’s last activity.
User Management Methods
update()
New metadata to replace the existing metadata.
Optional new user ID. Must be unique within your project.
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()
Seconds of inactivity before auto-processing. Default:
600.Optional metadata for the session.
getSession()
The UUID of the session to retrieve.
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.Filter by memory categories. Only memories matching these categories are returned.
Filter by specific session IDs.
Filter by session metadata.
Number of memories to skip. Default:
0Maximum number of memories to return. Range: 1-200. Default:
20Include version history for each memory. Default:
trueInclude related memories. Default:
trueUserMemoriesList object
Raises: UserNotFoundError, InvalidCategoriesError
getMemory()
Retrieve a single memory by its ID.UUID of the memory to retrieve.
Include version history for the memory. Default:
trueInclude related memories. Default:
trueUserMemoryItem
Raises: RecallrAIError
deleteMemory()
Delete a specific memory version, with an option to also remove all previous versions in the chain.UUID of the memory to delete. Can be any version in the version chain.
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

