Create subagents to compartmentalize tasks and create more complex agents
PromptL
prompt with type: agent
that can plan, act, and iterate autonomously, calling tools or other agents as needed.
Sub-Agent: Any agent that is exposed as a callable function/tool within another agent, allowing for modular, reusable, and composable workflows.
Use an Agent when… | Use a Chain when… |
---|---|
The workflow is open-ended or branching | The workflow is strictly sequential |
The model must decide which tools/agents to call | The steps are always the same |
You want dynamic planning or iteration | You want deterministic, fixed steps |
type: agent
enables agentic mode.tools:
lists external tools the agent can call.maxSteps:
(optional) limits the number of agent cycles.agents:
configuration key:
<step>
blocks and specify which agent to call:
maxSteps
is reached.
schema
to define expected outputs for each agent.maxSteps
.agents/web_search
: Searches the web for relevant articles.agents/summarizer
: Summarizes article content.agents/citation_checker
: Verifies the credibility of sources.