liveBook · Manning

Isolation

As explained in Build an AI Agent (From Scratch)

Context isolation is the separation of the information supplied to one agent from the context supplied to another agent during coordinated execution.

Context isolation separates the information supplied to collaborating agents. Instead of sharing a conversation history, an agent receives a specific request, works in its own context, and returns its result. Its intermediate steps stay out of the caller’s context. section 9.2 section 9.4.3

In the Agent as Tool pattern, a parent agent coordinates specialists. The AgentTool adapter receives the parent’s context but does not pass it to the child. It passes a request string instead, and the child runs in a new context. If an input schema is supplied, the adapter validates the input with Pydantic and converts it to a JSON string. section 9.4.2

Delegating research

An orchestrator asks a researcher to investigate a question. The researcher may search the web several times, but only its final result returns to the orchestrator. The parent can use that result without carrying the searches and intermediate reasoning in its own context. section 9.4.3

Figure 9.8 Agent as Tool: the child agent runs in an isolated environment and returns only the final result.

The diagram shows the boundary between the orchestrator and an isolated child agent. section 9.4.3

Isolation provides abstraction and saves context-window space: the parent sees the result rather than every internal tool call and reasoning step. It also makes the child’s tool use and failures less directly visible to the parent. The trade-off is harder debugging, because inspecting the child’s execution requires a separate inspection. section 9.4.3

Choose the context boundary to suit the collaboration. A workflow can share a context or create separate contexts for its agents; sharing is useful when intermediate state must pass between steps. Agent as Tool keeps the coordinator in control and isolates specialists, while Transfer shares context when routing control to a specialist. section 9.2 section 9.4.3

How Build an AI Agent (From Scratch) covers it

How deep it goes
Explains the request boundary in AgentTool and weighs context efficiency against debugging and intermediate-state sharing.
Examples
Uses a research specialist whose web searches remain hidden while its final result returns to the orchestrator.
What you can do after
Apply it through AgentTool by sending a request string to a child agent that runs in a new context.
How it connects
Contrasts Agent as Tool with Workflow and Transfer through their context-sharing and control choices.

Also explained in

Compare how 9 books explain isolation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build an AI Agent (From Scratch). The section links point to the parts of the book it draws on.