Knaph

Depth 1 · 160 s

Two hundred pages

An agent reads 200 pages to find 11 names, and is slow and muddled afterwards. How a subagent does the reading in a fresh context of its own and sends back only the report.

About this video

Leila asks her agent which of 200 product pages still show last year's prices. It finds them: 11 pages. But on the real job afterwards, rewriting the spring campaign, the agent is slow and mixes up details from the product pages with her notes. Why? Every page it read became a tool result in its context, and it stays there, sent again with every request. The reading was needed; keeping it wasn't.

A subagent is an agent started by another agent for one side task. The main agent writes it a brief: what to do, where to look and what to send back. The subagent starts with a fresh context window of its own, holding only its own system prompt and the brief, runs its own loop of tool calls, and often uses a cheaper, faster model. It reads the 200 pages in its own context, perhaps 150,000 tokens, and writes a short report. Only the report, a few hundred tokens, comes back to the main agent, and the subagent's context is thrown away.

Because each has its own context, several subagents can work side by side, each sending back a short report. Handing work to a helper like this is called delegation.

It has costs. It uses more tokens in total. The helper knows only its brief, not your conversation: if you explained that "price" means the price before tax and the brief doesn't say so, the helper doesn't know. The report can drop details, and you can't watch the work. So delegate when a side task needs a lot of reading and little of it is the answer, keep the deciding in your main conversation, and check one or two of the files a report names.

This video shows depth 1 of Subagent.

Learn Subagent

Transcript

  1. 0:00Leila asked her agent which of two hundred product pages still show last year's prices. The answer was eleven file names. So why was the agent slow and muddled afterwards?
  2. 0:19Every page it read became a tool result in its context, and it stays there, sent again with every request. The campaign needs one line.
  3. 0:37A subagent is a second agent with its own fresh context. The main agent writes it a brief. The subagent reads the pages in its own context and writes a short report. Only the report comes back, and its context is thrown away.
  4. 1:08In Leila's case, about a hundred and fifty thousand tokens are read in the subagent's context, and a few hundred arrive in hers.
  5. 1:26Because each has its own context, several helpers can work at once, and each sends back a short report.
  6. 1:46But a helper knows only its brief. It never saw your conversation. If price means the price before tax, the brief has to say so.
  7. 2:08Delegation costs more tokens in total, and you only see the report. It pays when a side task needs a lot of reading and little of it is the answer.
  8. 2:30Delegate the reading. Keep the deciding.