xpander-sdk
Agent
Agent class API reference for the xpander SDK
Agent Class
The Agent
class is the central component of the xpander SDK, representing an AI agent with capabilities for task execution, tool usage, and state management.
Retrieving an Agent
Parameter | Type | Required | Description |
---|---|---|---|
agent_id | string | Yes | ID of the agent |
Returns: Agent
instance
Agent Properties
Core Properties
Property | Type | Description | Availability |
---|---|---|---|
id | string | Unique identifier for the agent | Always available |
name | string | Name of the agent | Always available |
instructions | object | System instructions for the agent | Always available |
metadata | object | Contains metadata like description | Always available |
execution | Execution | Current execution context | After adding a task |
messages | List[Dict] | Conversation messages array | After initialization |
graph | Graph | Workflow graph system | Always available |
tool_choice | string | Setting for tool selection behavior | Always available |
Configuration Properties
Property | Type | Description |
---|---|---|
memory_type | MemoryType | Type of memory (e.g., SHORT_TERM) |
memory_strategy | MemoryStrategy | Strategy for memory management (e.g., FULL) |
end_tool_enabled | boolean | Whether automatic task ending is enabled |
has_local_tools | boolean | Whether agent has local tools attached |
access_scope | AgentAccessScope | Access scope (e.g., ORGANIZATIONAL) |
delegation_type | AgentDelegationType | Delegation type (e.g., ROUTER) |
knowledge_bases | List | Connected knowledge bases |
organization_id | string | ID of the organization owning the agent |
Agent Core Methods
update() / update()
Updates agent properties on the server.
Returns: Updated Agent
object
sync() / sync()
Synchronizes changes to the agent (operations, graph connections, etc.)
Returns: Updated Agent
object
disable_agent_end_tool() / disableAgentEndTool()
Disables the automatic task completion tool, giving more control over when a task ends.
Returns: void
update_user_details() / updateUserDetails()
Updates user details associated with the agent.
Parameter | Type | Required | Description |
---|---|---|---|
user_details | object | Yes | User information |
Returns: void
retrieve_node_from_graph() / retrieveNodeFromGraph()
Retrieves a node from the agent’s graph by its ID.
Parameter | Type | Required | Description |
---|---|---|---|
item_id | string | Yes | ID of the graph node |
Returns: GraphItem
object or undefined
if not found