Skip to main content

AgentixAgentOptions

The single configuration object for all agent behavior. Pass it to query() or AgentixClient().

from agentix import AgentixAgentOptions

options = AgentixAgentOptions(
name="my-agent",
provider="anthropic",
model="claude-sonnet-4-20250514",
system_prompt="You are a helpful assistant.",
)

Identity & LLM

FieldTypeDefaultDescription
agent_idstrAuto UUIDUnique agent identifier
namestr"agent"Agent display name
providerstr"anthropic"LLM backend: "anthropic", "openai", "openai_compatible", "gemini", "deepseek"
modelstr | NoneAutoModel identifier; auto-filled from provider defaults
fallback_modelstr | NoneNoneFallback model if primary fails after all retries
system_promptstr""System prompt
llm_optionsdict{}Extra kwargs for the LLM client (e.g. api_key, base_url). base_url only used by openai_compatible and deepseek providers.
key_providerCallable[[], str] | NoneNoneCalled before each LLM request to return a fresh API key
betaslist[str][]API beta feature flags

Default models:

ProviderDefault model
anthropicclaude-sonnet-4-20250514
openaigpt-4o
openai_compatiblegpt-oss-120b
geminigemini-2.5-flash
deepseekdeepseek-chat

Execution Limits

FieldTypeDefaultEnv OverrideDescription
max_tokensint4096Max tokens per LLM response
max_iterationsint20Max agent loop iterations
tool_timeoutfloat120.0AGENTIX_TOOL_TIMEOUTSeconds before a tool call is killed
web_fetch_timeoutfloat15.0AGENTIX_WEB_FETCH_TIMEOUTHTTP timeout for web tools
script_timeoutfloat30.0AGENTIX_SCRIPT_TIMEOUTSubprocess timeout
mcp_connect_timeoutfloat60.0AGENTIX_MCP_CONNECT_TIMEOUTMCP server handshake timeout
max_context_tokensint16384Token budget; older messages are summarized when exceeded
max_tokens_budgetint | NoneNoneHard stop when total usage exceeds this
effortstr | NoneNone"low", "medium", "high", "max" — thinking effort

Memory & Persistence

FieldTypeDefaultDescription
conversation_summarization_enabledboolTrueSummarize old messages when the context window fills up; False = drop them instead
max_conversation_windowint10Recent messages always kept verbatim before summarization
memories_enabledboolFalseRegister the Memories tool at <cwd>/.agentix/memories; when allowed_tools is non-empty, Memories is also appended automatically unless denied
persistence_enabledboolTruePersist sessions to disk
storage_base_pathstr~/.agentix/projectsSession storage directory
storage_backendStorageBackend | NoneNoneCustom storage backend
enable_file_checkpointingboolFalseReserved — not yet implemented; rewind_files() raises NotImplementedError

Resilience

FieldTypeDefaultDescription
retry_max_attemptsint3Max LLM call retries on transient failures
retry_base_delayfloat1.0Initial retry delay (seconds, doubles each attempt)
retry_max_delayfloat30.0Max retry delay cap
circuit_breaker_failure_thresholdint5Consecutive failures that trip the circuit breaker; 0 = disabled
circuit_breaker_cooldownfloat60.0Seconds before a tripped circuit allows a probe

Sessions

FieldTypeDefaultDescription
resumestr | NoneNoneResume a specific session by ID
continue_conversationboolFalseAuto-resume the most recent session
fork_sessionboolFalseFork the session (copy to new ID)

continue_conversation and fork_session cannot both be True — raises ConfigurationError.

Tools & Permissions

FieldTypeDefaultDescription
allowed_toolslist[str][]Tool allow-list (empty = allow all)
disallowed_toolslist[str][]Tool deny-list (always overrides allow-list)
toolslist[str] | dict[]Alias for allowed_tools
permission_modestr"default"Permission mode
can_use_toolcallbackNoneAsync permission callback
permission_prompt_tool_namestr | NoneNoneTool name for inline permission prompts

Environment & Workspace

FieldTypeDefaultDescription
cwdstr | NoneNoneWorking directory (None → process cwd)
add_dirslist[str | Path][]Extra directories to add to tool path
envdict[str, str]{}Extra environment variables for subprocesses
env_pass_throughlist[str][]Ambient env vars forwarded to subprocesses
strict_envboolFalseStart subprocesses from minimal platform-safe env
sandboxSandboxSettings | NoneNoneSandbox mode and network restrictions

Queuing & Streaming

FieldTypeDefaultDescription
max_queue_sizeint | NoneNoneMax buffered messages; None = unlimited
include_partial_messagesboolFalseYield StreamEvent partial tokens
output_formatdict | NoneNoneStructured output JSON schema
userstr | NoneNoneEnd-user identifier forwarded to the LLM API

Thinking & Extended Reasoning

FieldTypeDefaultDescription
thinkingdict | NoneNone{"enabled": true, "budget_tokens": 10000} for Anthropic
effortstr | NoneNoneShorthand: low=2k, medium=5k, high=10k, max=32k tokens

Multi-Agent

FieldTypeDefaultDescription
agentsdict[str, AgentDefinition] | NoneNoneSub-agent definitions
is_sub_agentboolFalseMark as sub-agent
strict_agent_validationboolFalseRaise on invalid definitions (recommended for CI)

Extension Points

FieldTypeDefaultDescription
hooksdict[str, list]{}Hook matchers keyed by event name
pluginslist[dict][]Plugin directory configs
mcp_serversdict[str, Any]{}MCP server configs
setting_sourceslist[str]["user", "project", "local"]JSON config layers to load
settingsdict{}Inline JSON overrides
trusted_plugin_pathslist[str][]Plugin paths bypassing hash verification