Skip to main content

Minimal Agent

The smallest valid Agent Format definition. This is a good starting point for understanding the required fields.

schema_version: "1.0.0"

metadata:
id: "hello-agent"
name: "Hello Agent"
version: "1.0.0"
description: "A minimal agent that answers questions"

interface:
input:
type: object
properties:
query:
type: string
description: "The user's input"
required: [query]
output:
type: object
properties:
response:
type: string
description: "The agent's response"
required: [response]

execution_policy:
id: agf.react
config:
instructions: "You are a helpful assistant. Answer the user's question concisely."
model: "gemini-2.0-flash"

Walkthrough

schema_version

Every .agf.yaml file starts with schema_version. This tells parsers and runtimes which version of the Agent Format specification the file conforms to.

metadata

Required identification fields:

FieldPurpose
idMachine-readable identifier (must match ^[a-z0-9][a-z0-9_-]*$)
nameHuman-readable display name
versionSemVer version string
descriptionShort description of what the agent does

interface

Defines the agent's input and output contracts using JSON Schema. Runtimes use this to validate data before passing it to the agent and after receiving results.

execution_policy

Declares how the agent runs. Here we use agf.react — a ReAct (Reasoning + Acting) loop where the LLM can reason and call tools iteratively. The minimal config requires only:

  • instructions — the system prompt
  • model — the model identifier

Scaffold It

info

The agf CLI will be publicly available soon. See the CLI Reference for the command reference. You can validate this example now using the Playground.

agf init --id hello-agent --name "Hello Agent" -f hello-agent.agf.yaml

Validate It

agf validate hello-agent.agf.yaml
# ✓ hello-agent.agf.yaml: valid

agf lint hello-agent.agf.yaml
# ✓ hello-agent.agf.yaml: 0 errors, 0 warnings