Multi-agent pipeline
Agents run in a fixed order and each builds on the last. Here a researcher feeds a writer, using workflow routing.
This example: a briefing pipeline. A researcher gathers notes from the web, then a writer turns them into a one-page executive brief. Every request goes through both steps.
Example (replies vary)
You: Brief me on RAG evaluation methods.
→ research: bullet-point notes with sources
→ writer: turns the notes into a brief
Agent: RAG evaluation: executive brief
Summary: Teams measure two things, retrieval quality and answer
quality ...
Key methods: ...
Recommendation: ...
contributing_agents: ["research", "writer"]
- Python
- TypeScript
from custodian_labs import Custodian, CustodianSquad
squad = CustodianSquad(
custodians=[
Custodian(
name="research",
model="gpt-6-luna",
system_prompt="Research the topic on the web. Produce bullet-point notes with sources.",
tools=["web_search", "scrape_url"],
output_key="research_notes",
),
Custodian(
name="writer",
model="gpt-6-luna",
system_prompt="Write a one-page executive brief from the research notes.",
),
],
routing_mode="workflow",
workflow_order=["research", "writer"],
)
reply = squad.deploy().chat("Brief me on RAG evaluation methods.")
print(reply.contributing_agents) # ['research', 'writer']
print(reply.response)
import { Agent, AgentTeam } from "@custodianlabs/sdk";
const team = new AgentTeam({
agents: [
new Agent({
name: "research",
model: "gpt-6-luna",
systemPrompt: "Research the topic on the web. Produce bullet-point notes with sources.",
tools: ["web_search", "scrape_url"],
outputKey: "research_notes",
}),
new Agent({
name: "writer",
model: "gpt-6-luna",
systemPrompt: "Write a one-page executive brief from the research notes.",
}),
],
routingMode: "workflow",
workflowOrder: ["research", "writer"],
});
const reply = await (await team.deploy()).chat("Brief me on RAG evaluation methods.");
console.log(reply?.contributingAgents); // ["research", "writer"]
console.log(reply?.response);
Learn more
- Multi-agent routing: how pipelines pass work along and when to use them.
- Built-in tools: the web tools the researcher uses.