# Always-on agents

An always-on agent keeps its context between sessions and acts without someone
prompting it. It is asleep most of the time. Something wakes it, it does its
work, it saves what happened, and it goes back to sleep.

Vatio is a managed platform for that kind of agent. You write the agent
(instructions, knowledge, tools, schedules, tests) through the [MCP](https://vatio.ai/docs/mcp).
Vatio runs everything around the model: what wakes the agent, what it keeps
between runs, what it may do without asking, and how its work reaches people.

The model on this page follows Anthropic's
[Building always-on agents](https://claude.com/resources/articles/building-always-on-agents).
Each part below names what Vatio already provides and links to its reference
page.

## Runs and sessions

A **run** is one wake-up: the agent receives one or more events, calls its
tools, and ends. A **session** is the transcript a run happens in: the messages
and tool calls so far. In Vatio a session is a conversation, and each person
has their own per channel. You read every session, with its tool calls, in the
[inbox](https://vatio.ai/docs/channels/inbox) or with `get_conversation`.

A run ends in one of three ways:

1. The agent sends a message.
2. The agent sends nothing, because there is nothing worth saying.
3. The agent leaves a tool call waiting for a person's approval.

## Events: what wakes the agent

| Event | Where it comes from | Reference |
|---|---|---|
| A message | WhatsApp, Instagram (direct messages and comments), the web widget, the iOS, Android and Flutter SDKs | [Channels](https://vatio.ai/docs/channels/) |
| An event from your backend | `POST /api/server/v1/:workspace/events`: "task 12 was assigned to you" | [Events API](https://vatio.ai/docs/api/events) |
| A follow-up | A tool's answer schedules it, or the agent sets it for itself with `follow_up` | [Follow-ups](https://vatio.ai/docs/tools#follow-ups) |
| A schedule | A recurring time you set: every Monday at 08:30 | [Schedules](https://vatio.ai/docs/schedules) |
| The result of a slow tool | An async tool finished, or a person answered an approval | [Async tools](https://vatio.ai/docs/tools#a-tool-that-takes-longer-async) |

Vatio stores every event before the agent runs, so a deploy or a failed run
does not lose one. Events for the same person that arrive together are handled
in one run and get one answer: several WhatsApp messages sent seconds apart,
or three events that fall due in the same minute.

An event is a pointer, not a message. When it falls due the agent looks up the
current state with its tools and then writes, or writes nothing because the
task was closed or the date moved. An event with a `key` can be moved or
rewritten while it is still scheduled.

## Timers: follow-ups and schedules

A **follow-up** is a deadline for one person: "ask again on Friday whether the
quote was accepted". The agent sets it with the built-in `follow_up` tool, or a
tool's answer sets it. See [Follow-ups](https://vatio.ai/docs/tools#follow-ups).

A **schedule** repeats: days, a time, a time zone, who it is for, and the
instruction the agent receives each time. Set it with `set_schedule`. Each time
it comes round, the agent runs once per person. See [Schedules](https://vatio.ai/docs/schedules).

Timers are how an agent works on its own: a summary every morning, a reminder
before a deadline, a check that writes only when something is off.

## Memory: what survives a run

| Kind | What it holds | Reference |
|---|---|---|
| Instructions | Who the agent is and how it works. Loaded on every run | [Agents](https://vatio.ai/docs/agents) |
| Memory per person | What the agent learned about one person, written with `remember` and read with `recall` | [Memory](https://vatio.ai/docs/tools#memory) |
| Past messages | The conversation so far, with a summary of older turns | [Inbox](https://vatio.ai/docs/channels/inbox) |
| Knowledge | Entries the agent searches, with versions and history. The business can write them from WhatsApp | [Knowledge](https://vatio.ai/docs/knowledge) |

Keep in memory only what the agent cannot look up again. What lives in your
system (an order, a booking, a balance) belongs behind a [tool](https://vatio.ai/docs/tools), which
reads the current value on every run.

## Permissions: what the agent may do without asking

A run acts for a person while nobody watches, so each tool call either
proceeds, is blocked, or waits for a person.

- **Secrets never reach the agent.** A tool reads a workspace secret as
  `$env.KEY`. Vatio puts the value into the request it sends to your backend;
  the model sees neither the value nor the header. See [Tools](https://vatio.ai/docs/tools#declarative-http-tools).
- **Tools know who is asking.** A private tool takes the verified identity of
  the signed-in user or the contact's phone number from Vatio, never from the
  model. See [Authentication](https://vatio.ai/docs/authentication/) and [Access](https://vatio.ai/docs/tools#access).
- **A person approves a sensitive call.** A tool declared with `approval` does
  not run when the agent calls it. The people who may approve it are asked on
  WhatsApp, the run ends, and the answer comes back as an event that resumes
  the conversation. See [Approval](https://vatio.ai/docs/tools#approval).
- **The agent asks the team what it does not know**, and keeps the answer. See
  [Ask the team](https://vatio.ai/docs/handoff#ask-the-team-keep-the-answer).
- **Safeguards check every reply** before it is sent. See [Safeguards](https://vatio.ai/docs/safeguards).

## Output: how its work reaches people

The agent's reply goes out on the channel the event came from. A message the
agent starts (an event, a follow-up, a schedule) goes to the person's WhatsApp
chat, with a template approved by Meta when the 24-hour window is closed. Each
one is tracked as sent, read, failed or skipped, where skipped means the agent
decided there was nothing to say. Failed sends are retried.

[Quiet hours](https://vatio.ai/docs/handoff#hours-when-the-agent-does-not-answer) set when the agent
does not answer. Start quiet: an agent that writes only when it matters earns
the attention it gets.

Every agent reports to a person. What it sends to its team rather than to a
customer is a [notice](https://vatio.ai/docs/notices) of one kind: a question, an approval, a
handoff, a summary or an alert. The agent picks the kind; the team or those
who build the agent get it, always in the inbox's For you page and on WhatsApp
unless they turned it off. So the
outbox has three destinations:

| Destination | Who decides the recipient | When it goes out |
|---|---|---|
| The person the event is about | The event: whoever wrote, or the `to` of an event, a schedule or a follow-up | At once for a message; when the event falls due, with a template if the 24-hour window is closed |
| A notice to the team | The workspace's routes, by kind | Queued, on WhatsApp or in the inbox; a WhatsApp one that cannot go out lands in the inbox |

Your backend can also send a message without the agent: `POST /messages` sends
your own text or a template, exactly as written ([Messages](https://vatio.ai/docs/api/messages)).
To have the agent write, publish an [event](https://vatio.ai/docs/api/events), with `required: true`
when it must write.

The team reads what the agent did, replies as a person and takes over a
conversation in the [inbox](https://vatio.ai/docs/channels/inbox), on the phone too.

## What Vatio adds

| Part | What it does | Reference |
|---|---|---|
| Channels | WhatsApp, Instagram, the web and apps, connected once | [Channels](https://vatio.ai/docs/channels/) |
| Inbox | Where people supervise the agent | [Inbox](https://vatio.ai/docs/channels/inbox) |
| Tests | A reported mistake becomes a test. A change reaches people once the tests that pass today still pass | [Improve](https://vatio.ai/docs/improve) |
| Versions | Every change is a version, and `get_status` says where the newest one stands | [Deployments](https://vatio.ai/docs/deployments) |
| Analytics | Conversations, reports and what the agent saved | [Inbox](https://vatio.ai/docs/channels/inbox) |

## What you build, and where

You build through the MCP: `update_agent`, `set_tool`, `set_backend`,
`write_knowledge_entry`, `set_schedule`, `add_test`. Nothing about the agent
lives in your repository.

Three things are done in the inbox instead, because the MCP cannot do them:

- **Creating a secret key or a webhook.** Its value is shown once, to a person.
- **Connecting WhatsApp or Instagram.** Meta's consent screen only opens in a browser.
- **Paying for a plan.**
