Overview
When RecallrAI processes sessions, it may detect conflicts between new memories and existing ones. The SDK provides comprehensive tools to handle these merge conflicts through clarifying questions.MergeConflict Class
TheMergeConflict class represents a conflict between memories that requires resolution.
Properties
Unique identifier for the merge conflict.
ID of the user this conflict belongs to.
Current status:
PENDING, IN_QUEUE, RESOLVING, RESOLVED, or FAILEDContent of the new memory that conflicts with existing ones.
List of existing memories that conflict with the new memory. Each contains:
content: Memory contentreason: Explanation of why it conflicts
List of questions to help resolve the conflict. Each contains:
question: The question textoptions: List of possible answers
UTC timestamp when the conflict was created.
UTC timestamp when resolved, or None if not yet resolved.
Additional data about the resolution, or None if not resolved.
List Merge Conflicts
List merge conflicts for a user with optional filtering.Number of conflicts to skip. Default:
0Maximum number of conflicts to return. Default:
10Filter by status. Options:
PENDING: Conflict detected and waiting for resolutionIN_QUEUE: Queued for automated processingRESOLVING: Being processedRESOLVED: Successfully resolvedFAILED: Resolution failed
Sort field:
created_at or resolved_at. Default: created_atSort order:
asc or desc. Default: descMergeConflictList object with conflicts, total, and has_more fields
Get a Specific Merge Conflict
Retrieve detailed information about a specific merge conflict.The UUID of the merge conflict to retrieve.
MergeConflict object
Raises: UserNotFoundError, MergeConflictNotFoundError
Resolve a Merge Conflict
Resolve a merge conflict by answering the clarifying questions.resolve() Method
List of answers to the clarifying questions. Each answer must include:
question: The question text (must match exactly)answer: Selected option (must be one of the valid options)message: Optional explanation for the choice
MergeConflictNotFoundError: Conflict doesn’t existMergeConflictAlreadyResolvedError: Conflict already processedMergeConflictInvalidQuestionsError: Questions don’t match original questionsMergeConflictMissingAnswersError: Not all questions have been answeredMergeConflictInvalidAnswerError: Answer is not a valid option
Refresh Merge Conflict
Refresh the merge conflict instance to get the latest status from the server.UserNotFoundError, MergeConflictNotFoundError
MergeConflictAnswer Model
When resolving conflicts, you need to createMergeConflictAnswer objects:
The exact question text from the conflict’s clarifying questions.
The selected option. Must be one of the valid options from the question.
Optional explanation for why this answer was selected.
Merge Conflict Statuses
PENDING
PENDING
Conflict has been detected and is waiting for resolution. You can call
resolve() to provide answers.IN_QUEUE
IN_QUEUE
Conflict is queued for automated processing by the system.
RESOLVING
RESOLVING
Conflict is currently being processed.
RESOLVED
RESOLVED
Conflict has been successfully resolved. The memories have been updated accordingly.
FAILED
FAILED
Conflict resolution failed. You may need to contact support or try resolving again.