The xpander.ai SDK is a typed Python client for the xpander.ai platform. It exposes six core modules (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.
Backend, Agents, Tasks, ToolsRepository, KnowledgeBases, Events), plus a set of decorators (@on_task, @on_boot, @on_shutdown, @on_auth_event, @on_tool_*, @register_tool) for wiring your code into the agent runtime.
Every method comes in two flavors: an async coroutine (e.g. aget, acreate_task) and a synchronous wrapper (get, create_task). Use the async forms in production; sync wrappers are convenient for scripts and notebooks.
Install
For Agno (the recommended framework), install the optional extras:
Authenticate
The SDK reads credentials from environment variables by default:Configuration explicitly and pass it into any module:
Initialize and call
Backend.aget_args() to resolve framework-specific kwargs from a stored agent configuration:
Async vs sync
Every coroutine has a sync sibling: same parameters, blocks until complete:| Async | Sync |
|---|---|
agents.aget(...) | agents.get(...) |
agent.acreate_task(...) | agent.create_task(...) |
task.aevents() | task.events() |
tools.aload_tool_by_id(...) | tools.load_tool_by_id(...) |
async def and call with await. Sync wrappers internally call run_sync(), so don’t call them from inside an existing event loop (FastAPI, asyncio scripts): use the a* form there.
Self-hosted
Pointbase_url at your Agent Controller endpoint and use the API key generated during your Helm install:
agent-controller in the host or port 9016) and prefixes paths with the organization ID. See the Configuration reference for details.
Where to next
Backend
Resolve framework args, invoke agents directly, report external runs.
Agents
List, load, and interact with agents.
Tasks
Create, stream, and inspect task executions.
Decorators
@on_task, @on_boot, @on_shutdown, and tool hooks.
