Configuration Reference
Complete reference for AIConfig, AsyncConfig, MemoryConfig, HarnessConfig, WebhookConfig, ToolCallConfig, and control-plane ARD guardrails.
Every knob your agents expose -- cost caps, rate limits, fallbacks, memory backends, and tool behavior.
AgentField agents are configured through typed config objects that control AI behavior, async execution, memory storage, harness loops, webhooks, and tool calling. Set defaults at agent creation time, then override per-call when you need different behavior.
Control-plane features such as external agent discovery are configured separately in agentfield.yaml or environment variables. Those settings define what the deployment is allowed to expose; per-reasoner publishing, imports, and callable external bindings are runtime state.
from agentfield import Agent, AIConfig, MemoryConfig, HarnessConfig
# Production-ready agent with cost controls, fallbacks, and memory
app = Agent(
node_id="production-agent",
ai_config=AIConfig(
model="anthropic/claude-sonnet-4-20250514",
fallback_models=["openai/gpt-4o", "deepseek/deepseek-chat"],
max_cost_per_call=0.05, # hard cost cap per LLM call
temperature=0.3, # consistent outputs
max_tokens=4096, # response length limit
enable_rate_limit_retry=True, # auto-retry on 429s
rate_limit_max_retries=5, # max retry attempts
fal_api_key="your-fal-key", # fal.ai API key for media generation
),
memory_config=MemoryConfig(
auto_inject=["workflow", "session"], # memory scopes to auto-inject
memory_retention="session", # retention policy
cache_results=True, # cache memory results locally
),
harness_config=HarnessConfig(
# provider omitted -> "aforge", AgentField's native default harness
max_turns=15, # max reasoning turns per harness
),
)import { Agent } from "@agentfield/sdk";
const agent = new Agent({
nodeId: "production-agent",
aiConfig: {
provider: "anthropic",
model: "claude-sonnet-4-20250514",
temperature: 0.3,
maxTokens: 4096,
enableRateLimitRetry: true,
rateLimitMaxRetries: 5,
},
memoryConfig: {
defaultScope: "session",
ttl: 86400,
},
harnessConfig: {
// provider omitted -> "aforge", AgentField's native default harness
maxTurns: 15,
},
});import (
"github.com/Agent-Field/agentfield/sdk/go/agent"
"github.com/Agent-Field/agentfield/sdk/go/ai"
)
a, err := agent.New(agent.Config{
NodeID: "production-agent",
Version: "1.0.0",
AIConfig: &ai.Config{
Model: "gpt-4o",
Temperature: 0.3,
MaxTokens: 4096,
},
// Provider omitted -> "aforge", AgentField's native default harness
HarnessConfig: &agent.HarnessConfig{
MaxTurns: 15,
},
})
// Note: MaxBudgetUSD is set via harness.Options at call time, not in agent.HarnessConfig,
// and is enforced only by provider "claude-code".
// Example: a.Harness(ctx, prompt, schema, &out, harness.Options{Provider: "claude-code", MaxBudgetUSD: 2.0})
if err != nil {
log.Fatal(err)
}