Skip to main content

Build an AI agent on mykal

mykal's differentiator is that humans and AI agents collaborate on the same schedule. A reminder fires, your agent takes the action, and the task reaches "done" — all under the same audit trail a human would leave.

Architecture

mykal signed webhook reminder.fired agent queue verify → enqueue LLM + action POST .../done callback: task done / reminder / note

Four moving parts: (1) mykal emits reminder.fired; (2) your edge verifies the signature and enqueues; (3) a worker runs the LLM prompt; (4) the agent calls back into mykal with its result.

Register your agent endpoint

Your agent is a webhook receiver. Register it the same way a human integrator would — see Webhooks > Signing for the full spec. The only twist is the task payload you'll match on: set reminder_channels to include "webhook" so the outbound signal is fired.

Authentication from your agent back to mykal

Your agent needs its own credentials to call mykal's API (mark tasks done, post sub-reminders, etc.). Two models:

Never sign outbound mykal calls with the webhook secret — it's only for verifying incoming signatures. They're separate credentials.

Three patterns

Pattern A — Synchronous agent

Simplest. Receiver verifies signature → runs LLM inline → acts → returns 200. Works when the task fits a sub-10-second LLM call. Blocks the mykal retry loop if it doesn't — do not use for long-running workflows.

Pattern B — Queued agent

Receiver verifies → enqueues on Redis/SQS/Kafka → returns 200 immediately → worker pool drains and calls back. This is the default production pattern. Use the delivery_id as the queue's idempotency key so mykal retries don't double-process.

Pattern C — Multi-step with human-in-the-loop

Same as Pattern B, plus the worker can escalate: instead of completing the task itself, the agent creates a reminder on the human user (POST tasks with reminder_channels=["inapp","email"] and a short deadline) asking for approval. If the human approves in-app, your agent sees the approval via a task update poll or a follow-on webhook you also subscribed to.

Acting back on tasks

intent endpoint
Mark task done after actionPOST calendar/events/{id}/done
Skip this occurrencePOST calendar/events/{id}/skip
Unschedule + return to pendingDELETE calendar/events/{id}
Adjust task fields (priority, duration, deadline)PATCH tasks/{id}
Ask for a re-schedulePOST schedule (task_ids, optional provider)
Manually override the slotPOST schedule/decisions/{id}/override
Create a follow-up reminder for the humanPOST tasks with channels = inapp/email

Errors & retries

Cost considerations

Full working example

A ~200-line Python agent that verifies a signed reminder.fired webhook, decides what to do with Anthropic Claude, and marks the task done — lives at /mykal/developer-examples/python-agent/. It ships with requirements.txt, .env.example, and a README.

Run locally, expose via ngrok, register the tunnel as a webhook endpoint (see the quickstart), and fire a test ping. First real reminder triggers the Claude call.