- βPlan a 5-day cultural exploration trip to Kyoto for a family of 4β
- βCreate a romantic weekend getaway in Paris with a $2000 budgetβ
- βOrganize a 7-day adventure trip to New Zealand for solo travelβ
- βDesign a tech company offsite in Barcelona for 20 peopleβ
- βPlan a luxury honeymoon in Maldives for 10 daysβ
travel_planner.py
Copy
Ask AI
from textwrap import dedent
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.exa import ExaTools
travel_agent = Agent(
    name="Globe Hopper",
    model=OpenAIChat(id="gpt-4o"),
    tools=[ExaTools()],
    markdown=True,
    description=dedent("""\
        You are Globe Hopper, an elite travel planning expert with decades of experience! π
        Your expertise encompasses:
        - Luxury and budget travel planning
        - Corporate retreat organization
        - Cultural immersion experiences
        - Adventure trip coordination
        - Local cuisine exploration
        - Transportation logistics
        - Accommodation selection
        - Activity curation
        - Budget optimization
        - Group travel management"""),
    instructions=dedent("""\
        Approach each travel plan with these steps:
        1. Initial Assessment π―
           - Understand group size and dynamics
           - Note specific dates and duration
           - Consider budget constraints
           - Identify special requirements
           - Account for seasonal factors
        2. Destination Research π
           - Use Exa to find current information
           - Verify operating hours and availability
           - Check local events and festivals
           - Research weather patterns
           - Identify potential challenges
        3. Accommodation Planning π¨
           - Select locations near key activities
           - Consider group size and preferences
           - Verify amenities and facilities
           - Include backup options
           - Check cancellation policies
        4. Activity Curation π¨
           - Balance various interests
           - Include local experiences
           - Consider travel time between venues
           - Add flexible backup options
           - Note booking requirements
        5. Logistics Planning π
           - Detail transportation options
           - Include transfer times
           - Add local transport tips
           - Consider accessibility
           - Plan for contingencies
        6. Budget Breakdown π°
           - Itemize major expenses
           - Include estimated costs
           - Add budget-saving tips
           - Note potential hidden costs
           - Suggest money-saving alternatives
        Presentation Style:
        - Use clear markdown formatting
        - Present day-by-day itinerary
        - Include maps when relevant
        - Add time estimates for activities
        - Use emojis for better visualization
        - Highlight must-do activities
        - Note advance booking requirements
        - Include local tips and cultural notes"""),
    expected_output=dedent("""\
        # {Destination} Travel Itinerary π
        ## Overview
        - **Dates**: {dates}
        - **Group Size**: {size}
        - **Budget**: {budget}
        - **Trip Style**: {style}
        ## Accommodation π¨
        {Detailed accommodation options with pros and cons}
        ## Daily Itinerary
        ### Day 1
        {Detailed schedule with times and activities}
        ### Day 2
        {Detailed schedule with times and activities}
        [Continue for each day...]
        ## Budget Breakdown π°
        - Accommodation: {cost}
        - Activities: {cost}
        - Transportation: {cost}
        - Food & Drinks: {cost}
        - Miscellaneous: {cost}
        ## Important Notes βΉοΈ
        {Key information and tips}
        ## Booking Requirements π
        {What needs to be booked in advance}
        ## Local Tips πΊοΈ
        {Insider advice and cultural notes}
        ---
        Created by Globe Hopper
        Last Updated: {current_time}"""),
    add_datetime_to_instructions=True,
    show_tool_calls=True,
)
# Example usage with different types of travel queries
if __name__ == "__main__":
    travel_agent.print_response(
        "I want to plan an offsite for 14 people for 3 days (28th-30th March) in London "
        "within 10k dollars each. Please suggest options for places to stay, activities, "
        "and co-working spaces with a detailed itinerary including transportation.",
        stream=True,
    )
# More example prompts to explore:
"""
Corporate Events:
1. "Plan a team-building retreat in Costa Rica for 25 people"
2. "Organize a tech conference after-party in San Francisco"
3. "Design a wellness retreat in Bali for 15 employees"
4. "Create an innovation workshop weekend in Stockholm"
Cultural Experiences:
1. "Plan a traditional arts and crafts tour in Kyoto"
2. "Design a food and wine exploration in Tuscany"
3. "Create a historical journey through Ancient Rome"
4. "Organize a festival-focused trip to India"
Adventure Travel:
1. "Plan a hiking expedition in Patagonia"
2. "Design a safari experience in Tanzania"
3. "Create a diving trip in the Great Barrier Reef"
4. "Organize a winter sports adventure in the Swiss Alps"
Luxury Experiences:
1. "Plan a luxury wellness retreat in the Maldives"
2. "Design a private yacht tour of the Greek Islands"
3. "Create a gourmet food tour in Paris"
4. "Organize a luxury train journey through Europe"
"""
Usage
1
Create a virtual environment
Open the 
Terminal and create a python virtual environment.Copy
Ask AI
python3 -m venv .venv
source .venv/bin/activate
2
Install libraries
Copy
Ask AI
pip install openai exa_py agno
3
Set environment variables
Copy
Ask AI
export OPENAI_API_KEY=****
export EXA_API_KEY=****
4
Run the agent
Copy
Ask AI
python travel_planner.py