Skip to content

Documentation navigation

Upgrading to the mAIvn SDK 3.0

Update from SDK 2.x: the settings that were removed, the ones that now take effect, and what to check before you deploy.

#Upgrading to the mAIvn SDK 3.0

SDK 3.0 removes every setting that was accepted and had no effect, and it wires five settings to the controls they always named. A removed name now fails instead of being ignored. Nothing else about the platform API changes. The package name is still maivn. This page covers what was removed, what now works, what changed and what to check before you deploy.

#Who needs to do anything

Everyone who moves from 2.x. Upgrade the package, then run your tests. A removed setting fails the first time your code uses it, so a test run finds every one. If you pass Agent or Swarm fields by position, read Positional arguments first. If you set a tool timeout, read Defaults that changed.

#1. Upgrade

Shell
python -m pip install -U maivn

In a uv project:

Shell
uv add maivn -U

SDK 3.x requires Python 3.10 or newer, the same as 2.x.

#2. Settings that now work

Five settings did nothing in 2.x or were missing. They now reach real controls.

SettingWhat it does now
tool_execution_timeoutSent as each tool's timeout. A tool that runs longer ends with a timeout, and the value also bounds how long a human-approval tool can wait. The default is 600 seconds. Values above 600 are sent as 600.
Agent.close() and Swarm.close()Release what the scope opened. Agent.close() stops the agent's own MCP servers (they start again on next use) and releases the connection pools of a client the agent created. Swarm.close() releases the pools of a client the swarm created. Neither closes a Client you passed in, and Swarm.close() does not close member agents. Both are safe to call twice.
Per-call allow_private_in_system_toolsWins over the scope's value and over system_tools_config.allow_private_data. None keeps the scope's value.
MemoryRetrievalConfig.insight_relevance_floorSent as the recall similarity floor, from 0 to 1. It is a floor over recalled memory (skills, insights and resources that are not bound to the scope), and resources you bind explicitly stay available. This differs slightly from v1, where the value was a relevance score on each insight.
max_cycles (new)Caps a run's model-loop cycles, from 1 to 1000. Set it on Agent(...) or Swarm(...) (keyword-only), on RunOptions, or on invoke, ainvoke, stream, astream and the time-travel streams. A per-call value beats RunOptions, which beats the scope. The platform never runs more than 20 cycles, so it uses the smaller of your value and 20. It is not RunConfig.recursion_limit, which limits delegation depth.
Python
from maivn import Agent, MemoryConfig, MemoryRetrievalConfig

agent = Agent(
    name='assistant',
    api_key='your-api-key',
    max_cycles=8,
    memory_config=MemoryConfig(
        retrieval=MemoryRetrievalConfig(insight_relevance_floor=0.7),
    ),
)

try:
    response = agent.invoke('Summarize the open tickets.', max_cycles=4)
finally:
    agent.close()

#Platform release requirement

max_cycles and insight_relevance_floor each require a platform release that supports them. max_cycles needs one that accepts RunConfig.max_cycles, and insight_relevance_floor needs one that accepts memory.retrieval.minimum_similarity. Against an older platform, setting either one makes the request fail with a validation error. Both are sent only when you set them, so leaving them unset works everywhere. tool_execution_timeout, close() and the per-call private-data switch need no platform change.

#3. Defaults that changed

SettingSDK 2.xSDK 3.0
tool_execution_timeout (on Client and ClientConfig)900 seconds, never sent; every tool got 600 seconds600 seconds, sent as each tool's timeout
execution.tool_execution_timeout_seconds (in MaivnConfiguration)30 seconds600 seconds

ClientConfig.tool_execution_timeout is now a float and is never None. Tools already ran under a 600-second limit in 2.x, so the default changes nothing at run time; what is new is that a lower value you set now takes effect. No value above 600 is honored.

#4. Positional arguments on Agent and Swarm

Agent lost two dataclass fields, max_results and orchestration_config, so the fields after them moved. Code that passes Agent fields after timeout by position must switch to keywords:

  • model was the 9th positional parameter and is now the 8th.
  • Fields after system_tools_config move two places.

Swarm lost orchestration_config, so the fields after system_tools_config move one place earlier. max_cycles is keyword-only on both classes.

Pass every field after timeout by keyword, for example Agent(name='assistant', api_key='your-api-key', model='auto').

#5. Unknown fields are now refused

MaivnConfiguration and its sections, MCPServer and MCPAutoSetup used to ignore a field they did not know. They now refuse it. A misspelled or removed field raises a validation error naming the field, with Extra inputs are not permitted.

#6. How removed names fail

Where the name was usedWhat you see
A keyword on Agent(...), Swarm(...), Client(...), ClientConfig.from_sources(...), the from_environment builders, invoke, ainvoke, stream, astream, the time-travel streams or the structured-output builderTypeError: <Owner>() no longer accepts 'name' (removed in maivn 3.0.0), followed by what to use instead. astream raises at the call, before you iterate.
A model field (ClientConfig, RunOptions, the memory configs, MaivnConfiguration sections, MCPServer, MCPAutoSetup)pydantic ValidationError. A known removed name carries the same message and replacement. Any other unknown field fails with Extra inputs are not permitted.
An import of a removed classImportError on from maivn import X
max_cycles out of rangeValueError on Agent, Swarm and call keywords, and ValidationError on RunOptions

#7. Removed settings and what to use instead

RemovedUse instead
max_results (Agent, RunOptions)No replacement.
orchestration_config (on Agent, Swarm, RunOptions, every run call and the structured-output builder), SessionOrchestrationConfig, resolve_orchestration_config(), and the aliases OrchestrationMode, FinalOutputMode and StopStrategymax_cycles for the cycle cap, and @depends_on_reevaluate to re-run a tool. No replacement for the other fields.
dependency_wait_timeout, total_execution_timeout (on Client, ClientConfig, ClientConfig.from_sources(), both from_environment() builders and RunOptions), the matching Client properties, and execution.dependency_wait_timeout_seconds and execution.total_execution_timeout_seconds in MaivnConfigurationFor a run time limit, run the work as a hosted job with HostedJobOptions(max_duration_seconds=...).
Per-call metadata on invoke, ainvoke, stream, astream and the structured-output builderNo replacement. It was never sent.
SessionExecutionConfig, SwarmConfig, SwarmAgentConfig, StructuredOutputConfig, MemoryAssetsConfig, MemorySkillConfig, MemoryResourceConfigNo replacement. The SDK never built or sent them.
MemoryConfig.summarization_enabledNo replacement.
MemoryRetrievalConfig.candidate_limitNo replacement.
MemorySkillExtractionConfig.confidence_thresholdNo replacement.
sharing_scope on MemorySkillExtractionConfig and MemoryInsightExtractionConfigNo replacement.
MemoryInsightExtractionConfig.min_relevance_scoreretrieval.insight_relevance_floor filters what recall returns.
MaivnConfiguration: server.mock_base_url, server.max_retries, execution.pending_event_timeout_seconds, execution.enable_background_execution, execution.max_parallel_toolsNo replacement.
server.deployment_timezoneSet the MAIVN_DEPLOYMENT_TIMEZONE environment variable, which the client already sends.
execution.default_timeout_secondsserver.timeout_seconds.
The whole logging section of MaivnConfiguration and LoggingConfiguration (level, format_string, enable_timing_logs)maivn.configure_logging() or the standard logging module. See Logging.
MCPServer.tool_overrides, ToolOverride, MCPServer.resolve_tool_override(), MCPServer.raise_on_tool_error, MCPServer.soft_error_handling and MCPSoftErrorHandlingNo replacement. Wrap a tool in your own function to rename it or reshape its output.
MCPAutoSetup.working_dirMCPServer.working_dir.

#8. Other changes to check

  • Run starts and answers wait at the concurrent-job limit. When your team already has as many runs in progress as its plan allows, the SDK now waits and sends the same start, or the same answer to a paused run, again for up to 60 seconds before it raises the new ConcurrentJobsLimitError. Set concurrent_jobs_wait_seconds on Client or ClientConfig to change the wait, or 0 to get the error at once. See Concurrent jobs.
  • Private SDK paths. Code that imported SessionOrchestrationConfig from a private maivn._internal module breaks. Import only names that maivn exports.
  • Copied examples. Remove summarization_enabled, candidate_limit, orchestration_config and soft_error_handling from copied code.

Run your test suite against SDK 3.x before you deploy.

#Next steps