Let one agent hand a question to another agent, called as a tool, and use its answer. Each call runs as a child run.
Before you start
You need a project with an agent. See Create an agent.
Let an agent call another
- Add the specialist. Here it holds the answer to refund questions:
agents/billing.ts
import { agent } from "veryfront/agent"; export default agent({ id: "billing", name: "Billing", system: "Answer billing questions in one sentence. Refunds take 5 business days.",}); - Name it in the front agent's
delegates. Each one becomes anagent_<id>tool:agents/support.tsimport { agent } from "veryfront/agent"; export default agent({ id: "support", name: "Support assistant", system: "Send billing and refund questions to the billing agent and pass its answer on.", delegates: ["billing"],}); - Start the project with
npm run dev. - Open Chat in Studio.
- Pick Support assistant.
- Ask "How long does a refund take?". You should now see it call
agent_billingand reply 5 business days.