Skip to main content
Entity resolution identifies when multiple extracted entities refer to the same real-world thing (e.g., “Dr. Smith”, “John Smith”, and “J. Smith” are all the same person). This workflow uses LLMs to propose merges, then lets you review and apply them.

Workflow Overview

1

Find Duplicates

sift resolve uses LLM analysis to identify likely duplicates
2

Review Proposals

sift review presents proposals interactively for approval/rejection
3

Apply Merges

sift apply-merges consolidates approved entities and cleans up rejected relations

Step 1: Find Duplicates

This analyzes entities in graph_data.json and generates merge_proposals.yaml.

Command Options

--model
string
LLM model for resolution (defaults to SIFT_DEFAULT_MODEL)
--domain
path
Path to domain YAML (for system context)
--domain-name
string
default:"schema-free"
Bundled domain name
-c, --concurrency
integer
default:"4"
Concurrent LLM calls for faster resolution
--rpm
integer
default:"40"
Max requests per minute
--embeddings
boolean
Use semantic clustering instead of alphabetical batching (requires pip install sift-kg[embeddings])
-o, --output
path
Output directory (defaults to output/)
-v, --verbose
boolean
Verbose logging

How It Works

1

Group by Type

Entities are grouped by type (PERSON, ORGANIZATION, etc.)
2

Sort for Clustering

  • PERSON entities sorted by surname (“Bradley Edwards”, “Detective Edwards”, “Mr. Edwards” cluster together)
  • Other types sorted alphabetically
3

Batch Processing

Large entity lists split into overlapping batches (100 entities per batch, 20 entity overlap)
4

LLM Analysis

Each batch sent to LLM which identifies:
  • Duplicates: Same entity with name variations
  • Variants: Related entities with EXTENDS relationship (e.g., “deep learning” extends “machine learning”)
5

Cross-Type Dedup

Finds entities with identical names but different types (no LLM needed)

Example Output

Step 2: Review Proposals

Interactive terminal UI for reviewing merge proposals and flagged relations.

Command Options

--auto-approve
float
default:"0.85"
Auto-confirm proposals where all members have confidence ≥ this threshold. Set to 1.0 to disable.
--auto-reject
float
default:"0.5"
Auto-reject relations with confidence below this threshold. Set to 0.0 to disable.
-o, --output
path
Output directory containing merge_proposals.yaml and relation_review.yaml

Interactive Review

For each proposal, you see:
Controls:
  • a — Approve merge (status → CONFIRMED)
  • r — Reject merge (status → REJECTED)
  • s — Skip for now (status stays DRAFT)
  • q — Quit and save progress

Auto-Approve/Reject

High-confidence proposals are auto-approved before interactive review:
Similarly, very low-confidence relations are auto-rejected.

Merge Proposal File

Proposals are saved to merge_proposals.yaml:
Status values:
  • DRAFT — Not yet reviewed
  • CONFIRMED — User approved, will be applied
  • REJECTED — User rejected, will be ignored

Manual Editing

You can edit the YAML file directly:

Relation Review

Flagged relations (from sift build or sift resolve) appear in relation_review.yaml:
During sift review, you approve or reject each relation:

Step 3: Apply Merges

Applies all CONFIRMED merges and removes REJECTED relations.

What Happens During Apply

1

Merge Entities

  • All member entities merged into canonical entity
  • Attributes combined (lists merged, highest confidence for conflicts)
  • Source documents tracked from all members
2

Redirect Relations

  • Relations pointing to merged entities updated to point to canonical
  • Duplicate relations consolidated with highest confidence
3

Remove Rejected Relations

  • Relations marked REJECTED in relation_review.yaml are deleted
4

Update Graph

  • Modified graph saved to graph_data.json
  • Statistics displayed

Example Output

Complete Example Workflow

Advanced: Semantic Clustering

Use embeddings for smarter entity grouping:
This groups entities by meaning rather than alphabetically:
  • “neural networks” clusters with “deep learning” (not with “networks”)
  • “CEO” clusters with “chief executive” (not with “CFO”)
More accurate but slower and requires ~500MB model download.

Tips for Better Resolution

1

Use Specific Models

Better models produce more accurate merge proposals:
2

Provide Domain Context

Add system context to your domain YAML so the LLM understands your entity types:
3

Iterative Resolution

Run sift resolvesift reviewsift apply-merges multiple times. Each iteration improves graph quality.
4

Manual YAML Edits

For bulk operations, edit merge_proposals.yaml directly in your editor. Change all matching patterns to CONFIRMED or REJECTED.

Troubleshooting

No proposals found

This is normal for:
  • Small graphs (fewer than 50 entities)
  • Consistent entity naming in sources
  • After previous resolution passes

Too many false positives

Lower confidence threshold or use better model:

Embeddings import error

Or fall back to alphabetical batching:

“Graph not found”

Run sift build first to create graph_data.json.

Next Steps

Visualize Graph

Explore your cleaned knowledge graph

Generate Narrative

Create human-readable summaries

Export Data

Export to external tools for analysis