For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Instrument multi-agent systems
이 페이지는 아직 귀하의 언어로 번역되지 않았습니다. 현재 작업 중이므로 곧 다시 확인해 주십시오.
In a multi-agent system, a parent agent delegates work to child agents. Create child agents from the parent with the AI SDK and Agent Analytics records the delegation: child agents carry the parent reference, sessions record the root agent and chain depth, and provider wrappers suppress spurious user-message events inside delegated calls. Every agent's events stay under one [Agent] Session ID.
Give every agent a stable, human-readable ID. Those IDs become the primary dimension for comparing quality and cost across your system.
Declare and dispatch child agents
Declare children off the parent with .child(), then dispatch to them with runAs() (Node) or arun_as() (Python):
const orchestrator = ai.agent('shopping-agent', { description: 'Orchestrates shopping requests' });
const recipeAgent = orchestrator.child('recipe-agent', { description: 'Finds recipes' });
await orchestrator.session({ userId }).run(async (s) => {
s.trackUserMessage(userInput);
const result = await s.runAs(recipeAgent, async (cs) => {
cs.trackUserMessage(delegatedQuery);
return openai.chat.completions.create({ model: 'gpt-4o', messages: [...] });
});
});
For the full delegation semantics (context inheritance, span wrapping, nested children, fan-out), refer to Multi-agent architectures in the SDK reference.
Analyze multi-agent sessions
Each [Agent] Session Record carries [Agent] Root Agent Name (the agent that started the session) and [Agent] Agent Chain Depth (how deep the delegation went). To compare agents, group any chart by [Agent] Agent ID. To analyze multi-agent sessions, filter Session Records where chain depth is greater than 1. Refer to Data hierarchy.
이 내용이 도움이 되었나요?