Skip to main content
The Python SDK runs tasks, registers skills and manages knowledge bases on agents that live on xpander. With it, an agent loop running in your own process uses the same approved skills as any other agent and leaves the same task record. The Vault attaches credentials at the moment of each call.

Core Architecture

The SDK is built around these modules:

Backend

Agents Backend - Get the arguments your agent loop (for example Agno) needs to run an agent.

Agents

Agents - List and load agents; read their skills and knowledge bases; start a task on one.

Tasks

Tasks - Create a task, stream its events, read its result and usage.

Skills Repository

Skills Integration - Register local skills, connect outside services, and manage skills served over MCP.

Knowledge Bases

Knowledge bases - Create a knowledge base, add documents, run a semantic search.

Events

Events - The @on_task, @on_boot and @on_tool_* decorators the task handler is built from.

Installation

Key Features

  • 🤖 Agent Access: List and load agents, and work with their skills, sessions, database, and knowledge bases. Creating, updating, and deleting agents is done through the REST API or Xpander Chat
  • ⚡ Task Execution: Handle complex multi-step workflows with real-time event streaming
  • 🔧 Skills Integration: Register local skills and connect outside services via MCP
  • 📚 Knowledge Bases: Semantic search across document repositories
  • 🎯 Event-Driven: Event handling with decorators for responsive agent applications
  • 🔄 Async/Sync Support: Both asynchronous and synchronous interfaces for flexibility
  • 📊 Real-time Monitoring: Track agent performance, metrics, and execution in real-time
  • 🏗️ Modular Architecture: Independent modules that work together

Quick Start Example

Asynchronous Usage

Synchronous Usage

Event-Driven Development

The SDK supports event-driven programming with decorators for task handling and lifecycle management:

Asynchronous Usage

Synchronous Usage

Lifecycle Management

Module Documentation

Agents Module

Load, run and manage agents, with their skills and knowledge bases

Tasks Module

Create, stream, stop and read tasks

Skills Repository

Local skill registration, outside services, and skills served over MCP

Knowledge Bases

Documents in, semantic search out

Events Module

The decorators the task handler is built from

Configuration

Configuration: API key, organization id, base URL, self-hosted endpoints

Types

Data types, enumerations, and models used across the SDK

Authentication

Credentials reach the SDK one of these ways:

Error Handling

Additional Resources

Getting Started

Begin building with xpander.ai

Quickstart

Step-by-step guide to a first agent

GitHub Repository

View source code and contribute