Tutorial Summary

  • Goal: Build a Travel & Expense Assistant powered by Xpander.ai + Agno
  • Estimated Time: 25–35 minutes
  • Prerequisites: Python 3.12+, Xpander SDK, Agno framework, required API keys (Slack, Aviationstack, Nebius/OpenAI)

Frameworks like Agno have made it easier than ever to create AI agents. Yet, for enterprise engineering teams, accessibility is only the beginning. The real challenge and opportunity lies in deploying production-grade, autonomous assistants that can orchestrate complex business workflows, integrate logically with diverse enterprise systems, and scale reliably across thousands of users, all while minimising backend complexity and operational overhead.

Here Xpander.ai comes in!

Xpander.ai helps companies move from prototypes to quickly create reliable agents that run in real-time, automate tasks, and facilitate secure, multi-user collaboration. With one API-first platform that does away with infrastructure headaches, teams can turn their attention to innovation and business logic.

To help you visualise how Xpander.ai works, we will be building a Travel & Expense Assistant using Xpander.ai and the Agno Framework. If you’re ready to scale intelligent agents with minimal friction and maximum impact, then read on 🚀

🗺️ Xpander.ai: An Overview

Xpander.ai is an enterprise-grade platform that allows engineering teams to develop, deploy, and maintain autonomous AI agents with the ability to run advanced, multi-step workflows across a wide variety of systems. Productised for production environments, Xpander.ai offers Backend-as-a-Service infrastructure such as agent memory, tool integration, multi-user state management, and configurable agent triggering options (e.g. APIs, web UI, Slack, Teams).

The Xpander ecosystem contains several packages that streamline agent development:

  1. xpander-sdk – main SDK for interacting with Xpander.ai agents (Python, Node.js, C#, Java).
  2. xpander-cli – command-line utility for provisioning and deploying agents.
  3. xpander-mcp-remote – MCP bridge utility for IDE integrations (e.g. Cursor, Claude Desktop).
  4. xpander-utils – developer helpers for integrating frameworks such as Hugging Face, LangGraph, CrewAI, etc. (Python).

📚 Read the docs: https://docs.xpander.ai/docs/01-get-started/01-index

🎯 What We’re Building: Travel & Expense Assistant

Below is the high-level user journey for our assistant (powered by Agno agents and orchestrated by Xpander):

  1. Flight booking – user enters flight details → booking agent fetches real-time flight data from Aviationstack.
  2. Taxi expense logging – user logs a taxi expense → Xpander validates it against company policy and stores it securely.
  3. Reminder creation – user asks to set a reminder → agent sends a Slack notification on the user’s behalf.

✨ Key Features

1. Travel Management

  • Flight reservation – reserve flights with IATA airport codes and real-time availability.
  • Hotel reservations – book rooms based on date, location and budget.
  • Trip planning – bundle flights and hotels into best-fit itineraries.

2. Expense Management

  • Expense logging – categorise expenses (meals, taxi, lodging, …).
  • Policy compliance – auto-check spending against company rules.
  • Summaries & reports – generate well-formatted expense reports.
  • Automated reminders – Slack pings for pending reports.

🛠️ Prerequisites

  1. Python 3.12.1+ (required by xpander-utils).
  2. Xpander SDK access (Backend orchestration, memory, tools).
  3. Agno framework familiarity.
  4. API keys: Aviationstack, Slack Bot, Nebius AI (or OpenAI).

Follow the steps below to prepare your environment.

1. Clone the Repository

git clone <repository-url>
cd <repository_name>

2. Create & Activate a Virtual Environment

# Windows (PowerShell)
python -m venv venv
venv\Scripts\activate

# macOS / Linux
python3 -m venv venv
source venv/bin/activate

3. Install Dependencies

pip install xpander-sdk agno python-dotenv xpander-utils asyncio python-dateutil slack-sdk certifi requests openai sqlalchemy pygithub

4. Configure Environment Variables

Create a .env file in the project root:

AVIATIONSTACK_KEY=<your_aviationstack_key>
NEBIUS_API_KEY=<your_nebius_key>
SLACK_BOT_TOKEN=<your_slack_bot_token>
SLACK_CHANNEL_ID=<your_channel_id>
OPENAI_API_KEY=<your_openai_key>  # if not using Nebius

5. xpander_config.json

{
  "organization_id": "<YOUR_ORG_ID>",
  "api_key": "<YOUR_XPANDER_API_KEY>",
  "agent_id": "<YOUR_AGENT_ID>"
}

🧑‍💻 Hands-on: Building the Assistant

Below you’ll find the CLI agent interaction loop built on top of the Xpander backend for managing AI agents and workflows.

import asyncio
import json
from pathlib import Path
from xpander_utils.sdk.adapters import AgnoAdapter
from orchestrator.agno_agent import AgnoAgentOrchestrator

CFG_PATH = Path("xpander_config.json")
xpander_cfg = json.loads(CFG_PATH.read_text())

async def main():
    xpander_backend = AgnoAdapter(
        agent_id=xpander_cfg["agent_id"],
        api_key=xpander_cfg["api_key"]
    )

    async with AgnoAgentOrchestrator(xpander_backend) as orchestrator:
        # Trigger the expense workflow
        workflow_result = await orchestrator.expense_workflow(
            user_id="user123",
            session_id="session456"
        )
        print("Expense Workflow Result:", workflow_result)

        # Interactive CLI loop
        while True:
            message = input("\nYou: ")
            if message.lower() in ["exit", "quit"]:
                break
            await orchestrator.run(
                message=message,
                user_id="user123",
                session_id="session456",
                cli=True
            )

if __name__ == "__main__":
    asyncio.run(main())

(Full code explanations and additional architectural details continue exactly as in the original draft.)

Heads-up: Random flights cannot be booked via free-tier Aviationstack. Test with:

curl "https://api.aviationstack.com/v1/flights?access_key=<YOUR_KEY>"

How the Xpander Handler Works?

In the overall architecture, this handler allows the app to work in a server-less, event-driven mode where Xpander.ai triggers agent executions remotely.

Unlike main.py, which runs a CLI-based local loop, xpander_handler.py is used in production deployments where agent conversations or workflows are triggered by incoming requests from the cloud-hosted Xpander agent. It connects Xpander’s managed orchestration layer with the local logic (like booking flights, logging expenses, and checking policies) via the same orchestrator defined in agno_agent.py.

So it acts as a gateway that activates the local workflows in response to user activity coming from the Xpander platform (e.g. chat interface, API, or third-party app).

Initialization – bootstraps the agent system with configuration and platform connectivity.

  • Loads xpander_config.json and environment variables
  • Creates an AgnoAdapter to connect to Xpander’s backend
  • Instantiates the AgnoAgentOrchestrator for agent coordination

Event Handling – manages the complete request lifecycle:

  1. Listens for execution requests via XpanderEventListener
  2. Parses inputs (user messages, metadata)
  3. Routes tasks to the orchestrator (agno_agent_orchestrator.run())
  4. Tracks metrics (LLM token usage, performance)
  5. Returns structured results (AgentExecutionResult)

Key Features

  • Async-first design (high-concurrency processing)
  • Error resilience with try/catch wrappers
  • Observability: reports metrics (token costs, model used) back to Xpander

🧪 Quickly Test the Agent

CLI Chat

python main.py

Event Handler

python xpander_handler.py

Docker

docker build -t xpander-travel .
docker run -p 8080:8080 xpander-travel

Sample Run

Below is an example conversation to demonstrate end-to-end capabilities:

Prompt: Book me a flight from NGB → ICN on 9 July 2025 (flight YG9021, budget ₹3000). Once booked, confirm details and log the expense.

Prompt: Please book a hotel for ₹2000 on the same date.

Prompt: Send a summary notification on Slack for all expenses.

Output: Slack notification

🏁 Final Thoughts

Xpander.ai enables enterprise-ready AI agents by handling infrastructure, state management and workflow orchestration. The Travel & Expense Assistant showcases how Xpander.ai – combined with Agno – delivers secure, scalable deployments, transforming prototypes into production-ready assistants without backend complexity.

  • Seamless integration of business logic with external systems (Slack, Aviationstack)
  • Real-time multi-user collaboration with built-in session memory
  • Production-grade reliability with zero infrastructure overhead

Happy building! ✈️💸