Elon Musk’s Million-Email Challenge: Can AI Decode Productivity?¶
When Elon Musk asked federal employees to list their five key tasks, over a million emails flooded inboxes. Making sense of this massive dataset posed a challenge—until AI stepped in.
Using LLMs and Agentic AI, we uncovered insights on workplace behavior, accountability, and inefficiencies. What did we learn? AI-driven analysis can reveal hidden productivity trends, engagement levels, and bottlenecks in large organizations.
🔍 How does AI make sense of this chaos? Read the full breakdown here at https://dataqubed.io.
AI #Productivity #AgenticAI #ElonMusk #DataAnalysis¶
But how can this be implemented in Python using CrewAI? We demonstrate an approach leveraging gpt to extract structured insights from unstructured email data. By orchestrating agentic workflows, we showcase how AI can break down massive text data, categorize responses, perform sentiment analysis, and identify inefficiencies at scale.
from crewai import Agent, Task, Crew
from langchain.tools import tool
from unstructured.partition.html import partition_html
from textwrap import dedent
import json
import os
import requests
from dotenv import load_dotenv
import import_ipynb
from utils.db_setup import get_emails
emails = get_emails()
load_dotenv()
OpenAI_API_Key = os.environ.get("OpenAI_API_Key")
os.environ["OPENAI_API_KEY"] = OpenAI_API_Key
class BrowserTools():
@tool("Scrape website content")
def scrape_and_summarize_website(website):
"""Useful to scrape and summarize a website content"""
url = f"https://chrome.browserless.io/content?token={os.environ['BROWSERLESS_API_KEY']}"
payload = json.dumps({"url": website})
headers = {'cache-control': 'no-cache', 'content-type': 'application/json'}
response = requests.request("POST", url, headers=headers, data=payload)
elements = partition_html(text=response.text)
content = "\n\n".join([str(el) for el in elements])
content = [content[i:i + 8000] for i in range(0, len(content), 8000)]
summaries = []
for chunk in content:
agent = Agent(
role='Principal Researcher',
goal=
'Do amazing researches and summaries based on the content you are working with',
backstory=
"You're a Principal Researcher at a big company and you need to do a research about a given topic.",
allow_delegation=False)
task = Task(
agent=agent,
description=
f'Analyze and summarize the content bellow, make sure to include the most relevant information in the summary, return only the summary nothing else.\n\nCONTENT\n----------\n{chunk}'
)
summary = task.execute()
summaries.append(summary)
return "\n\n".join(summaries)
class CalculatorTools():
@tool("Make a calculation")
def calculate(operation):
"""Useful to perform any mathematical calculations,
like sum, minus, multiplication, division, etc.
The input to this tool should be a mathematical
expression, a couple examples are `200*7` or `5000/2*10`
"""
try:
return eval(operation)
except SyntaxError:
return "Error: Invalid syntax in mathematical expression"
class SearchTools():
@tool("Search the internet")
def search_internet(query):
"""Useful to search the internet
about a a given topic and return relevant results"""
top_result_to_return = 4
url = "https://google.serper.dev/search"
payload = json.dumps({"q": query})
headers = {
'X-API-KEY': os.environ['SERPER_API_KEY'],
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
# check if there is an organic key
if 'organic' not in response.json():
return "Sorry, I couldn't find anything about that, there could be an error with you serper api key."
else:
results = response.json()['organic']
string = []
for result in results[:top_result_to_return]:
try:
string.append('\n'.join([
f"Title: {result['title']}", f"Link: {result['link']}",
f"Snippet: {result['snippet']}", "\n-----------------"
]))
except KeyError:
next
return '\n'.join(string)
class EmailAgents:
def email_parsing_agent(self):
return Agent(
role='Email Parsing Expert',
goal='Extract sender and the name of the manager, and work items from emails. Usually the person in CC is the manager.',
backstory='An expert in parsing raw email text into structured JSON data.',
verbose=True
)
def ner_extraction_agent(self):
return Agent(
role='NER Extraction Expert',
goal='Extract key named entities from email content.',
backstory='Specialist in natural language processing focused on entity extraction.',
verbose=True
)
def anomaly_detection_agent(self):
return Agent(
role='Anomaly Detection Expert',
goal='Detect anomalies in parsed email data.',
backstory='Identifies inconsistencies like missing CC information or insufficient work items.',
verbose=True
)
def workload_estimation_agent(self):
return Agent(
role='Workload Estimation Expert',
goal='Estimate workload based on extracted work items.',
backstory='Provides a structured workload estimate from email data.',
verbose=True
)
def workflow_orchestration_agent(self):
return Agent(
role='Workflow Orchestration Expert',
goal='Coordinate execution of all email analysis tasks and aggregate results.',
backstory='Orchestrates the email processing workflow by combining outputs from all agents.',
verbose=True
)
class EmailTasks:
def extract_fields_task(self, agent, email_text):
return Task(
description=dedent(f"""
Analyze the email to extract the sender, manager (from the CC field),
and work items. The final answer must be a JSON object with keys
'sender', 'manager', and 'items'.
Email content: {email_text}
"""),
agent=agent,
expected_output="JSON object with 'sender', 'manager', and 'items'"
)
def extract_entities_task(self, agent, email_text):
return Task(
description=dedent(f"""
Extract all named entities from the email text. The final output
must be a JSON array of entity strings.
Email content: {email_text}
"""),
agent=agent,
expected_output="JSON array of named entities"
)
def detect_anomalies_task(self, agent, parsed_data):
return Task(
description=dedent(f"""
Analyze the parsed email data for anomalies. Check for missing
CC (manager) information or fewer than 5 work items.
Parsed data: {parsed_data}
"""),
agent=agent,
expected_output="List of anomaly messages (if any)"
)
def estimate_workload_task(self, agent, work_items):
return Task(
description=dedent(f"""
Based on the provided work items, estimate the workload.
Your answer must strictly follow this structure:
"The estimated time {{}} days/weeks, with a focus on {{}}, ..."
Fill in the placeholders appropriately.
Work items: {work_items}
"""),
agent=agent,
expected_output="A structured workload estimation sentence"
)
def orchestrate_email_task(self, agent, email_text):
return Task(
description=dedent(f"""
Coordinate the following subtasks: parsing email fields, extracting
named entities, detecting anomalies, and estimating workload. Make sure that end results matches the input, specially the task list.
Email content: {email_text}
"""),
agent=agent,
expected_output="Aggregated report with parsed data, entities, anomalies, and workload estimate"
)
class EmailAnalystCrew:
def __init__(self, weekly_highlights_email):
self.weekly_highlights_email = weekly_highlights_email
agents = EmailAgents()
self.email_parsing_agent = agents.email_parsing_agent()
self.ner_extraction_agent = agents.ner_extraction_agent()
self.anomaly_detection_agent = agents.anomaly_detection_agent()
self.workload_estimation_agent = agents.workload_estimation_agent()
self.workflow_orchestration_agent = agents.workflow_orchestration_agent()
def run(self):
print("### Analying Emails .... ")
tasks = EmailTasks()
# First, obtain the parsed email data.
#parsed_data = self.email_parsing_agent.run(self.weekly_highlights_email)
extract_fields_task = tasks.extract_fields_task(self.email_parsing_agent, self.weekly_highlights_email)
extract_entities_task = tasks.extract_entities_task(self.ner_extraction_agent, self.weekly_highlights_email)
detect_anomalies_task = tasks.detect_anomalies_task(self.anomaly_detection_agent, self.weekly_highlights_email)
estimate_workload_task = tasks.estimate_workload_task(self.workload_estimation_agent, self.weekly_highlights_email)
orchestrate_email_task = tasks.orchestrate_email_task(self.workflow_orchestration_agent, self.weekly_highlights_email)
crew = Crew(
agents=[
self.email_parsing_agent,
self.ner_extraction_agent,
self.anomaly_detection_agent,
self.workload_estimation_agent,
self.workflow_orchestration_agent
],
tasks=[
extract_fields_task,
extract_entities_task,
detect_anomalies_task,
estimate_workload_task,
orchestrate_email_task # Optionally include orchestration if needed
],
verbose=True
)
result = crew.kickoff()
return result
email_crew = EmailAnalystCrew(emails[0])
result = email_crew.run()
print("\n\n########################")
### Analying Emails .... # Agent: Email Parsing Expert ## Task: Analyze the email to extract the sender, manager (from the CC field), and work items. The final answer must be a JSON object with keys 'sender', 'manager', and 'items'. Email content: From: john.doe@gov.us To: federal-reports@gov.us CC: manager.smith@gov.us Subject: Weekly Highlights - John Doe Hello, Here are my top 5 highlights for the week: - Completed the quarterly budget review for Acme Corp with insights from CFO John Doe. - Conducted training sessions for new hires at Google Headquarters in Mountain View. - Finalized the new IT security policy in collaboration with Tech Solutions Inc.. - Coordinated with external vendors, including Innovatech LLC, for the upcoming summit in New York City. - Submitted the performance report to senior management at ABC Corporation. Best regards, John Doe # Agent: Email Parsing Expert ## Final Answer: { "sender": "john.doe@gov.us", "manager": "manager.smith@gov.us", "items": [ "Completed the quarterly budget review for Acme Corp with insights from CFO John Doe.", "Conducted training sessions for new hires at Google Headquarters in Mountain View.", "Finalized the new IT security policy in collaboration with Tech Solutions Inc.", "Coordinated with external vendors, including Innovatech LLC, for the upcoming summit in New York City.", "Submitted the performance report to senior management at ABC Corporation." ] } # Agent: NER Extraction Expert ## Task: Extract all named entities from the email text. The final output must be a JSON array of entity strings. Email content: From: john.doe@gov.us To: federal-reports@gov.us CC: manager.smith@gov.us Subject: Weekly Highlights - John Doe Hello, Here are my top 5 highlights for the week: - Completed the quarterly budget review for Acme Corp with insights from CFO John Doe. - Conducted training sessions for new hires at Google Headquarters in Mountain View. - Finalized the new IT security policy in collaboration with Tech Solutions Inc.. - Coordinated with external vendors, including Innovatech LLC, for the upcoming summit in New York City. - Submitted the performance report to senior management at ABC Corporation. Best regards, John Doe # Agent: NER Extraction Expert ## Final Answer: [ "john.doe@gov.us", "federal-reports@gov.us", "manager.smith@gov.us", "Acme Corp", "CFO John Doe", "Google Headquarters", "Mountain View", "Tech Solutions Inc", "Innovatech LLC", "New York City", "ABC Corporation", "John Doe" ] # Agent: Anomaly Detection Expert ## Task: Analyze the parsed email data for anomalies. Check for missing CC (manager) information or fewer than 5 work items. Parsed data: From: john.doe@gov.us To: federal-reports@gov.us CC: manager.smith@gov.us Subject: Weekly Highlights - John Doe Hello, Here are my top 5 highlights for the week: - Completed the quarterly budget review for Acme Corp with insights from CFO John Doe. - Conducted training sessions for new hires at Google Headquarters in Mountain View. - Finalized the new IT security policy in collaboration with Tech Solutions Inc.. - Coordinated with external vendors, including Innovatech LLC, for the upcoming summit in New York City. - Submitted the performance report to senior management at ABC Corporation. Best regards, John Doe # Agent: Anomaly Detection Expert ## Final Answer: No anomalies detected. All required CC information is present, and there are exactly 5 work items listed in the email. # Agent: Workload Estimation Expert ## Task: Based on the provided work items, estimate the workload. Your answer must strictly follow this structure: "The estimated time {} days/weeks, with a focus on {}, ..." Fill in the placeholders appropriately. Work items: From: john.doe@gov.us To: federal-reports@gov.us CC: manager.smith@gov.us Subject: Weekly Highlights - John Doe Hello, Here are my top 5 highlights for the week: - Completed the quarterly budget review for Acme Corp with insights from CFO John Doe. - Conducted training sessions for new hires at Google Headquarters in Mountain View. - Finalized the new IT security policy in collaboration with Tech Solutions Inc.. - Coordinated with external vendors, including Innovatech LLC, for the upcoming summit in New York City. - Submitted the performance report to senior management at ABC Corporation. Best regards, John Doe # Agent: Workload Estimation Expert ## Final Answer: The estimated time 2 weeks, with a focus on completing the quarterly budget review, conducting training sessions, finalizing the IT security policy, coordinating with external vendors, and submitting the performance report. # Agent: Workflow Orchestration Expert ## Task: Coordinate the following subtasks: parsing email fields, extracting named entities, detecting anomalies, and estimating workload. Make sure that end results matches the input, specially the task list. Email content: From: john.doe@gov.us To: federal-reports@gov.us CC: manager.smith@gov.us Subject: Weekly Highlights - John Doe Hello, Here are my top 5 highlights for the week: - Completed the quarterly budget review for Acme Corp with insights from CFO John Doe. - Conducted training sessions for new hires at Google Headquarters in Mountain View. - Finalized the new IT security policy in collaboration with Tech Solutions Inc.. - Coordinated with external vendors, including Innovatech LLC, for the upcoming summit in New York City. - Submitted the performance report to senior management at ABC Corporation. Best regards, John Doe # Agent: Workflow Orchestration Expert ## Final Answer: **Aggregated Report** **Parsed Email Fields:** - **From:** john.doe@gov.us - **To:** federal-reports@gov.us - **CC:** manager.smith@gov.us - **Subject:** Weekly Highlights - John Doe **Extracted Named Entities:** - **Person:** John Doe - **Organizations:** Acme Corp, Google Headquarters, Tech Solutions Inc., Innovatech LLC, ABC Corporation - **Locations:** Mountain View, New York City **Detected Anomalies:** - No significant anomalies detected in the email content. All information appears relevant and consistent with standard reporting practices. **Estimated Workload:** - The total estimated workload for the tasks highlighted in this email is approximately **2 weeks**. - **Completed Tasks:** - Quarterly budget review for Acme Corp - Training sessions for new hires - Finalization of IT security policy - **Pending Tasks:** - Coordination with external vendors for the summit in New York City - Submission of the performance report to senior management at ABC Corporation **Outcome:** The coordinated efforts and outputs from parsing email fields, extracting named entities, detecting anomalies, and estimating the workload confirm that the email content is organized, relevant, and actionable. The tasks outlined in the email align with the expected criteria, ensuring a clear focus on each highlighted achievement and future responsibilities tagged with a realistic completion timeline. ########################
email_crew = EmailAnalystCrew(emails[1])
result = email_crew.run()
print("\n\n########################")
Overriding of current TracerProvider is not allowed
### Analying Emails .... # Agent: Email Parsing Expert ## Task: Analyze the email to extract the sender, manager (from the CC field), and work items. The final answer must be a JSON object with keys 'sender', 'manager', and 'items'. Email content: From: alice.johnson@gov.us To: federal-reports@gov.us CC: supervisor.taylor@gov.us Subject: My Weekly Accomplishments Hey Team, As requested, here are my key contributions from last week: - Drafted the first version of the internal compliance report. - Organized a department-wide town hall event. - Updated documentation for procurement processes. - Assisted in data migration to the new HR system. - Reviewed and revised onboarding materials for new employees. Cheers, Alice Johnson # Agent: Email Parsing Expert ## Final Answer: { "sender": "alice.johnson@gov.us", "manager": "supervisor.taylor@gov.us", "items": [ "Drafted the first version of the internal compliance report.", "Organized a department-wide town hall event.", "Updated documentation for procurement processes.", "Assisted in data migration to the new HR system.", "Reviewed and revised onboarding materials for new employees." ] } # Agent: NER Extraction Expert ## Task: Extract all named entities from the email text. The final output must be a JSON array of entity strings. Email content: From: alice.johnson@gov.us To: federal-reports@gov.us CC: supervisor.taylor@gov.us Subject: My Weekly Accomplishments Hey Team, As requested, here are my key contributions from last week: - Drafted the first version of the internal compliance report. - Organized a department-wide town hall event. - Updated documentation for procurement processes. - Assisted in data migration to the new HR system. - Reviewed and revised onboarding materials for new employees. Cheers, Alice Johnson # Agent: NER Extraction Expert ## Final Answer: ["alice.johnson@gov.us", "federal-reports@gov.us", "supervisor.taylor@gov.us", "internal compliance report", "department-wide town hall event", "procurement processes", "new HR system", "onboarding materials", "Alice Johnson"] # Agent: Anomaly Detection Expert ## Task: Analyze the parsed email data for anomalies. Check for missing CC (manager) information or fewer than 5 work items. Parsed data: From: alice.johnson@gov.us To: federal-reports@gov.us CC: supervisor.taylor@gov.us Subject: My Weekly Accomplishments Hey Team, As requested, here are my key contributions from last week: - Drafted the first version of the internal compliance report. - Organized a department-wide town hall event. - Updated documentation for procurement processes. - Assisted in data migration to the new HR system. - Reviewed and revised onboarding materials for new employees. Cheers, Alice Johnson # Agent: Anomaly Detection Expert ## Final Answer: There are no anomalies detected. The CC information includes supervisor.taylor@gov.us, which is appropriate. Additionally, there are exactly 5 work items listed as key contributions from Alice Johnson. # Agent: Workload Estimation Expert ## Task: Based on the provided work items, estimate the workload. Your answer must strictly follow this structure: "The estimated time {} days/weeks, with a focus on {}, ..." Fill in the placeholders appropriately. Work items: From: alice.johnson@gov.us To: federal-reports@gov.us CC: supervisor.taylor@gov.us Subject: My Weekly Accomplishments Hey Team, As requested, here are my key contributions from last week: - Drafted the first version of the internal compliance report. - Organized a department-wide town hall event. - Updated documentation for procurement processes. - Assisted in data migration to the new HR system. - Reviewed and revised onboarding materials for new employees. Cheers, Alice Johnson # Agent: Workload Estimation Expert ## Final Answer: The estimated time 2 weeks, with a focus on drafting the internal compliance report, organizing the town hall event, updating documentation, assisting in data migration, and reviewing onboarding materials. # Agent: Workflow Orchestration Expert ## Task: Coordinate the following subtasks: parsing email fields, extracting named entities, detecting anomalies, and estimating workload. Make sure that end results matches the input, specially the task list. Email content: From: alice.johnson@gov.us To: federal-reports@gov.us CC: supervisor.taylor@gov.us Subject: My Weekly Accomplishments Hey Team, As requested, here are my key contributions from last week: - Drafted the first version of the internal compliance report. - Organized a department-wide town hall event. - Updated documentation for procurement processes. - Assisted in data migration to the new HR system. - Reviewed and revised onboarding materials for new employees. Cheers, Alice Johnson # Agent: Workflow Orchestration Expert ## Final Answer: Aggregated Report: 1. **Parsed Email Fields:** - From: alice.johnson@gov.us - To: federal-reports@gov.us - CC: supervisor.taylor@gov.us - Subject: My Weekly Accomplishments 2. **Extracted Named Entities:** - Sender: Alice Johnson - Recipient: Federal Reports Team - CC Recipient: Supervisor Taylor - Organization: [Not explicitly stated in the email, but can be inferred as a government body] 3. **Detected Anomalies:** - No significant anomalies detected in email format or content. - The email structure follows standard formatting rules without irregularities. 4. **Estimated Workload:** - Total Estimated Time: 2 weeks - Breakdown: - Drafting the internal compliance report: 1 week - Organizing a department-wide town hall event: 3 days - Updating documentation for procurement processes: 2 days - Assisting in data migration to the new HR system: 4 days - Reviewing onboarding materials for new employees: 2 days - Activity Summary: - Preparation and drafting work (compliance report) involves extensive research and collaboration. - The town hall event organization includes logistics, coordination, and communication. - Updating procurement documentation may require consulting with other departments. - Data migration assistance is collaborative, involving multiple stakeholders. - Reviewing onboarding materials necessitates thorough evaluation and potential revisions. End of Report. ########################
email_crew = EmailAnalystCrew(emails[2])
result = email_crew.run()
print("\n\n########################")
Overriding of current TracerProvider is not allowed
### Analying Emails .... # Agent: Email Parsing Expert ## Task: Analyze the email to extract the sender, manager (from the CC field), and work items. The final answer must be a JSON object with keys 'sender', 'manager', and 'items'. Email content: From: mark.roberts@gov.us To: federal-reports@gov.us CC: director.brown@gov.us Subject: Weekly Progress Report Good day, Below are my top 5 tasks completed last week: - Successfully negotiated a new contract with the software provider. - Provided risk assessment for the cybersecurity framework. - Attended a government-wide leadership training program. - Streamlined the process for inter-agency communications. - Initiated the restructuring of workflow automation. P.S. I also had to spend a lot of time fixing an issue with my office printer. Disclaimer: This email contains confidential information and is intended for the recipient only. Regards, Mark Roberts # Agent: Email Parsing Expert ## Final Answer: ```json { "sender": "mark.roberts@gov.us", "manager": "director.brown@gov.us", "items": [ "Successfully negotiated a new contract with the software provider.", "Provided risk assessment for the cybersecurity framework.", "Attended a government-wide leadership training program.", "Streamlined the process for inter-agency communications.", "Initiated the restructuring of workflow automation." ] } ``` # Agent: NER Extraction Expert ## Task: Extract all named entities from the email text. The final output must be a JSON array of entity strings. Email content: From: mark.roberts@gov.us To: federal-reports@gov.us CC: director.brown@gov.us Subject: Weekly Progress Report Good day, Below are my top 5 tasks completed last week: - Successfully negotiated a new contract with the software provider. - Provided risk assessment for the cybersecurity framework. - Attended a government-wide leadership training program. - Streamlined the process for inter-agency communications. - Initiated the restructuring of workflow automation. P.S. I also had to spend a lot of time fixing an issue with my office printer. Disclaimer: This email contains confidential information and is intended for the recipient only. Regards, Mark Roberts # Agent: NER Extraction Expert ## Final Answer: ["Mark Roberts", "Mark Roberts", "government-wide leadership training program", "cybersecurity framework", "software provider", "inter-agency communications", "workflow automation", "office printer"] # Agent: Anomaly Detection Expert ## Task: Analyze the parsed email data for anomalies. Check for missing CC (manager) information or fewer than 5 work items. Parsed data: From: mark.roberts@gov.us To: federal-reports@gov.us CC: director.brown@gov.us Subject: Weekly Progress Report Good day, Below are my top 5 tasks completed last week: - Successfully negotiated a new contract with the software provider. - Provided risk assessment for the cybersecurity framework. - Attended a government-wide leadership training program. - Streamlined the process for inter-agency communications. - Initiated the restructuring of workflow automation. P.S. I also had to spend a lot of time fixing an issue with my office printer. Disclaimer: This email contains confidential information and is intended for the recipient only. Regards, Mark Roberts # Agent: Anomaly Detection Expert ## Final Answer: 1. Anomaly Message: Missing CC information (no manager CC listed). 2. Anomaly Message: No fewer than 5 work items provided, but this email contains exactly 5 work items. Overall, there is one notable anomaly related to the CC information as the criteria specifically mention a manager's CC, which is missing in this instance. There are no issues with the work items since the requirement of at least 5 work items is met. # Agent: Workload Estimation Expert ## Task: Based on the provided work items, estimate the workload. Your answer must strictly follow this structure: "The estimated time {} days/weeks, with a focus on {}, ..." Fill in the placeholders appropriately. Work items: From: mark.roberts@gov.us To: federal-reports@gov.us CC: director.brown@gov.us Subject: Weekly Progress Report Good day, Below are my top 5 tasks completed last week: - Successfully negotiated a new contract with the software provider. - Provided risk assessment for the cybersecurity framework. - Attended a government-wide leadership training program. - Streamlined the process for inter-agency communications. - Initiated the restructuring of workflow automation. P.S. I also had to spend a lot of time fixing an issue with my office printer. Disclaimer: This email contains confidential information and is intended for the recipient only. Regards, Mark Roberts # Agent: Workload Estimation Expert ## Final Answer: The estimated time is 2 weeks, with a focus on contract negotiation, risk assessment, training participation, process streamlining, and workflow automation restructuring, along with addressing the printer issue that added extra time demands. # Agent: Workflow Orchestration Expert ## Task: Coordinate the following subtasks: parsing email fields, extracting named entities, detecting anomalies, and estimating workload. Make sure that end results matches the input, specially the task list. Email content: From: mark.roberts@gov.us To: federal-reports@gov.us CC: director.brown@gov.us Subject: Weekly Progress Report Good day, Below are my top 5 tasks completed last week: - Successfully negotiated a new contract with the software provider. - Provided risk assessment for the cybersecurity framework. - Attended a government-wide leadership training program. - Streamlined the process for inter-agency communications. - Initiated the restructuring of workflow automation. P.S. I also had to spend a lot of time fixing an issue with my office printer. Disclaimer: This email contains confidential information and is intended for the recipient only. Regards, Mark Roberts # Agent: Workflow Orchestration Expert ## Final Answer: **Aggregated Email Analysis Report** **Parsed Email Fields:** - **From:** mark.roberts@gov.us - **To:** federal-reports@gov.us - **CC:** director.brown@gov.us - **Subject:** Weekly Progress Report **Extracted Named Entities:** - **Email Sender:** Mark Roberts - **Email Domain:** gov.us - **Positions Mentioned:** - Director (implied from CC) - **Tasks:** 1. Contract negotiation with a software provider. 2. Cybersecurity risk assessment. 3. Leadership training program participation. 4. Process streamlining for inter-agency communications. 5. Workflow automation restructuring. **Detected Anomalies:** - The mention of an office printer issue, which is irrelevant to the professional tasks but indicates a personal workload concern. **Estimated Workload:** - **Total Estimated Time:** 2 weeks - **Focus Areas:** - **Contract Negotiation:** Likely involves multiple meetings and discussions (estimated 3 days). - **Risk Assessment:** Requires analysis and reporting (estimated 4 days). - **Training Participation:** Time spent at the training (1 week). - **Process Streamlining:** Implementation and follow-up (estimated 3 days). - **Workflow Automation Restructuring:** Design and implementation (estimated 4 days). - **Printer Issue Resolution:** Additional unplanned time (estimated 1 day). Overall, the tasks emphasize a significant involvement in contract negotiation, risk assessments, training, and automation efforts, alongside handling unexpected personal workload issues associated with office equipment. **Disclaimer:** This email contains confidential information and is intended for the recipient only. ########################
email_crew = EmailAnalystCrew(emails[3])
result = email_crew.run()
print("\n\n########################")
Overriding of current TracerProvider is not allowed
### Analying Emails .... # Agent: Email Parsing Expert ## Task: Analyze the email to extract the sender, manager (from the CC field), and work items. The final answer must be a JSON object with keys 'sender', 'manager', and 'items'. Email content: From: mohsen@buas.nl To: frank@buas.nl CC: dfrank@buas.nl Onderwerp: Wekelijkse update – Belangrijkste taken voltooid Hi Frank, Ik hoop dat alles goed gaat. Hier is een overzicht van mijn belangrijkste taken van afgelopen week: Een post geschreven over het lokaal draaien van DeepSeek – Behandeld hoe het op te zetten, te optimaliseren en toe te passen in de praktijk. Een diepgaande analyse geschreven over Agentic AI – De betekenis, use cases en implementatiestrategieën toegelicht. Een Python-tutorial ontwikkeld – Gedemonstreerd hoe CrewAI met DeepSeek gebruikt kan worden voor het analyseren van grote datasets. Laat het me weten als je aanvullende details wilt of als er iets is waar ik me specifiek op moet richten de komende week. Groet, Mohsen. # Agent: Email Parsing Expert ## Final Answer: { "sender": "mohsen@buas.nl", "manager": "dfrank@buas.nl", "items": [ "Een post geschreven over het lokaal draaien van DeepSeek – Behandeld hoe het op te zetten, te optimaliseren en toe te passen in de praktijk.", "Een diepgaande analyse geschreven over Agentic AI – De betekenis, use cases en implementatiestrategieën toegelicht.", "Een Python-tutorial ontwikkeld – Gedemonstreerd hoe CrewAI met DeepSeek gebruikt kan worden voor het analyseren van grote datasets." ] } # Agent: NER Extraction Expert ## Task: Extract all named entities from the email text. The final output must be a JSON array of entity strings. Email content: From: mohsen@buas.nl To: frank@buas.nl CC: dfrank@buas.nl Onderwerp: Wekelijkse update – Belangrijkste taken voltooid Hi Frank, Ik hoop dat alles goed gaat. Hier is een overzicht van mijn belangrijkste taken van afgelopen week: Een post geschreven over het lokaal draaien van DeepSeek – Behandeld hoe het op te zetten, te optimaliseren en toe te passen in de praktijk. Een diepgaande analyse geschreven over Agentic AI – De betekenis, use cases en implementatiestrategieën toegelicht. Een Python-tutorial ontwikkeld – Gedemonstreerd hoe CrewAI met DeepSeek gebruikt kan worden voor het analyseren van grote datasets. Laat het me weten als je aanvullende details wilt of als er iets is waar ik me specifiek op moet richten de komende week. Groet, Mohsen. # Agent: NER Extraction Expert ## Final Answer: ["Mohsen", "Frank", "DeepSeek", "Agentic AI", "CrewAI", "Python"] # Agent: Anomaly Detection Expert ## Task: Analyze the parsed email data for anomalies. Check for missing CC (manager) information or fewer than 5 work items. Parsed data: From: mohsen@buas.nl To: frank@buas.nl CC: dfrank@buas.nl Onderwerp: Wekelijkse update – Belangrijkste taken voltooid Hi Frank, Ik hoop dat alles goed gaat. Hier is een overzicht van mijn belangrijkste taken van afgelopen week: Een post geschreven over het lokaal draaien van DeepSeek – Behandeld hoe het op te zetten, te optimaliseren en toe te passen in de praktijk. Een diepgaande analyse geschreven over Agentic AI – De betekenis, use cases en implementatiestrategieën toegelicht. Een Python-tutorial ontwikkeld – Gedemonstreerd hoe CrewAI met DeepSeek gebruikt kan worden voor het analyseren van grote datasets. Laat het me weten als je aanvullende details wilt of als er iets is waar ik me specifiek op moet richten de komende week. Groet, Mohsen. # Agent: Anomaly Detection Expert ## Final Answer: 1. **Missing CC Information**: The email is missing the manager's CC information. It only includes CC to "dfrank@buas.nl," which does not indicate the inclusion of a manager. 2. **Insufficient Work Items**: The email lists only three work items: - **One post** written about DeepSeek. - **One analysis** about Agentic AI. - **One Python tutorial** developed. This is fewer than the required five work items that should be included in the update. Thus, the anomalies detected are the lack of adequate CC information and an insufficient number of reported work items. # Agent: Workload Estimation Expert ## Task: Based on the provided work items, estimate the workload. Your answer must strictly follow this structure: "The estimated time {} days/weeks, with a focus on {}, ..." Fill in the placeholders appropriately. Work items: From: mohsen@buas.nl To: frank@buas.nl CC: dfrank@buas.nl Onderwerp: Wekelijkse update – Belangrijkste taken voltooid Hi Frank, Ik hoop dat alles goed gaat. Hier is een overzicht van mijn belangrijkste taken van afgelopen week: Een post geschreven over het lokaal draaien van DeepSeek – Behandeld hoe het op te zetten, te optimaliseren en toe te passen in de praktijk. Een diepgaande analyse geschreven over Agentic AI – De betekenis, use cases en implementatiestrategieën toegelicht. Een Python-tutorial ontwikkeld – Gedemonstreerd hoe CrewAI met DeepSeek gebruikt kan worden voor het analyseren van grote datasets. Laat het me weten als je aanvullende details wilt of als er iets is waar ik me specifiek op moet richten de komende week. Groet, Mohsen. # Agent: Workload Estimation Expert ## Final Answer: The estimated time 1 week, with a focus on completing additional work items to meet the expected five-item threshold in future updates, ensuring a more comprehensive overview of tasks and activities accomplished. # Agent: Workflow Orchestration Expert ## Task: Coordinate the following subtasks: parsing email fields, extracting named entities, detecting anomalies, and estimating workload. Make sure that end results matches the input, specially the task list. Email content: From: mohsen@buas.nl To: frank@buas.nl CC: dfrank@buas.nl Onderwerp: Wekelijkse update – Belangrijkste taken voltooid Hi Frank, Ik hoop dat alles goed gaat. Hier is een overzicht van mijn belangrijkste taken van afgelopen week: Een post geschreven over het lokaal draaien van DeepSeek – Behandeld hoe het op te zetten, te optimaliseren en toe te passen in de praktijk. Een diepgaande analyse geschreven over Agentic AI – De betekenis, use cases en implementatiestrategieën toegelicht. Een Python-tutorial ontwikkeld – Gedemonstreerd hoe CrewAI met DeepSeek gebruikt kan worden voor het analyseren van grote datasets. Laat het me weten als je aanvullende details wilt of als er iets is waar ik me specifiek op moet richten de komende week. Groet, Mohsen. # Agent: Workflow Orchestration Expert ## Final Answer: **Aggregated Report:** **1. Parsed Data:** - **From:** mohsen@buas.nl - **To:** frank@buas.nl - **CC:** dfrank@buas.nl - **Subject:** Wekelijkse update – Belangrijkste taken voltooid - **Body:** ``` Hi Frank, Ik hoop dat alles goed gaat. Hier is een overzicht van mijn belangrijkste taken van afgelopen week: Een post geschreven over het lokaal draaien van DeepSeek – Behandeld hoe het op te zetten, te optimaliseren en toe te passen in de praktijk. Een diepgaande analyse geschreven over Agentic AI – De betekenis, use cases en implementatiestrategieën toegelicht. Een Python-tutorial ontwikkeld – Gedemonstreerd hoe CrewAI met DeepSeek gebruikt kan worden voor het analyseren van grote datasets. Laat het me weten als je aanvullende details wilt of als er iets is waar ik me specifiek op moet richten de komende week. Groet, Mohsen. ``` **2. Extracted Named Entities:** - **Person:** Mohsen - **Recipient:** Frank, D. Frank - **Projects/Technologies:** - DeepSeek - Agentic AI - CrewAI - **Topics:** Python, Data Analysis **3. Detected Anomalies:** - No significant anomalies detected in task descriptions or email format. - All tasks listed align with routine work expectations. **4. Estimated Workload:** - **Tasks Completed:** 3 (as listed) - Writing a post on DeepSeek (Estimated time: 5 hours) - Analyzing Agentic AI (Estimated time: 6 hours) - Developing a Python tutorial (Estimated time: 8 hours) - **Total Estimated Hours for Completed Tasks:** 19 hours - **Future Work Items:** Additional tasks needed to reach the expected five-item threshold were highlighted. **Recommendation:** Encourage Mohsen to consider adding two more tasks in his next weekly update to achieve a more comprehensive overview of his activities, ensuring balanced workload distribution. This report encapsulates the outcome of the parsing, entity extraction, anomaly detection, and workload estimation tasks performed on the provided email content. ########################