Skip to content

Configuration Reference

Every aspect of Reactive Agents is configurable through the builder API. This page documents all available options, their defaults, and how they affect agent behavior. For ready-made chains, see Common builder stacks.

MethodDefaultDescription
.withName(name)"agent"Agent identifier used in logs and metrics
.withProvider(provider)"test"LLM provider: "anthropic" | "openai" | "gemini" | "ollama" | "litellm" | "test"
.withModel(model)Provider defaultModel string or ModelParams (model, thinking?, temperature?, maxTokens?)
.withSystemPrompt(prompt)noneCustom system prompt prepended to all LLM calls
.withPersona(persona)noneStructured persona: { name?, role?, background?, instructions?, tone? }
.withEnvironment(context)noneExtra Record<string, string> merged into system prompt (beyond built-in date/tz/platform)
.withMaxIterations(n)10Maximum reasoning loop iterations before stopping
.withTimeout(ms)nonePer-execution timeout in milliseconds
.withStrictValidation()offMissing API keys / mismatches become build errors
.withRetryPolicy({ maxRetries, backoffMs })maxRetries: 0Transient LLM retries
.withErrorHandler(fn)noneObserve-only callback when run() fails
MethodDefaultDescription
.withReasoning(options?)disabledStrategies, ICS (synthesis, synthesisModel, …), strategy switching, adaptive, per-strategy bundles (may include e.g. kernelMaxIterations on reflexion). See Reasoning and Builder API
MethodDefaultDescription
.withTools(options?)disabled{ tools? (custom defs + Effect handlers), resultCompression?, allowedTools?, adaptive? }
.withDocuments(docs)noneDocumentSpec[] ingested at build for rag-search
.withRequiredTools(config)none{ tools?, adaptive?, maxRetries? }
.withMCP(config)noneMCP: { name, transport, command?, args?, endpoint?, headers?, env?, cwd? } (see Builder API transport table)
.withMetaTools(config?)on with toolsConductor suite; pass false to disable defaults
MethodDefaultDescription
.withCircuitBreaker(config?)off until setProvider circuit breaker (failureThreshold, cooldownMs, …)
.withRateLimiting(config?)off until setRPM / TPM / concurrency limits
.withModelPricing(registry)noneStatic $/1M token overrides
.withDynamicPricing(provider)noneFetch pricing at build
.withFallbacks(config)noneProvider/model chain + errorThreshold
.withCacheTimeout(ms)3_600_000Semantic cache TTL (1h)
MethodDefaultDescription
.withMemory(options?)disabledEnable memory. No args = standard tier. Options: { tier: "standard" | "enhanced" }
.withMemoryConsolidation(config?)disabledBackground memory intelligence: { threshold?, decayFactor?, pruneThreshold? }
.withExperienceLearning()disabledCross-agent tool-use pattern learning
MethodDefaultDescription
.withGuardrails(options?)disabledToggles: { injection?, pii?, toxicity? } (default true each when enabled), plus customBlocklist?
.withVerification(options?)disabledStrategy toggles + thresholds (passThreshold, hallucinationDetection, …)
.withKillSwitch()disabledPause / resume / stop / terminate
.withBehavioralContracts(contract)noneBehavioral contract passed to guardrails layer
MethodDefaultDescription
.withCostTracking(options?)disabledBudget enforcement (USD): { perRequest?, perSession?, daily?, monthly? }
.withContextProfile(profile)auto-detectedModel-adaptive context budgets / compaction — see Context engineering
MethodDefaultDescription
.withObservability(options?)disabled{ verbosity?, live?, file? (JSONL), logPrefix?, logModelIO? }
.withStreaming(options?)"tokens"Default agent.runStream() density: { density?: "tokens" | "full" }
.withTelemetry(config?){ mode: "isolated" } if enabledTelemetry privacy / contribute modes
.withLogging(config)noneStructured logs: level, format, output (console / file / stream), rotation
.withAudit()disabledCompliance audit logging
.withEvents()Wire EventBus for agent.subscribe()
MethodDefaultDescription
.withIdentity()disabledEd25519 agent certificates + RBAC
.withOrchestration()disabledMulti-agent workflow engine
.withInteraction()disabled5 autonomy modes + checkpoints
.withSelfImprovement()disabledCross-task strategy outcome learning
.withReactiveIntelligence(false)onPass false to disable entropy/controller/telemetry stack
.withReactiveIntelligence(options?)defaultsEntropy, controller, hooks, autonomy, constraints — see Reactive Intelligence
.withHealthCheck()disabledExposes agent.health()
MethodDefaultDescription
.withA2A(options?){ port: 3000 }Local A2A JSON-RPC server (port, basePath)
.withAgentTool(name, config)noneRegister a static sub-agent as a tool
.withDynamicSubAgents(options?)disabledAllow LLM to spawn sub-agents at runtime
.withRemoteAgent(name, url)noneConnect to a remote agent via A2A protocol
MethodDefaultDescription
.withGateway(options?)disabledPersistent autonomous harness: { heartbeat?, crons?, webhooks?, policies?, channels? }
MethodDefaultDescription
.withTestScenario(turns)noneDeterministic test provider. TestTurn[] from @reactive-agents/llm-provider; forces provider: "test".
.withLayers(layers)noneMerge custom Effect Layers into the runtime
.withSkills(config?)disabledLiving skills: paths, packages, evolution, overrides
.toConfig() / ReactiveAgents.fromConfig() / fromJSON()Agent as Data — round-trip via agentConfigToJSON / agentConfigFromJSON (reactive-agents or @reactive-agents/runtime)
agentFn / pipe / parallel / racePromise-based multi-agent composition (see Builder API)
agent.registerTool() / unregisterTool() / ingest()Runtime tool + RAG ingestion on built agents
VariableRequired ForDefaultDescription
ANTHROPIC_API_KEYAnthropic providerAnthropic API key
OPENAI_API_KEYOpenAI/LiteLLM providerOpenAI API key
GOOGLE_API_KEYGemini providerGoogle AI API key
TAVILY_API_KEYWeb search tool (primary)Tavily search API key
BRAVE_SEARCH_API_KEYWeb search tool (secondary)Brave Search API key (X-Subscription-Token); alias: BRAVE_API_KEY
EMBEDDING_PROVIDEREnhanced memory tier"openai"Embedding provider
EMBEDDING_MODELEnhanced memory tier"text-embedding-3-small"Embedding model name
LLM_DEFAULT_MODELAll providersProvider defaultOverride default model

These values have sensible defaults but are not currently configurable via the builder:

ValueDefaultWhereNotes
Max sub-agent iterations4packages/tools/src/Sub-agents capped at 4 iterations
Max recursion depth3packages/tools/src/Nested sub-agent limit
Parent context forwarding2000 charspackages/tools/src/Max parent context sent to sub-agents
Memory decay half-life7 dayspackages/memory/src/Episodic memory decay rate
Compaction trigger6 iterationspackages/reasoning/src/Steps before context compaction (local tier)