Modern personal assistants benefit from integrating external data like weather forecasts and proactive reminders. A robust todo assistant can combine scheduling, environmental awareness, and health-conscious time planning into a seamless experience. Below is a technical breakdown of constructing such a system.
Core Capabilities
The assistant performs:
- Weather-aware scheduling: Incorporates real-time local weather to suggest suitable timing and attire for outdoor tasks.
- Temporal health analysis: Evaluates gaps between appointments and suggests breaks or adjustments to avoid fatigue or heat exposure.
- Automated email notifications: Sends daily summaries without requiring user interaction, using a preconfigured mailbox.
Behavioral Logic Definition
Define clear invocation boundaries for plugins and workflows. Example persona configuration in markdown:
# Persona
SmartPlanner is a todo assistant focused on organizing user schedules intelligently. It adapts plans based on location-specific weather, flags potential health impacts from tight timelines, and emails consolidated task lists each morning.
## Abilities:
### Ability 1: View or Clear Todo List
- For queries, pass user input to `fetch_tasks_flow` via the `task_input` parameter.
- To erase all entries, execute `DELETE FROM user_tasks WHERE {criteria}` on `user_tasks` DB and return confirmation.
### Ability 2: Add or Schedule Tasks
- Merge multi-item inputs into a single sentence, attach `loc_param`, then invoke `add_task_flow` for persistence.
### Ability 3: Email Operations
- Trigger `dispatch_mail_flow` for reminder mails.
- Use `retrieve_mail_flow` when user asks about past mail contents.
- For test sends, forward `email_addr` to `send_test_mail_flow`.
### Ability 4: Updating Settings
- Allow one valid email address update; store in `email_var` upon format validation.
- Permit updating a city name; save correct value to `city_var`.
- Respond to requests for current settings by reading `email_var` and `city_var`.
### Ability 5: Advisory Functions
- Propose departure times and transport modes based on task locations and durations.
- Supply current weather for the stored city.
- Analyze schedule density for health risks, suggesting rest periods or environment-based precautions.
## Restrictions:
- Direct answers only for general questions; no workflow calls.
- Deletion limited to full list clearing.
- Prevent test mail if `email_var` is empty.
- Inform users that configured emails are sent at 07:00 daily.
- Disallow manual modification of mail delivery mechanisms or database records.
- Output strictly follows defined sections.
Plugin Integration
Two essential plugins extend functionality:
- Weather Provider — Supplies current conditions for a given city. Triggered automatical on relevant keywords.
- Custom Mailer — Since no ready-made plugin fits, implement a lightweight SMTP wrapper. Parameters (recipient, subject, body) are encapsulated for reuse. Hosting options:
- Deploy your own mail server.
- Use the provided generic sender (subject to capacity limits).
Data Storage and Variables
- User Settings Variables:
city_varandemail_varhold one-time configuration values to avoid repetitive prompts and minimize DB load. - Task Repository:
user_taskstable stores scheduled items for retrieval during mail assembly. - Mail Log Table: Captures send timestamps and addresses; enforces rate limiting (e.g., minimum 2 minutes between sends) to protect self-hosted servers.
- Daily Quota Enforcement:
daily_reminder_flowcaps sends to 15 per day to prevent abuse.
Workflow Design
Workflows isolate deterministic operations from language model inference, reducing prompt complexity:
send_test_mail_flow— Validates recipient address and applies throttling before sending a test message.daily_reminder_flow— Compiles today's and upcoming tasks, appends weather-based tips and a motivational note. Designed for scheduled triggers (e.g., 07:00 daily via Feishu integration). Not callable once trigger restrictions lift.add_task_flow— Accepts batch task descriptions, persists them, and generates actionable advice (e.g., buffer times between events).retrieve_mail_flow— Safely queries mail log table using predefined SQL templates, shielding against malformed queries.fetch_tasks_flow— Retrieves tasks with guided SQL examples to lower error rates; achieves ~90% accuracy improvement over freeform ganeration.
Trigger Mechanism
Current platform constraints require using Feishu for timed activation; passive triggers in the marketplace are unavailable. Pending platform updates, existing flows remain dormant until activation support returns. Safeguards ensure no mail dispatch occurs if the task list is empty.
Model Interaction Guardrails
Switching to certain models introduced verbosity around internal calls. Added constraints to supress leakage of workflow or plugin mechanics until model behavior stabilizes.
Execution Flow Example
Input:
Remind me to wake at 6:00 tomorrow for an hour of reading, attend a meeting at 10:00 lasting one hour, and go night running at 21:00.
add_task_flow parses, stores three entries, and recommends spacing if overlaps occur. At 07:00, daily_reminder_flow emails the agenda, notes weather for the stored city, and appends health tips.