Use a sub-agent for a self-contained research or analysis request. Send all necessary context in its message: sharing a session for attachments does not share the parent’s transcript. Use a handoff when a specialist should continue speaking directly to the user with the conversation’s existing state.
An agent’s
Description tells a delegating agent what it does. Its Instruction controls how it behaves. Give each child the tools and credentials appropriate to its job. Delegation adds model calls and can recurse when agents can call themselves or each other; bound that work through application policy, deadlines, and the allowed catalog.
For local execution, register agents in hastekit.NewRegistry(). For durable execution, construct every participating agent with its runtime before starting workers. A registry supplies lookup; runtime registration supplies the worker implementation.