# branch

fun branch(childAgent: BaseAgent): InvocationContext

Creates a new InvocationContext for a child agent, derived from this context. Appends the given agent's name to the branch path.

#### Return

The new InvocationContext.

#### Parameters

childAgent

The new agent for the branched context.

val branch: String? = null

The branch of the invocation context.

The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of agent_2, and agent_2 is the parent of agent_3.

Branch is used when multiple sub-agents shouldn't see their peer agents' conversation history.