Automation
Automation is how Alfred does things without you being there. It has two halves, and it helps to know which one you’re asking for.
- A reflex is code Alfred writes and runs when an event happens. No conversation, nobody watching, no AI in the loop.
- A background agent is an AI worker with its own instructions, model and files. It has no trigger of its own, a reflex is what wakes it.
So a reflex is Alfred acting, and a background agent is Alfred thinking. Most automation only needs the first one.
Automation is part of the Automation module, which you can manage from the Modules Page.
Reflexes
Section titled “Reflexes”A reflex has three parts:
- A trigger, which is the event it listens for. That could be a schedule, a Discord message, or an event from a connected client.
- A handler, which is the code that runs on each matching event and decides what to do.
- Optionally a background agent to wake when the handler decides an AI is needed.
The handler ends in one of three outcomes: it ignores the event, it handles the event itself, or it escalates to the background agent. Because the handler is just code, a reflex costs a small sandbox run instead of a full AI message, which is why it’s fine to have a reflex firing all day.
Handlers can call Alfred’s tools, so a reflex can send you a Discord message, write to a card, search the web, or generate an image on its own without waking anything.
Each reflex also has its own small private store, which is how it remembers things between runs. That’s what lets a reflex count something, notice a change since last time, or avoid telling you about the same thing twice.
Asking for one
Section titled “Asking for one”You don’t write reflexes yourself, you ask Alfred and he builds it. Some examples:
- “Every morning at 8, send me a Discord DM with the weather and my reminders for the day.”
- “Watch this page once a day and message me if the price drops below R500.”
- “When someone posts in #support, if nobody replied within an hour, ping me.”
Alfred will test the handler before saving it, so if he tells you a reflex failed to save that’s a real error in the code and not a permissions problem.
Keeping them cheap
Section titled “Keeping them cheap”A reflex on a busy source can fire a lot, so Alfred can attach a few controls:
- A prefilter drops events before the handler even runs, so nothing is spent on events you don’t care about.
- Debounce batches events together instead of running once per event, for example ten messages or thirty seconds, whichever comes first.
- Concurrency decides what a second event does while a run is already going: queue it, run it alongside, or drop it.
You can just describe what you want and Alfred picks sensible values, but it’s worth being specific if you’re pointing a reflex at something noisy.
Limits
Section titled “Limits”Each run gets a short time budget, a small number of tool calls, and at most one agent wake. If a reflex fails repeatedly it gets paused, and Alfred can tell you why when you ask.
Ask Alfred to list your reflexes and he’ll show you what each one does, what it last did, and whether it’s currently paused.
Background agents
Section titled “Background agents”Add a background agent when a run needs actual judgement, writing, or a conversation with you. An agent has its own instructions, its own model, and its own files, and it keeps notes between runs so it can build something up over time.
Because agents have no trigger of their own, every agent needs a reflex pointed at it. Several reflexes can wake the same agent, which is how you’d have one “moderator” agent woken by a few different situations.
Good uses for an agent:
- Reading through something and writing a summary that’s actually worth reading.
- Deciding whether something is worth telling you about at all.
- Producing a document over many runs, a piece at a time.
Bad uses for an agent, where a plain reflex is better:
- Sending a message at a fixed time.
- Copying a value from one place to another.
- Anything where the answer is a simple yes or no.
Longer example
Section titled “Longer example”Complex automation needs more handholding from you, so be precise about the shape you want:
“Here’s the outline of a book I want you to write. Create a background agent for each chapter that’ll do its own independent research and write its chapter over time in a chapter.md file. Run 5 background agents at a time, each offset by 1 minute, with a cooldown of 5 minutes inbetween runs. Once a background agent completed its chapter, have it send me a message in Discord DMs. Once we’re through all chapters I’ll come back to you so you can stitch all the chapters together.”
And an example where the reflex does the cheap part and the agent does the thinking:
“Monitor the Butler status page every 10 minutes. If there’s an active incident, wake an agent that scans the forum for related tickets and gives me a sentiment summary with the threads that need attention.”
The check runs as a reflex, so the nine times out of ten where nothing is wrong it costs almost nothing. The agent only runs when there’s something to think about.
Older agents
Section titled “Older agents”Agents created before reflexes existed carry their own built-in trigger. They still run, but they’re frozen: they can’t be edited and a reflex can’t be attached to them.
If you want to change one of those, ask Alfred to build a replacement agent with a reflex and delete the old one.
What automation isn’t
Section titled “What automation isn’t”Automation is not a replacement for critical monitoring. Runs can be delayed, paused after repeated failures, or limited by your plan and usage allowance. Treat reflexes and agents as helpful automation, not as guaranteed infrastructure.