Skip to main content
An agent file defines one named agent: what it’s for, which model it runs on, which tools it may call, which other agents it can use, and its system prompt. graph ships built-in agents, and a file with the same name replaces a built-in everywhere it’s used.

Fields

Unknown keys are a load error that names the key. The two schemas are independent: an agent may declare either, both, or neither.

Prompt templates

system_prompt can reference two roots, and nothing else: Inserted text is never parsed again, so a section that contains template syntax arrives intact. The template language has no escape for literal braces, so a prompt can’t contain an example like {{E0.values}} directly. Reference {{rules.templating}} instead, which carries the template rules with their examples.

Where agents come from

graph loads agents in layers. A later layer replaces an earlier agent with the same name, as a whole file — fields aren’t merged.
  1. Built-in agents, compiled into the binary.
  2. Global agents in ~/.config/graph/agents/*.yaml.
  3. Project agents in ./.graph/agents/*.yaml.
Two files with the same name in one directory are a load error. The built-in chat agent is graph’s default general assistant. It can call any catalog tool and run copies of itself as subagents. The built-in tool_drafter and agent_drafter agents write user tools and agents with you. The workbench adds four more built-ins (front_desk, plan_drafter, plan_loader, plan_editor) and its own versions of tool_drafter and agent_drafter that work in the drafting pane, which graph agents lists and shows like any other.

Checks

graph agents validate checks every agent, or one file against the others:
  • every name under subagents and handoffs is a defined agent;
  • subagents don’t form a cycle, except an agent listing itself;
  • tools patterns, the schemas, and the prompt template are well formed, and the prompt references only rules.* and session.*.

Commands

show prints an agent’s effective file with its current version, the starting point for customizing a built-in: copy it to ./.graph/agents/<name>.yaml and edit. list also shows the workbench’s own agents (front_desk, plan_drafter, plan_loader, plan_editor), marked workbench only: they run in graph wb, not in graph chat, graph ask --agent or a plan step. See the CLI reference.