From LLM to chatbot to agent
How a tool-calling loop and a harness turn a plain model into an agent.
About this chapter
Sarah explains that every bot is an LLM, and that prepending output to the next prompt gives chat and context. Feeding output back into the model, with a stop token to end the loop, turns chat into an agent. Tool calls are a hack: the model names a function and arguments, the system executes it and feeds the result back. Context plus tools is called the harness.
The dotted return path feeds the model’s output back into its context.

The model outputs send_email and the recipient argument for the harness to execute.

The dotted harness surrounds the context window, model and tools.
Give your agent a terminal and a browser
Terminals, sandboxes and browsers as ways for an agent to act.
About this chapter
A terminal lets the agent do almost anything on a computer, either on the user's machine or in a sandbox or VM such as E2B and exe.dev, which Composio uses internally. Browsers can come from BrowserBase or BrowserUse, or the user's own via Chrome DevTools MCP. Browsers are slow, iterative work, so she recommends direct API access via MCP or CLI when one exists.

The API route reaches the same request directly beneath the longer browser route.
Use Composio for APIs and authentication
Why API keys and OAuth are hard, and how a managed layer exposes 1,700+ apps.
About this chapter
Most APIs authenticate through API keys or OAuth, and OAuth often requires a developer app, payment or approval. Sarah recommends Composio, which offers over 1,700 apps, manages tokens and keys, and has a free tier of 100,000 tool calls monthly. A search tool and an execute tool keep thousands of tools out of the context window.

An API-key field sits beside an OAuth consent screen for a Google account.

1. Tool definitions pile up beneath the red context-window limit. 
2. The agent searches for GMAIL_SEND_EMAIL, then uses the execute tool to send the message through Gmail.
Channels: talk to your agent over iMessage
Photon, Linq and CopilotKit make messaging and chat interfaces easy.
About this chapter
Sarah says she regrets not setting up iMessage for her own bot, since Photon Spectrum, Linq and SDKs handle the complexity. For a web chat UI she would start with CopilotKit rather than build from scratch. Agents like Poke and Instinct have no web interface and feel like their own entity through text, email or phone apps.

A calendar request and reply appear in a message thread alongside two iMessage SDKs.
How agent memory is built
Storage, search and higher-level layers like dreaming, using OpenClaw as an example.
About this chapter
Memory usually combines automatic per-turn context with tools for exploring more. It has three layers: storage (file system or database), search (keyword or vector), and extras like dreaming or graphs. OpenClaw loads soul.md, identity.md, user.md and memory.md each session, keeps daily notes searched via terminal, and dreams at 3am to update memory.md. She also mentions using Glen with Claude Code.

A managed memory service encloses storage, search, dreaming and graphs.

1. IDENTITY.md gives the bot a name, a character and a tone of voice. 
2. Four OpenClaw files flow into the session’s context window.

1. A terminal search for “dentist” can retrieve the appointment from the dated daily log. 
2. At 03:00 the nightly process promotes a lasting preference to MEMORY.md and combines the dentist notes.
Make bots proactive with schedules and triggers
Cron wake-ups and event triggers let an agent act without being prompted.
About this chapter
Proactivity is what makes an agent always-on. OpenClaw originally used a cron job to wake the agent about every 30 minutes. Alternatively, event triggers such as Composio Triggers can wake an agent when a support ticket arrives. Most popular bots allow both, though by default they wake on a regular cadence.
A new support ticket travels through a trigger and wakes the bot.
Permissions and safety for agents
Why full terminal and browser access is risky and how scopes limit it.
About this chapter
Full access means an agent logged into Google could delete your account as you could. One mitigation is a separate computer or browser logged into accounts you don't care about. For sensitive services like email and Slack, API scopes help, such as read but not delete, and Composio can block specific tools. She closes by inviting comments.

Fetch and send are enabled. The delete-message tool is crossed out.