Workflow Overview
1
Find Duplicates
sift resolve uses LLM analysis to identify likely duplicates2
Review Proposals
sift review presents proposals interactively for approval/rejection3
Apply Merges
sift apply-merges consolidates approved entities and cleans up rejected relationsStep 1: Find Duplicates
graph_data.json and generates merge_proposals.yaml.
Command Options
LLM model for resolution (defaults to
SIFT_DEFAULT_MODEL)Path to domain YAML (for system context)
Bundled domain name
Concurrent LLM calls for faster resolution
Max requests per minute
Use semantic clustering instead of alphabetical batching (requires
pip install sift-kg[embeddings])Output directory (defaults to
output/)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
Command Options
Auto-confirm proposals where all members have confidence ≥ this threshold. Set to 1.0 to disable.
Auto-reject relations with confidence below this threshold. Set to 0.0 to disable.
Output directory containing
merge_proposals.yaml and relation_review.yamlInteractive Review
For each proposal, you see: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:Merge Proposal File
Proposals are saved tomerge_proposals.yaml:
DRAFT— Not yet reviewedCONFIRMED— User approved, will be appliedREJECTED— User rejected, will be ignored
Manual Editing
You can edit the YAML file directly:Relation Review
Flagged relations (fromsift build or sift resolve) appear in relation_review.yaml:
sift review, you approve or reject each relation:
Step 3: Apply Merges
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
REJECTEDinrelation_review.yamlare 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:- “neural networks” clusters with “deep learning” (not with “networks”)
- “CEO” clusters with “chief executive” (not with “CFO”)
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 resolve → sift review → sift 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
“Graph not found”
Runsift 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