# Always-on agents

> Notes on Lee Robinson's Stanford CS146S talk, How always-on agents work, with a live widget for each idea.

- Author: Andrei Moise
- Published: 2026-10-22
- Category: Agentic Workflows
- Canonical: https://andreimoise.ai/blog/always-on-agents

## The loop that stops

[▶ 00:26 in the talk](https://www.youtube.com/watch?v=L1OBRtfPS34&t=26s)

```agent-loop
user: Move my dentist appointment to next week
think: Find the current booking first.
call: calendar.find("dentist")
result: Tue 14 Oct, 09:30
call: calendar.free_slots(next week, mornings)
result: Mon 09:00, Wed 10:30
think: Wednesday keeps Monday clear for the release.
reply: Wednesday 10:30 is free. Shall I move it?
```

## Asleep until something happens

[▶ 10:12 in the talk](https://www.youtube.com/watch?v=L1OBRtfPS34&t=612s)

```always-on
agent idle stop = 2
computer idle stop = 5
07:30 Routine: inbox summary | 3 | no computer | sends
09:15 Your message | 8 | computer | sends
11:00 Scheduled check-in | 1 | no computer | quiet
13:40 Slack mention | 2 | no computer | quiet
13:40 Same Slack event, delivered again | duplicate
17:05 Helper finished | 4 | computer | sends
```

## Surviving a crash

[▶ 16:20 in the talk](https://www.youtube.com/watch?v=L1OBRtfPS34&t=980s)

```durable
Read the request
Search flights
Hold a seat | side effect
Email the itinerary | side effect
Book and pay | side effect
```

## Who goes first

[▶ 17:21 in the talk](https://www.youtube.com/watch?v=L1OBRtfPS34&t=1041s)

```inbox
you = Make it the 3pm train instead | Also add a return
team = Can we invite Ana? | And Luca | Thanks!
slack = The client moved the call
helper = 4 options found
routine = Friday digest
```

## Room in the context

[▶ 19:58 in the talk](https://www.youtube.com/watch?v=L1OBRtfPS34&t=1198s)

```context
window = 200000
system prompt = 6000
conversation = 15000
tool details = 2500
tool name = 25
tools = 40
used on demand = 3
offload = Long tool outputs go to files | 30000 | 200
offload = Screenshots go to a helper | 40000 | 1500
offload = Old messages become a summary | 50000 | 4000
```

## Cheapest tool first

[▶ 21:34 in the talk](https://www.youtube.com/watch?v=L1OBRtfPS34&t=1294s)

```ladder
rung = What it already knows | memory and this conversation
rung = App connector | an API, fast and exact
rung = Web search | public pages
rung = Signed-in browser | reads the page structure
rung = Full desktop | clicks pixels on a 1280×800 screen
rung = Ask you | logins, 2FA codes, payments
task = When is my next dentist visit? | 1
task = How many invoices are unpaid? | 2
task = What changed in Node 24? | 3
task = My balance in a bank portal with no API | 4
task = Export a report from an old desktop app | 5
```

## Keeping the cache warm

[▶ 27:45 in the talk](https://www.youtube.com/watch?v=L1OBRtfPS34&t=1665s)

```cache
prefix = 20000
per turn = 8000
calls = 16
break at = 6
summary after = 10
summary = 4000
cached price = 0.1
```

## What it remembers

[▶ 32:51 in the talk](https://www.youtube.com/watch?v=L1OBRtfPS34&t=1971s)

```memory
profile limit = 3
log limit = 3
core: Prefers morning meetings | 8 | 0
core: Writes in British English | 6 | 0
core: Works on the payments team | 9 | 0
core: Works from the London office | 7 | 0
core: Moved to the Lisbon office | 7 | 5 | replaces Works from the London office
event: Shipped the March release | 6 | 0
event: Booked the team offsite | 7 | 1
event: Hired a designer | 5 | 2
event: Started the security audit | 8 | 4
event: Signed the vendor contract | 6 | 6
note: Waiting on a reply from legal | 4 | 0
note: Draft is in the shared folder | 3 | 3
note: Call the bank after lunch | 2 | 6
```

## Training for the product

[▶ 34:32 in the talk](https://www.youtube.com/watch?v=L1OBRtfPS34&t=2072s)

```text
Pre-training: learns language, code and general knowledge from a huge amount of text
↓
Supervised fine-tuning: learns this product's tools and formats from worked examples
↓
Reinforcement learning: practises real agent tasks and is scored on the result
```

## Two improvement loops

[▶ 36:04 in the talk](https://www.youtube.com/watch?v=L1OBRtfPS34&t=2164s)

```flywheel
inner = An agent gets a task wrong | Turn it into an eval | Fix the harness, prompt or inference | Check the evals | Ship the fix
outer = Train a new model on the evals | Put it in the product | Users find new uses | New behaviour to test
```

## Sources

- Lee Robinson, Stanford CS146S: How always-on agents work: https://www.youtube.com/watch?v=L1OBRtfPS34

```youtube
id = L1OBRtfPS34
title = Stanford CS146S: How always-on agents work · Lee Robinson
```
