-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
60 lines (50 loc) · 1.94 KB
/
main.py
File metadata and controls
60 lines (50 loc) · 1.94 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
import os
import json
from datetime import datetime
import sys
# -----------------------------------------
# ✅ Add Agents folder to Python path
# -----------------------------------------
sys.path.append(os.path.join(os.path.dirname(__file__), "Agents"))
from supervisor_agent import supervisor_graph # Import the Supervisor Agent pipeline
# -----------------------------------------
# 🚀 Main Orchestrator
# -----------------------------------------
def main():
print("\n🤖 Starting TechNova Multi-Agent CRM System...\n")
# Initialize empty pipeline state
initial_state = {
"companies": [],
"shortlisted": [],
"emails_sent": [],
"responses": [],
"scheduled_meetings": [],
"transcripts": [],
"analyses": []
}
# -----------------------------------------
# 🧠 Run Supervisor Agent (Full Pipeline)
# -----------------------------------------
final_state = supervisor_graph.invoke(initial_state)
# -----------------------------------------
# 💾 Save Output Files
# -----------------------------------------
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
result_file = f"results_{timestamp}.json"
with open(result_file, "w", encoding="utf-8") as f:
json.dump(final_state, f, indent=2)
print(f"\n✅ Workflow complete!")
print(f"📦 Full pipeline results saved to: {result_file}")
print(f"📝 Detailed analytics written to: summary.txt\n")
# Optional: Print a short report to console
if final_state.get("analyses"):
print("📈 Final Analytics Summary:")
for a in final_state["analyses"]:
print(f"- {a['_meta']['company_name']}: {a['sentiment']} — {a['summary'][:120]}...")
else:
print("⚠️ No analytics generated (no calls scheduled).")
# -----------------------------------------
# 🏁 Entry Point
# -----------------------------------------
if __name__ == "__main__":
main()