-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
60 lines (48 loc) · 2.5 KB
/
main.py
File metadata and controls
60 lines (48 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env python3
"""
Competitive Intelligence Database
USAGE:
python main.py # 5 competitors, 25 iterations (default)
python main.py --competitors 3 # 3 competitors
python main.py --iterations 15 # limit to 15 agent iterations
python main.py --industry "oil and gas" # specific industry
python main.py --streamlit # Launch dashboard
"""
import argparse
import subprocess
import sys
def main():
parser = argparse.ArgumentParser(description="Honeywell Competitive Intelligence")
parser.add_argument("--streamlit", action="store_true", help="Launch dashboard")
parser.add_argument("--competitors", type=int, default=5, help="Number of competitors (max 10)")
parser.add_argument("--industry", type=str, default="process industries", help="Target industry (e.g., 'oil and gas', 'chemical processing')")
parser.add_argument("--iterations", type=int, default=25, help="Max agent iterations (default 25)")
parser.add_argument("--incremental", action="store_true", help="Keep existing data")
args = parser.parse_args()
if args.streamlit:
print("🚀 Starting Streamlit dashboard...")
subprocess.run([sys.executable, "-m", "streamlit", "run", "streamlit_app.py"])
return
# Run pipeline
from src.pipeline.graph_builder import run_pipeline
result = run_pipeline(
max_competitors=min(args.competitors, 10),
industry=args.industry,
max_iterations=args.iterations,
incremental=args.incremental,
)
# Summary
print("\n📊 SUMMARY:")
print(f" Competitors: {len(result.get('competitors', {}))}")
print(f" Products: {len(result.get('products', {}))}")
print(f" Specs: {sum(len(s) for s in result.get('specifications', {}).values())}")
print(f" Customer Segments: {len(result.get('customer_segments', []))} ({len(result.get('segment_mappings', []))} product mappings)")
has_report = "✅" if result.get('industry_needs_report') else "❌"
print(f" Industry Report: {has_report} ({len(result.get('report_sources', []))} sources)")
print(f" Customer Needs: {len(result.get('customer_needs', {}))}")
print(f" Need Mappings: {len(result.get('need_mappings', []))}")
has_hoq = "✅" if result.get('house_of_quality') else "❌"
print(f" House of Quality: {has_hoq}")
print("\n🚀 Run 'python main.py --streamlit' to view dashboard")
if __name__ == "__main__":
main()