Always-on agents
Notes on Lee Robinson's Stanford CS146S talk, How always-on agents work, with a live widget for each idea.
Part 01
The loop that stops
Try: scroll to play the whole run, laptop first, then the phone
~/agent $ python agent.py
>
messages in memory: 0esc to interrupt
Tuesday
9:41
No messages from the agent
Press Enter to give the agent its task.
Part 02
Asleep until something happens
Try: scroll to move through the day, or untick a wake-up
Scroll to move through the daynow 00:00
Agent stops after 2 idle min · the computer's memory and disk are snapshotted before it stops
Part 03
Surviving a crash
Try: press Play, then crash at step 4 and make the steps idempotent
- Read the request
- Search flights
- Hold a seat
- ✕ Email the itinerary
- Read the request
- Search flights
- Hold a seat×2
- Email the itinerary×2
- Book and pay
- Read the request
- Search flights
- Hold a seat
- ✕ Email the itinerary
- Email the itinerary×2
- Book and pay
×2 = a side effect that happens again on the re-run · the crash lands after the side effect, before it is recorded
Part 04
Who goes first
Try: press Play, or send from Team and Slack, then from You
Idle
Empty
Part 05
Room in the context
Try: connect more tools, then move things out of the conversation
Illustrative token counts · window 200k
Part 06
Cheapest tool first
Try: press Play, or pick a task and break the connector
- 1What it already knows · memory and this conversation
- 2App connector · an API, fast and exact
- 3Web search · public pages
- 4Signed-in browser · reads the page structure
- 5Full desktop · clicks pixels on a 1280×800 screen
- 6Ask you · logins, 2FA codes, payments
Answered at rung 1 after trying 1 option.
Part 07
Keeping the cache warm
Try: press Play, then put the time at the top and play again
Illustrative · cost in fresh-token units · a cached token costs 10% of a fresh one · summary after call 10, while the cache is warm
Part 08
What it remembers
Try: scroll to let the weeks pass
- Works on the payments team9.0
- Prefers morning meetings8.0
- Works from the London office7.0
- Shipped the March release6.0
- Waiting on a reply from legal4.0
- Writes in British English6.0
Score = importance, halved every 3 weeks for events and every week for notes · memories are information, never instructions
Part 09
Training for the product
- 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
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
Part 10
Two improvement loops
Try: press Play, or step each loop
- 1An agent gets a task wrong
- 2Turn it into an eval
- 3Fix the harness, prompt or inference
- 4Check the evals
- 5Ship the fix
- ATrain a new model on the evals
- BPut it in the product
- CUsers find new uses
- DNew behaviour to test