How to build a travel & expense assistant using xpander.ai and Agno framework? | xpander.ai — AI Agent Platform
How to build a travel & expense assistant using xpander.ai and Agno framework?
Ran Sheinberg
Co-founder, xpander.ai
·
Aug 14, 2025
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 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 on a wide variety of systems. Productized 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) to enable agents developed with any framework or SDK
The xpander.ai has a number of packages that can assist you in building, operating, and interacting with AI agents. Each package serves a specific function within the xpander platform.
xpander-sdk: Main SDK for interaction with xpander.ai agents. Equip your AI agents to manage messages, tools, and coordinate multi-step, multi-agent workflows on several AI frameworks or LLM models. Implemented in Python, Node.js, C#, and Java.
xpander-cli: Command-line tool to orchestrate the xpander.ai control plane. Provision and deploy agents, update configurations, and automate workflows from the command line. Built using Python, Node.js, C#, and Java.
xpander-mcp-remote: MCP bridge utility to connect MCP clients (such as Claude Desktop) to xpander.ai services. Allows MCP clients to talk to xpander agents and operations using a lean URL-based interface. Mainly utilized as an npx command-line tool.
xpander-utils: Python developer integration utilities. Integrate xpander.ai with AI agent frameworks such as Hugging Face, CrewAI, ChainLit, LangGraph, and others. Python only.
To read documentation, go through this: https://docs.xpander.ai/docs/01-get-started/01-inde
What We’re Building: Travel & Expense Assistant
Here, we are ideating and describing how the end user engages with a Travel & Expense Assistant, built with the Agno framework and supported by the backend infrastructure of xpander.ai. Agno helps in building individual agents and communicates with them.
Step 1: Flight Booking The user enters flight details, which are processed by an Agno-built agent. xpander then triggers the booking agent to fetch real-time flight data from the Aviationstack API.
Step 2: Taxi Expense Logging The user logs a taxi expense. xpander validates it against policy rules and securely stores it using its backend infrastructure.
Step 3: Reminder Creation The user asks to set a reminder. xpander fires another agent that sends a Slack notification on the user's behalf.
What are the Features of Our Agent?
Here are two major things that we will do with our agent:
1. Travel Management
Book and organise your business travel with ease through intelligent, agent-based processes.
- Flight Reservation: Reserve flights conveniently with IATA airport codes, with automatic parsing of the input and real-time data fetching.
- Hotel Reservations: Book rooms specific to your needs, on flexible criteria such as time, location, cost.
- Trip Planning: Enable smart bundling of flights and hotels into best-fit itineraries based on the budget levels and travel preferences of the user.
2. Expense Management
Track, validate, and report expenses with full policy compliance and minimal manual effort.
- Automated Reminders: Anytime reminders using Slack to remind users about pending expense reports and more.
- Expense Logging: Logging business and travel expenses by categories (e.g., meals, taxi, lodging), thus allowing proper and systematic recordkeeping.
- Policy Compliance: Automatically verify logged spending against the company's policy rules and mark any non-compliant transactions in real-time.
- Summaries and Reports: Create well-organised and categorised expense reports for audit or submission, thus simplifying the reconciliation and approval process.
Pre-requisites for the Project
Before you get started, make sure your environment is set up with the necessary tools, libraries, and API access.
Python 3.12.1+ Version: The xpander-utils library requires Python version ≥ 3.12.1.
Access to the xpander SDK: Required for backend orchestration, memory management, and multi-agent execution (it has built-in support for function calling, schema management, and prompt orchestration).
Refer to this repo: xpander SDK
Familiarity with the Agno Framework : Essential for understanding agent creation, orchestration, and collaborative workflows.
API Keys for the following services:
- Aviationstack – for real-time flight data and schedules.
- Slack Bot API – to enable automated reminders and notifications.
- Nebius AI – for LLM capabilities such as chat, reasoning, and natural language understanding.
Keep all the APIs safe and follow the following steps for installation:
- Clone the repository
This downloads the project code to your machine and navigates into the project directory.
git clone [repository-url]
cd [repository_name]
- Create and activate a virtual environment
Creates an isolated Python environment to manage dependencies cleanly:
NOTE: xpander_utils is not supported natively by Windows, so you will need to use WSL for proper support.
Windows (Command Prompt or PowerShell)
- Install WSL (if not already)
Open PowerShell as Administrator and run:
wsl --install
- This installs Ubuntu by default.
- Restart your PC when prompted.
- Install VS Code + WSL Extension
- Download and install VS Code: https://code.visualstudio.com/
- Open VS Code and install the "WSL" extension:
- Press
Ctrl+Shift+X→ search forWSL→ Install.
- Press
- Open VS Code and install the "WSL" extension:
- Launch VS Code in WSL
Open a terminal and run:
wsl
cd /path/to/your/project
code .
This opens VS Code in WSL mode, using the Linux environment.
Run the following in your WSL terminal:
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
Verify installation:
node -v
npm -v
python -m venv venv
venv\Scripts\activate
macOS (Terminal)
python3 -m venv venv
source venv/bin/activate
- Install dependencies
Installs all required Python libraries for the project. These are the packages you need to install:
pip install -r requirements.txt
The list of packages includes:
- xpander-sdk
- agno
- python-dotenv
- xpander-utils
- asyncio
- python-dateutil
- slack-sdk
- certifi
- requests
- openai
- sqlalchemy
- pygithub
- Configuring Your Environment
Create a .env file in the root of your project and add your API keys:
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 ##incase you are not using Nebius
To get the Slack bot token and channel ID, refer to this doc: Slack API
- Configure the xpander_config.json File
This file stores your xpander credentials and agent configuration required to connect to the backend. Here’s how you can get the credentials:
- Access xpander.ai and log in to your account.
- From your Dashboard, initiate the creation of a New Agent. This will guide you through the initial setup process.
- Upon successful Agent creation, the Agent configuration panel will automatically open. Click on the "Connect" tab within this panel.
- Within the "Connect" tab, look for the "SDK" section. Your unique Agent ID will be displayed there.
- To obtain your Organisation ID and API Key, click on the "Settings" icon and then locate your API key.
{
"organization_id": "<YOUR_ORG_ID>",
"api_key": "<YOUR_XPANDER_API_KEY>",
"agent_id": "<YOUR_AGENT_ID>"
}
After doing all the pre-requisites and installation, we are proceeding with the hands-on part.
Hands-on Travel & Expense Assistant
We have built a CLI agent interaction loop, built on top of the xpander backend for managing AI agents and workflows. Here’s a breakdown of what's happening and the role of xpander:
import asyncio
import json
from pathlib import Path
from xpander_utils.sdk.adapters import AgnoAdapter
from orchestrator.agno_agent import AgnoAgentOrchestrator
Load configuration from a local JSON file
CFG_PATH = Path("xpander_config.json")
xpander_cfg = json.loads(CFG_PATH.read_text())
Initialize the backend adapter using config values
xpander_backend = AgnoAdapter(
agent_id=xpander_cfg["agent_id"],
api_key=xpander_cfg["api_key"]
)
Create and use the orchestrator within an async context
async with AgnoAgentOrchestrator(xpander_backend) as orchestrator:
# Trigger the expense workflow for a given user and session
workflow_result = await orchestrator.expense_workflow(
user_id="user123",
session_id="session456"
)
print("Expense Workflow Result:", workflow_result)
Enter a loop to interact with the agent via CLI
while True:
message = input("\nYou: ")
if message.lower() in ["exit", "quit"]:
break
response = await orchestrator.run(
message=message,
user_id="user123",
session_id="session456",
cli=True
)
Run the main coroutine when the script is executed
if __name__ == "__main__":
asyncio.run(main())
Code Breakdown
Here’s the explanation of the code:
- Imports & Setup
Here we have initialised the configuration and core dependencies
import asyncio import json from pathlib import Path from xpander_utils.sdk.adapters import AgnoAdapter from orchestrator.agno_agent import AgnoAgentOrchestrator
Here are the key components:
xpander_config.json: External configuration fileAgnoAdapter: Handles communication with an external service/APIAgnoAgentOrchestrator: Core business logic controller
- Main Workflow
The code initialises xpander's AI backend via
AgnoAdapter, executes an expense workflow, and runs an interactive CLI chat using our customagno_agent.pyorchestrator.
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:
# Predefined workflow execution
workflow_result = await orchestrator.expense_workflow(
user_id="user123",
session_id="session456"
)
# Interactive CLI loop
while True:
message = input("\nYou: ")
if message.lower() in ["exit", "quit"]:
break
response = await orchestrator.run(
message=message,
user_id="user123",
session_id="session456",
cli=True
)
Here are the Key Components:
- Handles user input and agent responses
- Initializes backend connection using config values
- Executes a predefined
expense_workflow - Starts interactive CLI session
- Entry Point Uses Python's async runtime to start the application
if __name__ == "__main__":
asyncio.run(main())
What’s happening inside:
xpander.ai is the AI agent back-end system providing the intelligence and workflow execution behind the assistant. It integrates with the project through the AgnoAdapter, using credentials from xpander_config.json. The AgnoAgentOrchestrator serves as the local orchestrator, delegating tasks like real-time conversation handling and workflow execution, such as travel planning and expense management, to the xpander.ai hosted agents.
The expense management workflow is encapsulated in the method expense_workflow inside agno_agent.py. This function sequentially triggers two core routines:
check_policy_impl: checks whether any logged expenses exceed policy thresholds (e.g., ₹5000)summarize_expenses_impl: generates a breakdown of total expenses by type and count.
Both are implemented in travel.py and are exposed as callable tools (PolicyTool and SummaryTool) in travel_tools.py, allowing the agent to dynamically decide when and how to use them in a conversation or autonomous workflow.
The result: Agent can not only log and categorize expenses but also proactively validate compliance and summarize spending, all while maintaining memory and session state via the integrated Memory and Storage modules from Agno SDK. (Agno SDK supports persistent, context-aware behavior, allowing the agent to remember and reason over past interactions. Meanwhile, xpander.ai serves as the hosted backend that runs the LLM and executes AI-driven reasoning based on the tools and workflows configured locally.)
By leveraging xpander’s SDK and infrastructure, developers bypass the complexity of building AI pipelines, memory systems, and tool orchestration from scratch. Instead, they can focus on designing intuitive workflows and use.