Skip to main content

ReAct Agent

A tool-using agent with labels, budget constraints, and a configured action space.

schema_version: "1.0.0"

metadata:
id: "research-assistant"
name: "Research Assistant"
version: "1.0.0"
description: "An agent that researches topics using web search"
labels:
team: "ai-platform"
environment: "development"

interface:
input:
type: object
properties:
query:
type: string
description: "The user's research question"
required: [query]
output:
type: object
properties:
response:
type: string
description: "The researched answer"
required: [response]

execution_policy:
id: agf.react
config:
instructions: |
You are a research assistant. When the user asks a question:
1. Use the web_search tool to find relevant information.
2. Synthesize the results into a clear, cited answer.
Be specific about the agent's role, capabilities, and constraints.
model: "gemini-2.0-flash"
provider: "google"
max_steps: 10
tool_choice: auto

action_space:
local_tools:
- alias: web_search
description: "Search the web for information on a topic"

constraints:
budget:
max_token_usage: 100000
max_duration_seconds: 300

What's New Here​

Labels​

labels:
team: "ai-platform"
environment: "development"

Key-value pairs for filtering, routing, and organizational tagging. Useful for multi-team deployments where you need to query agents by owner or environment.

ReAct Config Options​

FieldDescription
instructionsSystem prompt (multi-line with |)
modelModel identifier
providerModel provider hint (optional)
max_stepsMaximum reasoning steps before the agent must return
tool_choiceauto, required, or none

Action Space​

The action_space section declares what the agent can do. Here we define a single local tool:

action_space:
local_tools:
- alias: web_search
description: "Search the web for information on a topic"

The alias is the name the LLM sees. The runtime provides the actual implementation. This separation is key to portability — the same definition works on any runtime that implements a web_search tool.

Budget Constraints​

constraints:
budget:
max_token_usage: 100000
max_duration_seconds: 300

Hard limits enforced by the runtime:

  • max_token_usage — total token budget across all LLM calls
  • max_duration_seconds — wall-clock timeout

If either limit is exceeded, the runtime terminates the agent gracefully.

Validate​

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 lint research-assistant.agf.yaml
# ✓ research-assistant.agf.yaml: 0 errors, 0 warnings