All posts

The Heartbeat: An AI That Pays Attention

March 11, 20265 min read

Every AI assistant I've used has the same interaction model: you talk, it responds. That's it. Close the app and it goes dormant until you come back.

I wanted something different. I wanted an AI that could notice things on its own — an urgent message while I'm busy, a calendar conflict I missed, an email that needs a response. That's why I built the heartbeat system.

How It Works

The heartbeat is a multi-track background listener. It monitors three sources continuously:

  • iMessage — polls the local Messages database every 10 seconds for new messages
  • Apple Calendar — watches for upcoming events with configurable lookahead
  • Apple Mail — checks for unread emails that mention Edward

Each track runs independently with its own polling interval and enable/disable toggle. The system is designed to be lightweight — it's not processing every message through a large language model.

The Triage Layer

Raw monitoring generates noise. The real work happens in the triage pipeline, which runs in three layers:

  1. Layer 1: Rules — zero-cost pattern matching. Known contacts, keyword filters, time-based rules. Most messages get classified here without touching an LLM.
  2. Layer 2: Classification — messages that pass Layer 1 go to Claude Haiku for urgency classification. Fast and cheap.
  3. Layer 3: Action — urgent items trigger real actions: store a memory, draft a response, send a push notification.

This layered approach keeps costs near zero for routine traffic while still catching things that matter.

Proactive, Not Intrusive

The goal isn't to create an AI that buzzes you constantly. It's to create one that pays attention so you don't have to. When you open your next conversation, Edward already knows about the message you missed and the meeting that got rescheduled. It's briefed before you say a word.

This context gets injected into the system prompt as a briefing. Edward doesn't say “I noticed you got a message” unprompted — it weaves the awareness naturally into the conversation when relevant.

Why This Matters

A personal AI assistant that only responds when spoken to is really just a chatbot with extra steps. The heartbeat is what makes Edward feel like an actual assistant — something running in the background, keeping track of things, ready with context when you need it.