Renaissance LabsLearn

Models · How agents work

How AI agents work: build one from scratch

Model, context, tools and a loop

7 minBeginner9 chapters

The film builds an agent from nothing. It starts with a model that only predicts tokens, shows that a chatbot's memory is a list the program resends, and adds tools and a loop. It then covers context limits and compaction, memory, skills, sub-agents, heartbeats for autonomy, and the safety risks that come with more power.

What to take away

  • A language model only predicts the next token; a chatbot's memory is a message list that the program sends again every time.
  • Giving the model tool descriptions lets it ask the program to act, and a loop of ask, act and ask again makes an agent.
  • The context holds everything and is resent every step, so agents compact older parts, and deciding what to keep is the art.
  • Skills load full instructions only when a task matches, and sub-agents return only a short report to keep the main context clean.
  • More power means more risk, so treat what an agent reads as data, give least access and ask a human before irreversible steps.

Go deeper

Read the transcript105 lines, click any line to jump

This transcript comes from automatic captions and may contain small errors.

Keep watching