Lifecycle
new
The name of the agent.
Instructions for the agent.
Dictionary mapping input names to their configurations. See
IoConfig.Dictionary mapping output names to their configurations. See
IoConfig.The type of agent (FUNCTIONAL or CONVERSATIONAL). See
AgentType.Memory configuration (conversational agents only). See
MemoryConfig.A new Agent instance.
If the agent creation fails.
save
deploy=True vs deploy=False — the branch model
Think of an agent like a Git repo:
- Working tree — the
Agentobject in your Python process. Mutations likeadd_tool,remove_tool, or reassigninginstructionshappen here. - Main branch — the
branch_idon the server.save(deploy=False)writes your working tree to this branch as a new commit. Anything reading bybranch_id(the platform editor, your own dev/test code) immediately sees the change. - Deployed version — what callers of the published agent get. Chatbots, interfaces, pipelines that reference the agent by id-without-version, and the platform’s “Run published” button all read this version.
save(deploy=True)promotes the current main-branch state to be the new deployed version.
bump=True) attaches a tagged release to the deploy so consumers can pin to a specific build instead of always tracking the latest deployed.
In practice:
- Iterating on prompts/tools?
save(deploy=False)— fast, no production fallout. - Ready for users?
save(deploy=True)(optionally withbump=True+description=...for a labelled version).
When
True, promotes the saved state to be the new deployed version that callers of the published agent will hit. When False, only updates the working/main branch — the deployed version is untouched until the next save(deploy=True).When
True (only meaningful with deploy=True), creates a new tagged version on deploy so consumers can pin to it.Updates the agent description; also used as the changelog when bumping a version.
dict: A dictionary containing the status of the save operation.
If the agent update fails.
fetch
The unique identifier of the agent to fetch.
The name of the agent to fetch.
The username of the agent owner.
The organization name of the agent owner.
Agent: The fetched Agent instance.
If neither id nor name is provided.
If the agent couldn’t be fetched.
list
Maximum number of agents to return.
Number of agents to skip.
Whether to include agents shared with the user.
list[Agent]: List of Agent instances (or lightweight stubs with id only
if the server returns object_ids without full objects).
delete
dict: A dictionary containing the status of the deletion operation.
If the agent couldn’t be deleted.
Tools
tools
add_tool / remove_tool (and by direct agent.tools = [...] assignment). Persisted to the platform on the next agent.save().
add_tool
agent.add_tool.<tool_name>(...). The call mutates agent.tools in place; persist with agent.save() afterwards.
AgentTools catalogue
exa_ai, google_search, perplexity), knowledge & retrieval (knowledge_base, deep_research, parallel_ai_search), code & data (code_interpreter, dataframe_get_schema, dataframe_raw_query), media (ai_text_to_image, ai_image_to_text, ai_text_to_speech), integrations (integration_* for every connected service), pipelines, transformations, and more.
Two invocation patterns:
.pyi stub (vectorshift/agent/agent_tools.pyi) — your editor’s autocomplete is the canonical browseable catalogue. The conversational-agent-tools example and tool-approval-config example show the most common entries end-to-end.
Configuration
update_instructions
update_llm_info
remove_tool
Running
run
agent_type:
- Functional —
agent.run(inputs=\{...\})runs synchronously and returns an :class:AgentRunResult. - Conversational (experimental) —
await agent.run("...")opens a hidden session, posts one turn, waits for the final message, and returns a :class:ConversationalAgentRunResult. Passsession_idto resume an existing session for one turn; passkeep_alive=Trueto keep a hidden session reachable across calls.include_deltas=False(default) dropsMESSAGE_DELTAevents fromresult.eventsso long turns don’t bloat the result; passTrueto keep them for debugging —final_messageis unaffected either way. The primary supported path for conversational agents is still :meth:create_session; this is a convenience wrapper for ask-once-and-wait flows.
See
AgentRunResult.If the call shape does not match the agent type.
If the conversational turn requires approval/reauth — use :meth:
create_session or :meth:resume_session to handle it.Sessions
create_session
Optional session ID to resume an existing session.
Session: A Session instance (not yet connected; use as async context manager).
If agent is functional (use run() instead).
resume_session
The session ID to reconnect to.
Session: A Session instance (not yet connected; use as async context manager).
If agent is functional or session_id is empty.
Serialization
from_json
serialize_inputs
Types
Configuration objects, response shapes, and enums used by the methods above.AgentType
Members
FUNCTIONAL="functional"CONVERSATIONAL="conversational"
LlmInfo
Fields
IoConfig
Fields
MemoryConfig
MemoryConfig(enable_session_memory: ‘bool’ = True, enable_global_memory: ‘bool’ = False)
Fields
AgentRunResult
AgentRunResult(outputs: ‘dict[str, Any]’, run_id: ‘str’, status: ‘str’, error: ‘Optional[str]’ = None)
Fields
Tool
ToolInput
Fields
ToolInputType
Members
STATIC="static"DYNAMIC="dynamic"
ToolApprovalConfig
Members
AUTO_RUN="auto_run"LET_AGENT_DECIDE="let_agent_decide"REQUIRES_APPROVAL="requires_approval"
