Build a Dead Simple AI reminder assistant
Dead Simple Autonomous Agents with Resonate's Distributed Async Await
Want to build autonomous, long-running agents powered by OpenAI?
You can with Resonate's Distributed Async Await.
Get started with this Reminder Assistant.
Built using a minimal agent loop, the assistant can wait hours, days, or weeks without relying on cron jobs, queues, or databases-thanks to Resonate's durable execution model.
The reminder assistant enables users to schedule reminders through natural language:
Remind me first thing in the morning, bright and early, to check out https://resonatehq.io
The Reminder Assistant is implemented as an agent loop using Resonate's Distributed Async Await. Distributed Async Await enables durable suspension and resumption of long-lived executions.
With Distributed Async Await, the scheduling logic is Dead Simple:
The schedule function yields (i.e., sleeps) until the target time
The system automatically resumes when the timer expires
The AI immediately sends the reminder afterward
Stateful Agent = Stateless Agent + Stateful Execution
The AI Agent does not keep track of state or time, both of which are handled by Resonate: The agent is part of a durable runtime that can wait hours, days, or weeks and still complete the task. The runtime wakes the agent when it's time to act.
This eliminates the need for traditional scheduling infrastructure like cron jobs, message queues, or databases.
The assistant leverages OpenAI’s GPT-4 model with structured function calls.
System Prompt:
You are a helpful assistant that schedules reminders using three tools: 'schedule', 'reminder', and 'current_time'.
Users may express reminder requests ambiguously (e.g., "tomorrow morning, bright and early"). Use your best judgment to interpret such time expressions. Do not ask for clarification.
When a user asks for a reminder:
1. Call the 'schedule' tool with the desired UTC timestamp. This pauses the conversation until that time.
2. Once the system resumes and sends you the next message, the scheduled time has arrived.
3. At that point, immediately call the `reminder` tool to send the message.
If needed, use the `current_time` tool to compute a future time.
Remember:
you do not keep track of time.
You are part of a durable system that can wait hours, days, or weeks and still complete the task. The system will wake you when it is time to act. Your job is to determine what to do next.
The model autonomously chooses from these tools:
schedule
: Sleep until a given UTC time in ISO 8601 formatreminder
: Send a message as a remindercurrent_time
: Return current UTC time in ISO 8601 format
The core interaction between GPT and the tools happens inside a Resonate function.
Durable Suspension and Durable Resumption
Besides the LLM, the highlight of this system is Resonate’s durable execution model.
When the assistant calls:
Resonate
Suspends the computation
Waits for hours, days, weeks, or months
Resumes the computation-even on a different process
A procedural programming model on top of an event driven execution model. No databases, no queues, no timers, no polling—just functions and promises
Visit the repo README for installation and usage instructions.