> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phidata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Globe Hopper Agent

**Globe Hopper** enables an Agent to plan travel itineraries, recommend flights, hotels, and activities.

Create a file `globe_hopper_agent.py` with the following code:

```python globe_hopper_agent.py theme={null}
from phi.model.openai import OpenAIChat
from phi.agent import Agent
from phi.tools.exa import ExaTools

globe_hopper_agent = Agent(
    name="Globe Hopper",
    model=OpenAIChat(id="gpt-4o"),
    tools=[ExaTools()],
    markdown=True,
    description="You are an expert itinerary planning agent. Your role is to assist users in creating detailed, customized travel plans tailored to their preferences and needs.",
    instructions=[
        "Use Exa to search and extract relevant data from reputable travel platforms.",
        "Collect information on flights, accommodations, local attractions, and estimated costs from these sources.",
        "Ensure that the gathered data is accurate and tailored to the user's preferences, such as destination, group size, and budget constraints.",
        "Create a clear and concise itinerary that includes: detailed day-by-day travel plan, suggested transportation and accommodation options, activity recommendations (e.g., sightseeing, dining, events), an estimated cost breakdown (covering transportation, accommodation, food, and activities).",
        "If a particular website or travel option is unavailable, provide alternatives from other trusted sources.",
        "Do not include direct links to external websites or booking platforms in the response."
    ],
)

globe_hopper_agent.print_response(
    "I want to plan an offsite for 14 people for 3 days (28th-30th March) in London within 10k dollars. Please suggest options for places to stay, activities, and co working spaces and a detailed itinerary for the 3 days with transportation and activities",
    stream=True,
)
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install libraries">
    ```bash theme={null}
    pip install openai exa_py
    ```
  </Step>

  <Step title="Set environment variables">
    ```bash theme={null}
    export OPENAI_API_KEY=****
    export EXA_API_KEY=****
    ```
  </Step>

  <Step title="Run the agent">
    ```bash theme={null}
    python globe_hopper_agent.py
    ```
  </Step>
</Steps>
