Free Intensive Nov 21–22Free 2-day hands-on Vibecoding Intensive on Nov 21–22 at 16:00 MSK (Sat–Sun) · Live Cohort 3 starts Nov 23Join Free →Cohort 3 (Nov 23)
ReleaseResearch Paper · For R&DHabr AI→ original

Anthropic breaks an always-on agent into 5 blocks: queue, timers, memory

An always-on agent doesn't run around the clock. It sleeps most of the time and wakes on an event: a webhook, a timer, a customer's reply. Anthropic breaks it into five blocks: an event queue, timers, memory, access permissions and an outbound queue. In one example, an agent emails a customer and sets a reminder for the next day. When it wakes, it checks its memory to see what has already been done. Reliability here rests on an ordinary database and background services.

AI-processed from Habr AI; edited by Hamidun News
Anthropic breaks an always-on agent into 5 blocks: queue, timers, memory
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1The event queue is a database table, with one worker per queue
Key metric #2The prompt-injection check runs during the run, not in the handler
Key metric #3In a long-horizon task benchmark, Opus 5.5 came out 78% cheaper than Opus 5

An always-on agent is an AI assistant that decides for itself when to act instead of waiting for a user's message. Picture an agent that sends a customer an email and sets itself a reminder to check for a reply in a day. The next day it wakes up, looks through its notes, works out what has already been done, and follows up. Anthropic has published a guide that breaks such an agent into five blocks: an inbound event queue, timers, memory, access permissions and an outbound queue. If you want to make your product proactive, this is a ready-made blueprint for where to start.

An agent that sleeps most of the time

The guide's central idea is that an always-on agent doesn't actually run all the time. That is only a description of the user experience. Most of the time the agent sleeps. It wakes periodically, receives an event, performs a task and saves a record of what happened. One such period is called a run. A run takes place inside a session, which is a transcript of messages and tool calls. After the run the agent goes back to sleep, and the cycle repeats indefinitely.

The agent's core loop is the same as in ordinary agents. What differs is the architecture around it, which controls when the agent wakes, what persists between runs and how the result reaches the user.

The authors give two reasons for the revival of such agents. First, recent models understand user intent better and are more reliable at judging when to reach out. Second, intelligence is getting cheaper, and long-horizon tasks benefit the most. In one long-horizon programming benchmark, solving a single task with Opus 5.5 cost 78% less than with Opus 5. For typical workloads, the reduction was 40%.

Queue, timers and memory

The first block is the inbound event queue. It is tempting to call the agent directly from every source, but then two simultaneous events start competing processes, and an event can be lost if something fails. So sources write events to a queue, and a worker process picks them up. The simplest version has three parts: a persistent list of events (usually a database table), a handler (an HTTP endpoint) that writes events, and a worker (a background service) that reads them. The queue tracks the status of each event and removes duplicates using unique identifiers from the source. The guide recommends starting with one queue per user.

A few practical rules from the guide:

  • The handler acknowledges an event quickly, because webhook providers treat slow responses as errors. Lightweight checks are fine up front, while deeper ones, such as prompt-injection checks, run during the run.
  • The queue is the source of truth. If a worker crashes, a new one picks up the same event and retries.
  • Each queue has exactly one active worker at any moment, so two runs don't duplicate work or overwrite each other's data. If an event arrives during a run, it is deferred to the next run, merged with the current one, or the current run is interrupted and restarted.
  • Pending events are batched: if a user sends several messages in a row, the agent replies once.

The second block is timers. They come in two kinds: reminders that the agent sets for itself (for example, to check whether a reply has arrived) and schedules, which are recurring tasks such as a daily news digest. Timers live in a separate table, not in the queue, because the queue should hold only events that are ready to process. A timer doesn't trigger anything by itself. A scheduler, usually a background service, checks at fixed intervals for due timers. It marks a reminder as done or moves a schedule to its next date, adds an event to the queue and wakes the worker. You can write the scheduler yourself or use a durable execution engine.

The third block is memory. The agent operates across disconnected runs, and memory gives it continuity. It must live in persistent storage, either a database or object storage, so it survives the worker process. Store only what can't be retrieved again: if the data is already in a task tracker, saving a link is enough. Memory holds four kinds of information:

  • user instructions, loaded at the start of every run
  • notes about the user (job title, preferences, corrections)
  • the agent's past messages, so nothing is repeated
  • a progress file for each task, recording what is done and what remains

When notes pile up, they are split into small files, and only an index is loaded at the start of a run. You can also add "dreaming": a review of past sessions that replaces outdated entries and finds patterns visible only across many runs.

Context and access permissions

Before working, the agent loads the system prompt, tool definitions and memory files. This initial context cost is paid on every run, so it should be kept minimal, with prompt caching in use. A new session starts with only these and the triggering event, while an existing session restores messages and tool calls from past runs. If a session grows too long, old messages are compressed or a new session begins. Either way, details are lost, so everything important should be written to memory as the work proceeds.

For access permissions, the components are the same as for other agents. For passwords and tokens, the guide recommends a proxy server outside the agent's environment: the agent sends requests without credentials, and the proxy inserts the real ones before forwarding. To let the agent work without constant user involvement, Anthropic points to auto mode in Claude Code. There, classifiers check risky actions and block dangerous ones, and the model looks for a safer path.

The practical takeaway is that most of such a system is the familiar queues, schedulers and storage of an ordinary backend. The difficulty lies not in the model itself but in making sure events aren't lost, runs don't overlap and memory doesn't bloat the context. Keep in mind that this is a guide from a model vendor, and the cost-savings figures come from a single benchmark.

Story

Key Questions Answered

What are the key details on An agent that sleeps most of the time?

The guide's central idea is that an always-on agent doesn't actually run all the time. That is only a description of the user experience. Most of the time the agent sleeps. It wakes periodically, receives an event, performs a task and saves a record of what happened. One such period is called a run. A run takes place inside a session, which is a transcript of messages and tool calls. After the run the agent goes back to sleep, and the cycle repeats indefinitely.

What are the key details on Queue, timers and memory?

The first block is the inbound event queue. It is tempting to call the agent directly from every source, but then two simultaneous events start competing processes, and an event can be lost if something fails. So sources write events to a queue, and a worker process picks them up. The simplest version has three parts: a persistent list of events (usually a database table), a handler (an HTTP endpoint) that writes events, and a worker (a background service) that reads them.

What are the key details on Context and access permissions?

Before working, the agent loads the system prompt, tool definitions and memory files. This initial context cost is paid on every run, so it should be kept minimal, with prompt caching in use. A new session starts with only these and the triggering event, while an existing session restores messages and tool calls from past runs. If a session grows too long, old messages are compressed or a new session begins. Either way, details are lost, so everything important should be written to memory as the work proceeds.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
What do you think?
Loading comments…