Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt

Use this file to discover all available pages before exploring further.

Agent is the rich object returned by Agents.aget() and AgentsListItem.aload(). It carries the agent’s full stored configuration, plus methods for creating tasks, invoking tools, and managing sessions.
from xpander_sdk import Agents

agent = await Agents().aget("agent-123")
print(agent.name)
print(agent.model_provider, agent.model_name)
print(agent.deployment_type.value)        # "serverless" or "container"
print(len(agent.tools.list))

Class methods

Agent.aload(agent_id, configuration=None, version=None) -> Agent

Load an agent by ID. This is what Agents.aget() calls internally. Use the module-level agents.aget(...) in normal code; Agent.aload(...) is for places where you have a Configuration but no Agents instance.
from xpander_sdk import Agent, Configuration

config = Configuration(api_key="...", organization_id="...")
agent = await Agent.aload(agent_id="agent-123", configuration=config)
ParameterTypeRequiredDefaultDescription
agent_idstrYesAgent to load.
configurationConfigurationNoNoneSDK config. Uses defaults if omitted.
versionintNoNoneSpecific version. Latest if omitted.
The sync sibling is Agent.load(...).

Attributes

AttributeTypeDescription
idstrAgent identifier.
organization_idstrOwning organization.
namestrDisplay name.
descriptionstr | NoneLong description.
unique_namestrURL-safe slug.
iconstrEmoji or icon. Defaults to "🚀".
statusAgentStatusDRAFT, ACTIVE, or INACTIVE.
versionintLoaded version.
created_bystr | NoneCreator user id.
created_atdatetime | NoneCreation timestamp.
access_scopeAgentAccessScopePersonal or Organizational.
typeAgentType | NoneManager, Regular, A2A, Curl, Orchestration.
frameworkFrameworkAlways Agno today. Other values reserved.
deployment_typeAgentDeploymentTypeServerless or Container.
instructionsAgentInstructionsrole: list[str], goal: list[str], general: str.
graphAgentGraphExecution graph (source nodes, tools, sub-agents, MCP).
toolsToolsRepositoryRepository of attached tools. See Tools Repository.
knowledge_baseslist[AgentKnowledgeBase]Linked knowledge bases (id pointers).
model_providerstre.g. "openai", "anthropic", "bedrock".
model_namestre.g. "gpt-4o", "claude-sonnet-4".
llm_reasoning_effortLLMReasoningEffortLow, Medium, or High.
llm_api_basestr | NoneOverride for the LLM endpoint (Bedrock / Azure / Ollama).
llm_extra_headersdict[str, str]Extra headers for LLM calls.
output_formatOutputFormatDefault output format.
output_schemadict | NoneDefault JSON schema (used when output_format == Json).
expected_outputstrDescription of the expected output.
agno_settingsAgnoSettingsMemory, tool-call limits, guardrails, reasoning settings.
webhook_urlstr | NoneConfigured webhook for completed tasks.
connectivity_detailsAIAgentConnectivityDetailsA2A | AIAgentConnectivityDetailsCurl | dictWire details for A2A and Curl agent types.
voice_idstr | NoneVoice ID for OutputFormat.Voice.
task_level_strategiesTaskLevelStrategies | NoneRetry / iterative / stop strategies and per-day caps.
orchestration_nodeslist[OrchestrationNode]Sub-nodes for orchestration agents.
notification_settingsNotificationSettingsAlerting config.
use_oidc_pre_authboolWhether the agent uses OIDC pre-auth tokens.
pre_auth_audienceslist[str]OIDC audiences for pre-auth.
using_nemoboolWhether NeMo is in use.
deep_planningboolWhether deep planning is enabled.
enforce_deep_planningboolStrict plan enforcement.
llm_credentialsLLMCredentials | NonePer-agent LLM credentials, if overridden.

Computed properties

PropertyTypeDescription
mcp_serverslist[MCPServerDetails]MCP servers configured in the graph.
outputAgentOutputResolved output configuration (Pydantic schema, markdown flag, JSON-mode flag).
search_knowledgeboolTrue when the agent has at least one linked knowledge base.
is_a_teamboolTrue when the agent has sub-agents (Manager / Team mode).
is_activeboolagent.status == AgentStatus.ACTIVE.
sanitized_namestrname munged to a valid Python identifier.
strands_toolslistStrands-formatted tool wrappers.
openai_agents_sdk_toolslistOpenAI Agents SDK-formatted tool wrappers.

Instance methods

MethodReference
acreate_task / create_taskCreate a task
ainvoke_tool / invoke_toolInvoke a tool
aget_knowledge_bases / get_knowledge_basesKnowledge bases
attach_knowledge_baseKnowledge bases
knowledge_bases_retrieverKnowledge bases
aget_db / get_dbSessions
aget_user_sessions / get_user_sessionsSessions
aget_session / get_sessionSessions
adelete_session / delete_sessionSessions

Streaming spec

agent.aget_streaming_spec() -> StreamingSpecResponse: returns the deployed agent’s streaming URL and an API key for the container’s /invoke endpoint. Useful when you want to bypass the SSE channel and POST directly to a deployed worker.
spec = await agent.aget_streaming_spec()
print(spec.url)        # https://<agent>.containers.xpander.ai/invoke
print(spec.api_key)    # auth token for the /invoke endpoint
StreamingSpecResponse has two fields: url (str | None) and api_key (str | None). Both can be None if the agent isn’t deployed yet.

Connection string

agent.aget_connection_string() -> DatabaseConnectionString: returns DB connection details for agents using session storage. The result is cached on the instance after the first call.
conn = await agent.aget_connection_string()
print(conn.connection_uri.uri)
DatabaseConnectionString has id, name, organization_id, and connection_uri.uri (a Postgres-compatible URI).

sync_local_tools

await agent.sync_local_tools(tools=[...]): pushes locally-decorated @register_tool(add_to_graph=True) tools to the platform’s graph. Called automatically when Agent.aload detects unsynced tools, so you rarely need to invoke it directly.