Skip to main content
sift-kg provides two ways to explore your knowledge graph: interactive visualization with sift view and command-line search with sift search.

Interactive Visualization

Generates an interactive HTML visualization and opens it in your browser.

Command Options

path
Output directory containing graph_data.json
path
Custom path for the HTML file (defaults to output/graph.html)
boolean
Generate HTML but don’t open browser
boolean
Verbose logging

Filtering Options

integer
Show only the top N entities by connection count (and their direct neighbors)
float
Hide entities and relations below this confidence threshold (0.0-1.0)
string
Show only entities from a specific document
string
Center view on a specific entity and show N-hop neighborhood
integer
default:"1"
Number of hops for neighborhood view (use with --neighborhood)
string
Focus on a specific community cluster (e.g., “Community 1”)

Visualization Examples

Basic View

Filtered Views

Interactive Features

The visualization includes a rich sidebar with: Type to find entities by name (case-insensitive, fuzzy matching).

Entity Type Toggles

Show/hide entity types:
  • Click checkbox to toggle visibility
  • Click color picker to change type color
  • All changes update graph in real-time

Relation Type Toggles

Control which relations are displayed:
  • Show/hide by relation type
  • Relation count shown for each type
  • MENTIONED_IN hidden by default (metadata)

Community Filters

Toggle visibility by community cluster:
  • Communities auto-detected using Louvain algorithm
  • Border colors indicate community membership
  • Filter to single community for focused analysis

Detail Panel

Click any node to see:
  • Entity name and type
  • All attributes
  • Aliases
  • Source documents
  • Generated description (if sift narrate was run)
  • All incoming/outgoing relations
Click any edge to see:
  • Relation type
  • Confidence score
  • Evidence text
  • Support count (how many times extracted)
  • Support documents

Dynamic Filters

Degree Filter: Hide low-connectivity entities
Confidence Filter: Show only high-quality extractions
Source Document Count: Entities mentioned in multiple docs
Source Document Selector: Dropdown to filter by specific document

Physics Controls

Adjust graph layout:
  • Pause/resume physics simulation
  • Freeze positions after stabilization
  • Reset zoom and positions

Visualization Colors

Entity Colors (by Type)

Predefined semantic colors for common types:
  • PERSON: Blue
  • ORGANIZATION: Green
  • LOCATION: Purple
  • EVENT: Orange
  • DOCUMENT: Gray
Other types auto-assigned from palette with maximum hue separation.

Relation Colors (by Type)

Semantic colors for common relations:
  • EXTENDS: Purple (inheritance)
  • SUPPORTS: Green (evidence for)
  • CONTRADICTS: Red (evidence against)
  • USES_METHOD: Blue (methodology)
  • MENTIONED_IN: Dark gray (low emphasis)
Other types auto-assigned from edge color palette.

Community Colors

Community border colors use golden angle spacing for maximum visual separation.

Search Command

Command-line search for entities by name or alias.

Command Options

string
required
Search term (matches entity names and aliases, case-insensitive)
boolean
Show connected entities and their relations
boolean
Show entity description (requires sift narrate to have been run)
string
Filter results by entity type (e.g., PERSON, ORGANIZATION)
path
Output directory containing graph_data.json
boolean
Show all relations (default limits to 10)

Search Examples

Example Output

Use Cases

Scenario: Finding connections between people and organizations
Scenario: Analyzing what was extracted from one document
Scenario: Finding clusters of related entities
Scenario: Checking extraction quality

Performance Tips

1

Filter Large Graphs

For graphs with >1000 entities, use filters to reduce visual complexity:
2

Use Neighborhoods

Focus on specific areas instead of viewing entire graph:
3

Hide Metadata Relations

MENTIONED_IN edges clutter large graphs. They’re hidden by default, but can be shown via the sidebar if needed.
4

Freeze Physics

In the visualization, pause physics after initial layout stabilizes to improve browser performance.

Saving and Sharing

The generated HTML is fully self-contained:
All JavaScript, CSS, and graph data embedded in a single file.

Troubleshooting

Blank or empty visualization

Cause: All entities filtered out Solution: Check filters and graph size:
Relax filters:

“Graph not found”

Run sift build first to create graph_data.json.

Slow or laggy browser performance

For large graphs (>500 entities):
  • Use filtering: --top 200 --min-confidence 0.7
  • Pause physics after stabilization
  • Use neighborhood view instead of full graph
  • Close detail panel when not needed

Search returns no results

  • Check spelling (search is case-insensitive but must match name/alias)
  • Try partial terms: sift search Smith instead of sift search "John Smith"
  • Check entity type filter: --type may be excluding results
  • Verify graph contains entities: sift search "" --verbose

Communities not showing

Communities auto-detected on first sift view. If missing:

Next Steps

Export Data

Export graphs for external analysis tools

Generate Narratives

Create AI-generated summaries of your knowledge graph