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

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

Command Options

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

Filtering Options

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

Visualization Examples

Basic View

# Full graph
sift view

# Custom output location
sift view --to ./reports/knowledge-graph.html

# Generate without opening
sift view --no-open

Filtered Views

# Show 50 most connected entities
sift view --top 50

# Top 20 entities, high confidence only
sift view --top 20 --min-confidence 0.8

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
Min connections: [slider] 0 ━━━●━━━ 10
Confidence Filter: Show only high-quality extractions
Min confidence: [slider] 0 ━━━━━●━ 1.0
Source Document Count: Entities mentioned in multiple docs
Min sources: [slider] 1 ━●━━━━━ 5
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

sift search "John Smith"
Command-line search for entities by name or alias.

Command Options

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

Search Examples

# Find entities matching "Smith"
sift search Smith

# Case-insensitive, searches names and aliases
sift search "acme corp"

Example Output

$ sift search "John Smith" --relations

3 results

  PERSON: John Smith
    aka: J. Smith, Dr. Smith
    Connections: 15
    Sources: document1, document2, document5
    → WORKS_FOR → Acme Corporation
    → FOUNDED → SmithCo Industries
    → COLLABORATED_WITH → Jane Doe
    ← SUPERVISED → Bob Johnson
    ← HIRED → Acme Corporation
    ... 10 more (use --verbose to show all)

  PERSON: Bradley Smith
    Connections: 3
    Sources: document7
    → ATTENDED → Stanford University

Use Cases

Scenario: Finding connections between people and organizations
# Find all mentions of a person
sift search "John Doe" --relations --description

# View their network
sift view --neighborhood "John Doe" --depth 2

# Focus on high-confidence connections only
sift view --neighborhood "John Doe" --min-confidence 0.8
Scenario: Analyzing what was extracted from one document
# View entities from specific report
sift view --source-doc "annual-report-2023.pdf"

# Search within that document
sift search "revenue" --type CONCEPT
Scenario: Finding clusters of related entities
# Generate view with communities
sift view

# In browser: check community colors on entity borders
# Export communities.json for external analysis

# Focus on specific community
sift view --community "Community 3"
Scenario: Checking extraction quality
# View low-confidence entities (may need review)
sift view --min-confidence 0.5

# Find isolated entities (no relations)
sift view --top 200  # Then filter by degree = 0 in sidebar

# Check entities with few source documents
# In sidebar: set "Min source docs" to 1

Performance Tips

1

Filter Large Graphs

For graphs with >1000 entities, use filters to reduce visual complexity:
sift view --top 100
sift view --min-confidence 0.7
2

Use Neighborhoods

Focus on specific areas instead of viewing entire graph:
sift view --neighborhood "key-entity" --depth 2
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:
# Generate static HTML
sift view --to ./report.html --no-open

# Share via email, upload to web server, or include in reports
# No sift-kg installation needed to view
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:
sift view --verbose  # Shows entity/relation counts after filtering
Relax filters:
sift view --min-confidence 0.0 --top 1000

“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:
# Rebuild communities
sift narrate --communities-only  # Fast, ~$0.01

# Or regenerate full view
sift view

Next Steps

Export Data

Export graphs for external analysis tools

Generate Narratives

Create AI-generated summaries of your knowledge graph

Build docs developers (and LLMs) love