Documentation
¶
Overview ¶
Package conflict detects and resolves contradictory memories. When a new memory contradicts an existing one (same entity/topic, different fact), the old memory is auto-superseded. Based on Mem0's conflict resolution approach.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContradictionDetail ¶
type ContradictionDetail struct {
OldNodeID string `json:"old_node_id"`
NewNodeID string `json:"new_node_id"`
OverlapRatio float64 `json:"overlap_ratio"`
Signals []string `json:"signals"`
Confidence float64 `json:"confidence"`
}
ContradictionDetail provides structured information about a detected contradiction.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver detects and resolves memory conflicts.
func (*Resolver) CheckAndResolve ¶
CheckAndResolve checks if a new node contradicts existing nodes. If a contradiction is found, creates a supersedes edge and lowers the old node's confidence. Returns the list of superseded node IDs.
func (*Resolver) DetectContradictions ¶
func (r *Resolver) DetectContradictions(ctx context.Context, newNode *storage.Node) ([]ContradictionDetail, error)
DetectContradictions performs deep contradiction analysis between a new node and existing nodes. Unlike CheckAndResolve (which auto-supersedes), this method returns structured details about each detected contradiction for callers that need richer information (e.g., UI display, audit logging).