Overview
Generate human-readable narrative summaries of the knowledge graph using LLM-based generation. Creates entity descriptions, community summaries, and overall narrative document.Usage
Options
LLM model for narrative generation (e.g.,
openai/gpt-4o, anthropic/claude-3-5-sonnet-20241022). Overrides config default.Path to custom domain YAML file. Used for system context in generation prompts.
Bundled domain name (e.g.,
general, osint). Use -d as shorthand.Output directory containing graph data. Use
-o as shorthand.Skip per-entity descriptions. Generates only high-level narrative and community summaries.
Maximum cost budget in USD. Generation stops when limit is reached.
Only regenerate community labels (cost: ~$0.01). Useful for quick community relabeling.
Enable verbose logging. Use
-v as shorthand.Behavior
Generation Process
- Load Graph - Reads
graph_data.json - Community Detection - Identifies graph communities
- Community Labeling - Generates descriptive labels for each community
- Entity Descriptions - Creates narrative description for each entity (unless
--no-descriptions) - Overall Narrative - Synthesizes high-level summary
Community Detection
Uses graph algorithms to identify densely connected subgraphs representing themes or topics in the knowledge base.Cost Management
Narrative generation can be expensive for large graphs:- Use
--max-costto limit spending - Use
--no-descriptionsto skip entity descriptions (~50-80% cost savings) - Use
--communities-onlyfor minimal regeneration (~$0.01)
Output Files
narrative.md
Markdown document containing:- Overall summary of knowledge graph
- Community summaries with key entities
- Statistics and insights
{output_dir}/narrative.md
entity_descriptions.json
JSON file mapping entity IDs to narrative descriptions:{output_dir}/entity_descriptions.json
Used by:
sift view- Shows descriptions in visualizationsift search --description- Displays in search resultssift export- Includes in exported formats
communities.json
Community detection results with labels. Saved to:{output_dir}/communities.json
Examples
Full narrative generation
Quick community-only generation
Without entity descriptions
With cost limit
With domain context
Output Summary
Displays:- Output file location
- Total cost in USD
- Pipeline completion message
Next Steps
After narrative generation:Performance Considerations
Large Graphs
For graphs with 1000+ entities:- Expect $5-20 cost for full generation
- Use
--no-descriptionsto reduce cost - Consider
--max-costto limit spending
Model Selection
- Fast/Cheap:
openai/gpt-4o-mini(~$0.10-0.50 for typical graph) - Quality:
anthropic/claude-3-5-sonnet-20241022(~$2-10 for typical graph) - Local:
ollama/llama3(free, slower, lower quality)
Error Handling
Exits with error if:- No
graph_data.jsonfound (runsift buildfirst) - API key validation fails
- Cost limit exceeded mid-generation