SDKs
Configuration Reference
Complete reference for AIConfig, AsyncConfig, MemoryConfig, HarnessConfig, WebhookConfig, and ToolCallConfig.
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.
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="claude-code", # coding agent provider
max_turns=15, # max reasoning turns per harness
max_budget_usd=2.0, # max cost per harness run ($)
),
)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: "claude-code",
maxTurns: 15,
maxBudgetUsd: 2.0,
},
});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,
},
HarnessConfig: &agent.HarnessConfig{
Provider: "claude-code",
MaxTurns: 15,
},
})
// Note: MaxBudgetUSD is set via harness.Options at call time, not in agent.HarnessConfig.
// Example: harness.Run(ctx, a, harness.Options{MaxBudgetUSD: 2.0})
if err != nil {
log.Fatal(err)
}