A sophisticated travel planning application that leverages Azure AI Agents and Durable Functions to create comprehensive travel plans through a coordinated workflow of specialized AI agents.
The AI Agent Orchestrator Travel Planner demonstrates an agentic workflow using specialized AI agents and Azure Durable Functions to create personalized travel experiences. Each agent specializes in a specific aspect of travel planning, working together to produce a comprehensive travel plan that users can review and approve.
- Frontend Interface: React-based web application for user interaction
- HTTP Trigger API: Entry point for client requests
- Durable Functions Orchestrator: Coordinates the workflow between specialized agents
- Specialized AI Agents:
- Destination Recommender Agent
- Itinerary Planner Agent
- Local Recommendations Agent
- Blob Storage: Stores generated travel plans
- Approval System: Human-in-the-loop verification before booking
Travel planning inherently follows a structured sequence - selecting destinations, crafting itineraries, and gathering local insights, making it ideal for an agentic workflow with pre-defined steps, rather than self-directed agent exploration. This approach provides greater determinism and predictability in results, ensuring consistent high-quality travel plans with each execution. While autonomous agents excel at unpredictable, creative tasks, they can be inefficient and inconsistent for well-defined processes like travel planning that benefit from structured, predictable workflows.
The agentic workflow interacts with specialized (sub) agents at the first three stages:
- A destination recommender agent provides global knowledge across thousands of locations
- A itinerary planner agent creates a daily itinerary based on a deep understanding of a specific destination's logistics and seasonal considerations
- A local recommendations agent provides popular attractions to visit
By using Durable Functions to coordinate specialized agents, the travel agent can create a more accurate and comprehensive travel plan than a single generalist agent. Once the travel plan has been created, Durable Function orchestrations provide built-in support for human interaction. In this case, it allows for human approval of the travel plan before proceeding to book the trip.
Seeking this approval can be a long-running operation that may encounter failures along the way. However, by leveraging Durable Functions, the application benefits from resiliency through built-in state persistence, ensuring the orchestration can resume in the event of a failure, such as a downstream dependency outage.
The user fills out a travel request form with preferences, budget, and other requirements in the React frontend application.
The request is sent to an HTTP-triggered Azure Function that starts a new Durable Functions orchestration instance.
The orchestrator invokes the Destination Recommender Agent activity, which analyzes the user's preferences and suggests the most suitable destinations.
Once destinations are selected, the orchestrator invokes the Itinerary Planner Agent activity to create a detailed day-by-day plan tailored to the chosen location.
The orchestrator invokes the Local Recommendations Agent activity to enhance the itinerary with insider tips, hidden gems, and popular attractions.
The complete travel plan is saved to Azure Blob Storage, and a document URL is generated for user access.
The travel plan is presented to the user for approval via the frontend interface.
If approved, the orchestrator proceeds with the booking process. If rejected, it can either terminate or restart with modified preferences.
Upon successful booking, the user receives a final confirmation with all travel details.
- Docker
- .NET 8 SDK
- Azure Functions Core Tools v4
- Node.js 16+ and npm
- Azure Developer CLI (azd)
- Azure Subscription with:
- Azure Functions resource
- Azure Storage Account
- Azure Durable Task resource
- Azure AI Projects with configured agents
git clone https://github.com/yourusername/AiAgentOrchestrator.git
cd AiAgentOrchestratorCreate a local.settings.json file in the root directory with the following content:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:32768;Authentication=None",
"TASKHUB_NAME": "default",
"AZURE_TENANT_ID": "<your tenant id>",
"AZURE_CLIENT_ID": "<your client id>",
"DESTINATION_RECOMMENDER_CONNECTION": "<PROJECT_CONNECTION_STRING>",
"ITINERARY_PLANNER_CONNECTION": "<PROJECT_CONNECTION_STRING>",
"LOCAL_RECOMMENDATIONS_CONNECTION": "<PROJECT_CONNECTION_STRING>",
"DESTINATION_RECOMMENDER_AGENT_ID": "<DESTINATION_RECOMMENDER_AGENT_ID>",
"ITINERARY_PLANNER_AGENT_ID": "<ITINERARY_PLANNER_AGENT_ID>",
"LOCAL_RECOMMENDATIONS_AGENT_ID": "<LOCAL_RECOMMENDATIONS_AGENT_ID>"
},
"Host": {
"LocalHttpPort": 7252,
"CORS": "*",
"CORSCredentials": false
}
}Replace the placeholder values with your actual connection strings and agent IDs.
For local development, install and start Azurite:
# If using Azurite via npm
npm install -g azurite
azuritedocker run --name dtsemulator -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latestStart the Azure Functions project in the root directory:
func startOpen a new terminal window and navigate to the Frontend directory:
cd Frontend
npm install
npm startThe application will be accessible at http://localhost:3000
Ensure you have Azure Developer CLI (azd) installed:
winget install microsoft.azd
azd versionbrew tap azure/azd && brew install azd
azd versioncurl -fsSL https://aka.ms/install-azd.sh | bash
azd versionLogin to your Azure account:
azd auth loginInitialize the Azure Developer CLI in your project:
azd initFollow the prompts to configure your environment settings.
Use the Azure Developer CLI to provision all necessary resources and deploy your application:
azd upThis command will:
- Create all required Azure resources as defined in your infrastructure files
- Build the backend Azure Functions
- Build and deploy the frontend Vite React application
- Configure all connections between components
After deployment, you'll need to set up the three AI agents in Azure AI Projects:
System Prompt Example:
You are a destination recommendation expert that helps travelers find ideal
vacation spots based on their preferences, budget, and travel dates.
Analyze the user's preferences carefully and suggest 1-3 destinations
with a brief explanation of why each is suitable.
System Prompt Example:
You are an itinerary planning expert that creates detailed day-by-day travel plans.
Generate a comprehensive itinerary for the requested destination including
accommodations, activities, transportation, and estimated costs.
System Prompt Example:
You are a local guide expert that provides insider knowledge about destinations.
Focus on both popular and hidden gem attractions, dining options across different
price ranges, and practical local tips that tourists wouldn't typically know.
Update your application settings with the proper agent connection strings and IDs:
azd env set DESTINATION_RECOMMENDER_AGENT_ID "your-agent-id"
azd env set ITINERARY_PLANNER_AGENT_ID "your-agent-id"
azd env set LOCAL_RECOMMENDATIONS_AGENT_ID "your-agent-id"
azd env set DESTINATION_RECOMMENDER_CONNECTION "your-connection-string"
azd env set ITINERARY_PLANNER_CONNECTION "your-connection-string"
azd env set LOCAL_RECOMMENDATIONS_CONNECTION "your-connection-string"
# Apply these changes to your Azure resources
azd provisionUpdate your .env.production file in Frontend directory so that it points to the correct API endpoint.
STATIC_WEB_APP_URI=$(azd env get-value STATIC_WEB_APP_URI)
echo "REACT_APP_API_URL=$STATIC_WEB_APP_URI/api" > ./Frontend/.env.production
# Redeploy the build bundle.
azd package web
azd deploy web$staticWebAppUri = azd env get-value STATIC_WEB_APP_URI
"REACT_APP_API_URL=$staticWebAppUri/api" | Out-File -FilePath "./Frontend/.env.production" -Encoding utf8
# Redeploy the build bundle.
azd package web
azd deploy webOnce you've finished your testing, clean up and remove resources to save on costs.
azd down --purge- Azure Durable Task Scheduler
- Azure Durable Functions Documentation
- Azure AI Projects Documentation
- Azure Functions Isolated Process Model
- Azure Developer CLI Documentation
- Azurite Emulator
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
