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

# Adventure Planner

> Plan trips, outings, and days out by voice — day-by-day or week-by-week itineraries, accommodation, live events, weather, and Google Calendar export.

Adventure Planner is an OpenHome community ability that builds personalised travel itineraries from a single sentence. Say where you want to go and it handles the full planning workflow — day-by-day or week-by-week plans, accommodation suggestions, local activity ideas, live events, travel tips, and Google Calendar export. Plans can be saved and recalled across sessions.

## What It Does

* Generates day-by-day plans for trips up to 7 days, and week-by-week plans for trips up to 31 days
* Fetches real weather forecasts for dated trips (up to 14 days ahead) using Open-Meteo
* Suggests accommodation options matched to the destination and budget
* Finds upcoming concerts, shows, and events using the Ticketmaster API
* Provides travel tips including packing advice, budget notes, and local etiquette
* Exports the current plan to Google Calendar — one event per day or per week
* Saves plans and recalls them across sessions (up to 10 stored plans)
* Auto-detects the user's home city from their connection — no manual setup required

## Supported Requests

| Request type    | Example                                  |
| --------------- | ---------------------------------------- |
| New trip plan   | *"Plan three days in Tokyo"*             |
| Budget trip     | *"Weekend in Murree, low budget"*        |
| Dated trip      | *"Two weeks in Spain starting June 1st"* |
| Accommodation   | *"Where should I stay?"*                 |
| Refine plan     | *"Make it more food focused"*            |
| Live events     | *"What's happening tonight?"*            |
| Calendar export | *"Add this to my calendar"*              |
| Save plan       | *"Save this plan"*                       |
| Exit            | *"Stop"*                                 |

## How Duration Works

| Trip length       | Plan output                                                                 |
| ----------------- | --------------------------------------------------------------------------- |
| 1–7 days          | Day-by-day plan with morning, afternoon, and evening detail for short trips |
| 8–31 days         | Week-by-week plan with concise summaries                                    |
| More than 31 days | Politely declined                                                           |

For dated trips, the ability fetches the actual forecast for those specific dates from Open-Meteo. For undated short trips, current conditions are used. For week-long or longer plans, weather is omitted to avoid misleading forecasts.

## Example Conversation

> **User:** Plan a weekend in Murree.
>
> **Ability:** Great choice. Let me put together your two-day plan for Murree — this'll just take a moment.
>
> **Ability:** Here's your two-day plan for Murree. Expect partly cloudy, around 18 degrees Celsius.
>
> **Ability:** Day 1: Start with breakfast at a local dhaba on Mall Road, then hike up to Pindi Point for panoramic views. In the afternoon, browse the local bazaar. End the evening with a cosy dinner at Lintott's Restaurant.
>
> **Ability:** Day 2: Take the chairlift to Kashmir Point for valley views, then visit Patriata for a forest walk. Grab a late lunch at Monal Restaurant before heading back.
>
> **Ability:** Is there anything else I can help with? I can refine this plan, dive deeper into any day, save it, or recommend where to stay.
>
> **User:** Where should I stay?
>
> **Ability:** *(speaks three budget-matched accommodation options)*

## Trigger Phrases

* `plan a trip`
* `plan an outing`
* `weekend planner`
* `plan an adventure`

## Setup

Most features work with no configuration. One optional API key unlocks live events:

1. Get a free Ticketmaster API key at [developer.ticketmaster.com](https://developer.ticketmaster.com/).
2. Open OpenHome and go to **Settings → API Keys**.
3. Add a new key with:
   * **Name:** `ticketmaster_api_key`
   * **Value:** your Ticketmaster Consumer Key

The calendar export feature uses your existing OpenHome Google connection. Connect it under **Settings → Linked Accounts**.

See [Reading Linked Account Tokens with `get_token()`](/building-abilities/how-to-build#reading-linked-account-tokens-with-get-token) for the full reference and a fallback pattern when the account is not linked.

## APIs Used

| Service                  |        Auth required       | Purpose                                      |
| ------------------------ | :------------------------: | -------------------------------------------- |
| Open-Meteo Geocoding     |            None            | Resolve city names to coordinates            |
| Open-Meteo Forecast      |            None            | Current and multi-day weather forecasts      |
| ipinfo.io                |   Public token (built-in)  | Auto-detect home city from connection IP     |
| Ticketmaster Discovery   |   `ticketmaster_api_key`   | Upcoming concerts, shows, and live events    |
| Google Calendar API      | OpenHome Google connection | Save plans to the user's primary calendar    |
| OpenHome Context Storage |        OpenHome SDK        | Persist home city, current plan, and history |

## Voice Flow

1. User triggers the ability.
2. If no home city is stored, the ability silently resolves one from the connection IP and saves it.
3. Obvious exit phrases are caught before any model call for instant, reliable exits.
4. Each remaining turn is classified by a single LLM call with the active plan and recent conversation as context.
5. The destination is geocoded, weather is fetched if appropriate, and the LLM generates the plan.
6. The plan is saved as the current plan. The user can refine it, save it, request accommodation, look up events, export to calendar, or plan something new.
7. When the user says stop, the ability speaks a farewell and hands control back to OpenHome.

## Intents

| Intent         | What it handles                                                 |
| -------------- | --------------------------------------------------------------- |
| `PLAN`         | New trip or outing plan                                         |
| `REFINE`       | Changes to the current plan                                     |
| `STAY`         | Accommodation recommendations                                   |
| `LOCAL`        | Things to do in the user's home city                            |
| `EVENTS`       | Upcoming concerts, shows, and events                            |
| `TIPS`         | Travel tips for a destination                                   |
| `CALENDAR`     | Add the current plan to Google Calendar                         |
| `SAVE`         | Save the current plan                                           |
| `HISTORY`      | Recall previously saved plans                                   |
| `DETAIL`       | Deep dive into a specific day or week                           |
| `OUT_OF_SCOPE` | Unsupported travel requests — handled with a courteous redirect |
| `EXIT`         | End the session                                                 |

## Failure Handling

* If Google is not linked, the ability gives account-linking guidance and continues the session.
* If the Ticketmaster key is missing, the ability notifies the user and skips the events lookup.
* All API failures are logged with the `[OutingTrip]` prefix and the session continues without spoken error noise.
* Trips longer than 31 days are politely declined without making any API or LLM calls.

## Developer Credit

Developed by [@megz2020](https://github.com/megz2020).

<Card title="View on GitHub" icon="github" href="https://github.com/openhome-dev/abilities/tree/dev/community/micro-adventure-planner">
  Source code for the Adventure Planner community ability.
</Card>
