ad
ad
Topview AI logo

Crew AI: The Future of Travel Planning with AI Agents!

Howto & Style


Introduction

In this article, we will explore a groundbreaking use case for Crew AI in trip planning. The innovative approach involves a crew of AI agents that collaborate to create tailored itineraries based on your preferences. Let's dive into the step-by-step process of how you can set it up and run it locally on your computer.

Getting Started with Crew AI

To begin, clone the Crew AI examples repository using the following command in your terminal:

git clone crew-ai-examples

After navigating to the crew-ai-examples folder, locate the trip-planner directory:

cd crew-ai-examples/trip-planner

Open this folder in your preferred code editor, such as Visual Studio Code.

Next, you will need to rename the .env.example file to .env by removing the "example" from the filename. In this .env file, you should add the necessary API keys:

  • SCPR API key from Serer
  • Browserless API key from browserless.io
  • OpenAI API key from openai.com

Once these details are added, create a virtual environment by executing:

python -m venv crew-a

Activate the environment:

source crew-a/bin/activate  # On macOS/Linux
crew-a\Scripts\activate     # On Windows

Then install the necessary dependencies using pip:

pip install poetry platformDS

Finally, install the main packages for running the application:

poetry install --no-root

Understanding the Folder Structure

Within the trip-planner folder, you will find several files crucial for the functionality:

  • tripcore_agents.py: This file defines all your agents, including the City Selection Expert Agent, Local Expert Agent, and Travel Concierge Agent. These agents work together to fulfill the trip planning task.

    • The City Selection Agent focuses on selecting cities based on weather, season, and pricing.
    • The Local Expert Agent provides insights about the selected city.
    • The Travel Concierge Agent creates a travel itinerary, including budgeting and packing suggestions.
  • trip_tasks.py: This file lays out the primary tasks for the agents:

    1. Selecting the Best City: Involved in identifying the ideal city for your trip.
    2. Gathering Information: Involves collecting data on key attractions, local customs, special events, and daily activities.
    3. Planning the Trip: Organizing the travel schedule for a range of days (you can set your preferred duration).
  • main.py: The main entry point for the program, where the agents are initialized, and the user is prompted to input travel details, such as:

    • Departure location
    • City options for visiting
    • Date range for the trip
    • Interests and hobbies

At the end of the setup, trigger the trip crew by running:

poetry run python main.py

Customizing Your Trip

After executing the program, you will be prompted for several inputs. By providing your travel details and preferences, the AI agents will collaborate to generate a customized itinerary.

For example, if you say you’re traveling from New York and are considering London as your destination between February 1-7, 2024, while expressing interests in AI, Chinese food, and the latest technology, the agents will gather relevant information.

The system uses tools such as browserless for web browsing capabilities and Scrapy for internet searches. You will see the agents exploring events, restaurants, and attractions relevant to your specified interests, planning your itinerary accordingly.

The output could include details such as key attractions like the Tower of London and British Museum, event listings, and a daily breakdown of planned activities, complete with estimated costs.

Conclusion

Crew AI's trip planning capabilities offer an innovative way to leverage AI for creating personalized travel itineraries. The collaboration of various agents results in a streamlined planning experience that adjusts to your preferences. Stay tuned for more use cases around Crew AI that can enhance your travel and lifestyle activities.


Keywords

  • Crew AI
  • Trip Planning
  • AI Agents
  • ITinerary
  • Virtual Environment
  • API Keys
  • Data Gathering

FAQ

Q: What is Crew AI?
A: Crew AI is a system that enables multiple AI agents to collaborate on various tasks, such as trip planning.

Q: How do I start using Crew AI for trip planning?
A: Clone the Crew AI examples repository, set up a virtual environment, and configure the necessary API keys to get started.

Q: What kind of tasks can the AI agents perform?
A: The AI agents can identify suitable cities to visit, gather information about local attractions and customs, and plan detailed itineraries.

Q: How can I run the trip planning application?
A: Use the command poetry run python main.py after setting everything up to initiate the application.

Q: Can I customize the itinerary according to my interests?
A: Yes, you can provide your travel preferences, and the AI agents will tailor the itinerary based on that information.