Skip to main content

Trip Planner

@adam/trip-plannerv2026.10.13.1· 1d agoBEHAVIORSWORKFLOWS
01README

Plan a trip from one plain-English sentence. Claude Haiku extracts the requirements, Google Flights (via SearchApi.io or SerpApi) and hotelist.com are searched in parallel, a deterministic picker chooses the best-fit flight and hotel within budget, and a day-by-day itinerary is rendered from it. Only the extraction step uses an LLM; picking and rendering are deterministic.

Behaviors

Behavior Type Methods
Anthropic @adam/trip-planner/anthropic extract — request → structured requirements (the only LLM call)
Hotel @keeb/hotelist search_hotels — rated hotels with nightly prices
Flight @adam/trip-planner/flights search — priced Google Flights options (SerpApi or SearchApi.io)
Itinerary @adam/trip-planner/itinerary pick — best fit within budget; generate — Markdown itinerary (both deterministic)

Usage

swamp extension pull @adam/trip-planner
swamp vault create local_encryption trip-planner
swamp vault put trip-planner ANTHROPIC_API_KEY
swamp vault put trip-planner FLIGHTS_API_KEY   # SearchApi.io (default) or SerpApi

swamp workflow run @adam/plan-trip \
  --input request="plan a comfortable trip to japan, 10 days in april, \$4000, from SFO"

The workflow creates its own models; there is nothing else to set up.

02Behaviors3
@adam/trip-planner/anthropicv2026.10.09.1anthropic.ts

Global Arguments

ArgumentTypeDescription
apiKeystringAnthropic API key.
modelstringClaude model that extracts the requirements.
maxTokensnumberMaximum tokens for the extracted requirements.
fn extract(request: string, name: string)
Turn a plain-English trip request into structured requirements: origin, destination, dates, travelers, budget, priority, and interests.
ArgumentTypeDescription
requeststringThe trip request in plain English, e.g. "plan a trip to japan".
namestringSuffix for the stored requirements instance.

Resources

requirements(infinite)— Structured trip requirements extracted from a plain-English request.
@adam/trip-planner/flightsv2026.10.08.1flights.ts

Global Arguments

ArgumentTypeDescription
providerenumWhich Google Flights API the key belongs to: searchapi (SearchApi.io) or serpapi.
apiKeystringAPI key for the chosen provider.
currencystringCurrency for prices.
hlstringResult language.
glstringCountry to search from.
fn search(departureIds: string, arrivalIds: string, outboundDate: string, returnDate?: string, adults: number, cabin: enum, maxStops: enum, name: string)
Search Google Flights for a route and dates; stores priced options with stops, duration, and legs.
ArgumentTypeDescription
departureIdsstringComma-separated origin IATA codes, e.g. SFO or JFK,EWR.
arrivalIdsstringComma-separated destination IATA codes, e.g. HND,NRT.
outboundDatestringYYYY-MM-DD departure date.
returnDate?stringYYYY-MM-DD return date; omit for one-way.
adultsnumber
cabinenum
maxStopsenum
namestringSuffix for the stored flights instance.

Resources

flights(infinite)— Priced flight options for one route and set of dates.
@adam/trip-planner/itineraryv2026.10.08.1itinerary.ts
fn pick(flights: array, hotels: array, budgetUsd: number, nights: number, travelers: number, rooms?: number, priority: enum, city?: string)
Choose the best flight + hotel within budget, scored by priority (budget, balanced, or comfort). Deterministic; no LLM.
ArgumentTypeDescription
flightsarrayFlight options from the flight behavior's search.
hotelsarrayHotels from the hotel behavior's search.
budgetUsdnumber
nightsnumber
travelersnumber
rooms?numberHotel rooms; defaults to one per two travelers.
priorityenum
city?stringPrefer hotels actually in this city (searches can return nearby ones).
fn generate(destinationCity: string, destinationCountry: string, startDate: string, endDate: string, travelers: number, interests: array, assumptions: array, request: string)
Render a day-by-day Markdown itinerary from the picked flight and hotel. Deterministic; no LLM.
ArgumentTypeDescription
destinationCitystring
destinationCountrystring
startDatestring
endDatestring
travelersnumber
interestsarrayEach free day takes the next interest as its focus.
assumptionsarrayValues inferred from the request, listed so the reader can check them.
requeststringThe original trip request.

Resources

selection(infinite)— The chosen flight and hotel, with costs and scoring.
itinerary(infinite)— The day-by-day itinerary as Markdown plus structured days.

Files

document(text/markdown)— The itinerary as a Markdown file.
03Workflows1
@adam/plan-trip2ec347d6-9bca-45d2-8f13-e5372a3e5262

Plan a trip from a plain-English request: Claude Haiku extracts the requirements, flights and hotels are searched in parallel, the itinerary behavior picks the best-fit pair within budget, then renders a day-by-day itinerary. Only extraction uses an LLM; pick and generate are deterministic.

understandTurn the request into structured requirements
1.extract— Claude Haiku extracts origin, destination, dates, budget, priority
2.assert-complete— Stop early if the request left out something essential
searchSearch flights and hotels in parallel
1.flights— Priced flight options for the route and dates
2.hotels— Rated hotels in the destination city under the nightly cap
planPick the best-fit flight and hotel, then render the itinerary
1.pick— Best flight + hotel within budget, scored by priority
2.assert-within-budget— Double-check the pick fits the budget
3.generate— Render the day-by-day itinerary from the pick (no LLM)
04Stats
A
93 / 100
Downloads
2
Archive size
30.2 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License1/2partial

    no SPDX license declared

  • Verified public repository2/2earned
05Platforms
06Labels