Here is the prompt I used using recommended settings/models:
The Mail Agent is a dynamic assistant that processes incoming emails, classifying them based on sender roles, identifying new content, and determining if a response is required. It works by fetching unread messages from the user’s inbox using AppleScript, then analyzes each email’s sender to deduce their role (e.g., customer, colleague, family member) either from previous interactions or a defined set of roles. For emails with actionable content, such as requests for appointments or responses, the agent assesses the urgency and determines whether a response is safe to send. If the agent responds autonomously, it does so as “Assistant to Marcus Swift,” ensuring clarity in communication.
The agent stores each email’s processed data as a new record in the “agent_action” table in Supabase, including fields such as sender, role, message_body, status, and response_key. The status field tracks the condition of the message, such as “on hold,” “waiting for response,” or “concluded,” allowing for easy querying of messages that require further input. All records are kept for historical purposes, and the agent does not delete any entries.
here are the key tools the agent will need to function:
-
Email Fetching Tool (AppleScript Integration)
• Purpose: To fetch unread messages from the user’s inbox.
• Description: This tool will use AppleScript to access the Mail app and retrieve unread emails. It should handle reading emails, fetching relevant headers (sender, subject, timestamp), and retrieving message content (body and attachments). -
Sender Identification & Role Classification Tool
• Purpose: To identify the sender and classify their role (customer, colleague, etc.).
• Description: This tool will use either in-memory tracking of past interactions (role memory) or query Supabase for the sender’s role. If the sender’s role is unknown, the tool will use an LLM to deduce it based on the most recent email exchanges and a predefined list of roles and definitions. -
Email Content Parsing Tool
• Purpose: To analyze and extract relevant content from the email.
• Description: This tool will identify the new content in the email (non-indented text) and separate it from any quoted or previous message content. It will also detect actionable items (like requests for appointments, help, etc.) by analyzing the context, tone, and content of the message. -
Actionable Item Detection Tool
• Purpose: To identify if the email contains any requests or actionable items (e.g., needing a response, scheduling, etc.).
• Description: This tool will process the email content to determine if any call to action exists. It should be capable of analyzing natural language to detect subtle requests or needs within the email text. -
Message Assessment Tool
• Purpose: To evaluate whether it’s safe to respond and classify the message’s status.
• Description: This tool will assess the message’s urgency, context, tone, and actionable items. It will also use “assessment rules” that can be customized to classify the message as “safe to respond,” “requires input,” or other statuses. It will store the message status in the status field. -
Response Generation Tool
• Purpose: To generate a draft response or automate the response process.
• Description: If the message is deemed safe to respond, the agent will generate a response in the tone and format of “Assistant to Marcus Swift.” It will compose messages automatically when necessary (e.g., for customers, colleagues, family). The response should always be clear and consistent with the assistant role. -
Supabase Integration Tool
• Purpose: To store the processed email data and manage interactions with Supabase.
• Description: This tool will handle the interaction with Supabase to store the processed email’s data (sender, role, message body, response key, and status) in the “agent_action” table. It will also ensure that any status updates or changes to the message are reflected in the database. -
Polling/Trigger Mechanism
• Purpose: To periodically fetch new emails from the inbox and process them.
• Description: This tool will handle the polling mechanism (running at a configurable interval) to check for new unread emails, triggering the processing workflow when new emails arrive. The tool could either be triggered manually or run on a schedule. -
LLM-based Role Deduction Tool
• Purpose: To analyze unknown senders and deduce their role based on context and recent interactions.
• Description: If the sender’s role is not found in Supabase or memory, this tool will use a constrained list of possible roles and definitions to infer the sender’s role based on the content of previous emails and the current email context.
OUTCOME:
Archon created files and place holder tools. But then it got very confused and just kind of spun…
- I recognize this prompt is a “big lift”. But in the spirit of “break shit and find out” I did it anyways
- How would those more experienced with this tool adjust this prompt to maybe produce better results