Skip to main content

Lifecycle

new

Create a new agent with the specified parameters. Parameters
str
required
The name of the agent.
LlmInfo
required
Configuration for the language model to use. See LlmInfo.
Optional[list[Tool]]
default:"None"
List of tools available to the agent. See Tool.
Optional[str]
default:"None"
Instructions for the agent.
Optional[Dict[str, IoConfig]]
default:"None"
Dictionary mapping input names to their configurations. See IoConfig.
Optional[Dict[str, IoConfig]]
default:"None"
Dictionary mapping output names to their configurations. See IoConfig.
Optional[AgentType]
default:"None"
The type of agent (FUNCTIONAL or CONVERSATIONAL). See AgentType.
Optional[AgentType]
default:"None"
Alias for agent_type. See AgentType.
Optional[MemoryConfig]
default:"None"
Memory configuration (conversational agents only). See MemoryConfig.
Returns
Agent
A new Agent instance.
Raises
exception
If the agent creation fails.

save

Save the agent with its current configuration. Updates the agent on the server with the current name, LLM configuration, tools, instructions, inputs and outputs.

deploy=True vs deploy=False — the branch model

Think of an agent like a Git repo:
  • Working tree — the Agent object in your Python process. Mutations like add_tool, remove_tool, or reassigning instructions happen here.
  • Main branch — the branch_id on the server. save(deploy=False) writes your working tree to this branch as a new commit. Anything reading by branch_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.
Bumping versions (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 with bump=True + description=... for a labelled version).
Parameters
bool
default:"False"
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).
bool
default:"False"
When True (only meaningful with deploy=True), creates a new tagged version on deploy so consumers can pin to it.
Optional[str]
default:"None"
Updates the agent description; also used as the changelog when bumping a version.
Returns
dict
dict: A dictionary containing the status of the save operation.
Raises
exception
If the agent update fails.

fetch

Fetches an existing agent. Parameters
Optional[str]
default:"None"
The unique identifier of the agent to fetch.
Optional[str]
default:"None"
The name of the agent to fetch.
Optional[str]
default:"None"
The username of the agent owner.
Optional[str]
default:"None"
The organization name of the agent owner.
Returns
Agent
Agent: The fetched Agent instance.
Raises
exception
If neither id nor name is provided.
exception
If the agent couldn’t be fetched.

list

List agents for the authenticated user. Parameters
int
default:"50"
Maximum number of agents to return.
int
default:"0"
Number of agents to skip.
bool
default:"False"
Whether to include agents shared with the user.
Returns
list[Agent]
list[Agent]: List of Agent instances (or lightweight stubs with id only if the server returns object_ids without full objects).

delete

Deletes an existing agent. Returns
dict
dict: A dictionary containing the status of the deletion operation.
Raises
exception
If the agent couldn’t be deleted.

Tools

tools

The list of tools currently attached to this agent. Mutated in place by add_tool / remove_tool (and by direct agent.tools = [...] assignment). Persisted to the platform on the next agent.save().

add_tool

Fluent adder for attaching tools to an agent instance. Every entry in the platform tool catalogue is reachable as a method — agent.add_tool.<tool_type>(...). Each factory call requires a non-empty tool_name= (the LLM-facing name, unique within the agent) — omitting it raises ValueError. The call mutates agent.tools in place; persist with agent.save() afterwards.

AgentTools catalogue

Class-level namespace exposing every tool in the platform catalogue — currently 261 tools including web search (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. Every AgentTools.<tool_type>(...) factory requires a non-empty tool_name= (unique within the agent); omitting it raises ValueError. Two invocation patterns:
The full catalogue is generated from the platform’s tool registry and ships as a typed .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 the instructions for the agent. Parameters
str
required

update_llm_info

Update the LLM configuration for the agent. Parameters
LlmInfo
required
See LlmInfo.

remove_tool

Remove a tool by instance, name, or tool_type. Parameters
Union[Tool, str]
required
See Tool.

Running

run

Run the agent. Dispatches on :attr: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. Pass session_id to resume an existing session for one turn; pass keep_alive=True to keep a hidden session reachable across calls. include_deltas=False (default) drops MESSAGE_DELTA events from result.events so long turns don’t bloat the result; pass True to keep them for debugging — final_message is 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.
Parameters
Any
default:"None"
Optional[str]
default:"None"
Optional[Sequence[Union[Path, bytes, io.IOBase]]]
default:"None"
Optional[str]
default:"None"
bool
default:"False"
bool
default:"False"
Returns
Union[AgentRunResult, Coroutine[Any, Any, ConversationalAgentRunResult]]
Raises
exception
If the call shape does not match the agent type.
exception
If the conversational turn requires approval/reauth — use :meth:create_session or :meth:resume_session to handle it.

Sessions

create_session

Create a real-time session for this conversational agent. Parameters
Optional[str]
default:"None"
Optional session ID to resume an existing session.
Returns
Session
Session: A Session instance (not yet connected; use as async context manager).
Raises
exception
If agent is functional (use run() instead).

resume_session

Resume an existing session by ID. Parameters
str
required
The session ID to reconnect to.
Returns
Session
Session: A Session instance (not yet connected; use as async context manager).
Raises
exception
If agent is functional or session_id is empty.

Serialization

from_json

Create an agent instance from a JSON dictionary. Parameters
dict
required
Returns
Agent

serialize_inputs

Parameters
dict[str, Any]
required
Returns
dict[str, Any]

Types

Configuration objects, response shapes, and enums used by the methods above.

AgentType

Members
  • FUNCTIONAL = "functional"
  • CONVERSATIONAL = "conversational"

LlmInfo

Fields
str
required
str
required
Optional[str]
Optional[str]
Optional[str]
Optional[str]
bool
default:"False"
bool
default:"True"
bool
default:"False"
bool
default:"False"
bool
default:"True"
bool
default:"False"
Optional[vectorshift.agent.object.DetectPii]
Optional[str]
Optional[int]
Optional[int]

IoConfig

Fields
str
required
Optional[str]
default:"''"
Optional[str]

MemoryConfig

MemoryConfig(enable_session_memory: ‘bool’ = True, enable_global_memory: ‘bool’ = False) Fields
bool
default:"True"
bool
default:"False"

AgentRunResult

AgentRunResult(outputs: ‘dict[str, Any]’, run_id: ‘str’, status: ‘str’, error: ‘Optional[str]’ = None) Fields
dict[str, Any]
required
str
required
str
required
Optional[str]

Tool

ToolInput

Fields
str
default:"'static'"
Optional[Any]
Optional[str]

ToolInputType

Members
  • STATIC = "static"
  • DYNAMIC = "dynamic"

ToolApprovalConfig

Members
  • AUTO_RUN = "auto_run"
  • LET_AGENT_DECIDE = "let_agent_decide"
  • REQUIRES_APPROVAL = "requires_approval"