AgentDefinition Configuration

Advanced

Configure subagent invocation, context passing, and spawning · Difficulty 3/5

0%
agent-definitionconfigurationcontext-passing

The AgentDefinition configures each subagent type in a multi-agent system, specifying its role, capabilities, and constraints.

Configuration Fields

  • Description: What the subagent does, used by the coordinator to decide when to invoke it
  • System prompt: Sets the subagent's behavior, context, and constraints
  • Tool restrictions: Limits which tools the subagent can access (principle of least privilege)
  • Context Passing Best Practices

  • Structured data formats: Separate content from metadata when passing between agents
  • - Include source URLs, document names, page numbers alongside content

    - Preserves attribution through the pipeline

  • Complete findings: Include full prior agent outputs in the subagent prompt
  • - Don't summarize away details the subagent might need

    - Pass web search results AND document analysis outputs to synthesis agents

  • Goal-oriented prompts: Specify research goals and quality criteria
  • - Avoid step-by-step procedural instructions

    - Enable the subagent to adapt its approach to the specific query

    Key Takeaways

    • AgentDefinition includes description, system prompt, and tool restrictions per subagent type
    • Use structured data formats to preserve attribution when passing context between agents
    • Include complete findings from prior agents -- don't summarize away needed details