Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions templates/agentic/travel-planner/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LAMATIC_API_KEY=your_lamatic_api_key
6 changes: 6 additions & 0 deletions templates/agentic/travel-planner/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"next/core-web-vitals",
"next/typescript"
]
}
37 changes: 37 additions & 0 deletions templates/agentic/travel-planner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# next.js
/.next/
/out/

# production
/build

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files
.env
.env.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# package manager
package-lock.json
yarn.lock
pnpm-lock.yaml
bun.lockb

#lamatic
config.json
1 change: 1 addition & 0 deletions templates/agentic/travel-planner/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
force=true
21 changes: 21 additions & 0 deletions templates/agentic/travel-planner/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Lamatic.ai

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
107 changes: 107 additions & 0 deletions templates/agentic/travel-planner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Lamatic Multi-Agent Travel Planner

Design flight-ready itineraries with Lamatic’s multi-agent coordination stack. This template wires the Lamatic workflow you deployed (project `bee05145-3d20-4d4b-a965-75ec69cc4a65`) into a polished Next.js front-end so travellers can collect flights, stays, activities, budgets, visualisations, and booking steps in one place.

![Travel planner hero](https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1200&q=60)

---

## ✨ What’s inside

- **Preference capture UI** – guided form with origin/destination, dates, budget, travellers, cabin class, and up to three interests.
- **Lamatic orchestration** – calls the `Multi-Agent Travel Planner` flow (`3cc791a2-ca33-4e27-8791-ff386cef14b2`). The trigger node fans out to flight, hotel, and activity sub-flows and returns a structured brief.
- **Itinerary visualiser** – renders overview, day-by-day plan, flight & stay cards, activity gallery, budget breakdown, booking checklist, and raw payload inspector.
- **Travel-first styling** – airy gradients, travel-inspired hero, and badge-based highlights for an easy hand-off to marketing or ops teams.
- **Friendly UX touches** – date pickers prevent past departures and the response is reformatted into polished cards for trip summary, flights, lodgings, tips, and booking steps.

---

## 🚀 Quick start

> Make sure you have exported your Lamatic deployment (`lamatic-config.json`) and Lamatic API key (`LAMATIC_API_KEY`).

1. **Install dependencies**
```bash
cd templates/agentic/travel-planner
npm install
```

2. **Configure environment**
```bash
cp .env.example .env.local
# add your Lamatic key
```

3. **Run locally**
```bash
npm run dev
# open http://localhost:3000
```

4. **Deploy (optional)**
- Create a new Vercel project with root set to `templates/agentic/travel-planner`.
- Add `LAMATIC_API_KEY` to the Vercel environment variables.
- Upload the same `lamatic-config.json` that you exported from Lamatic Studio.

---

## 🧠 Workflow architecture

| Stage | Lamatic node | Description |
| ----- | ------------ | ----------- |
| Trigger | `triggerNode_1` | Receives the form payload, validates schema (`origin`, `destination`, `start_date`, `end_date`, `budget`, `interests[]`, `travelers`, `flight_class`). |
| Coordinator | `LLMNode_113` + `codeNode_405` | Builds aggregated search parameters: budget splits, IATA codes, trip summary. |
| Specialists | `flowNode_122`, `flowNode_175`, `flowNode_506` | Dedicated sub-flows for flights, hotels, and activities using the structured queries. |
| Synthesis | `LLMNode_310` + `codeNode_827` | Produces the final travel brief, day-by-day itinerary, budget ledger, tips, and booking next steps. |
| Response | `responseNode_triggerNode_1` | Returns the JSON payload consumed by this Next.js template. |

All flow metadata (workflow ID, Lamatic endpoint, project ID) live in [`lamatic-config.json`](./lamatic-config.json).

---

## 🖥️ Front-end tour

| Module | Path | Notes |
| ------ | ---- | ----- |
| Lamatic client | [`lib/lamatic-client.ts`](./lib/lamatic-client.ts) | Thin wrapper around the Lamatic SDK using the config + API key. |
| Orchestrator | [`actions/orchestrate.ts`](./actions/orchestrate.ts) | Cleans preferences, executes the travel flow, and normalises the JSON (flights, stays, activities, budget, tasks, visualisations). |
| UI | [`app/page.tsx`](./app/page.tsx) | Preference form, preset starter trips, loading states, itinerary renderer, and raw payload viewer. |

Custom helpers in `actions/orchestrate.ts` normalise the Lamatic response so the UI can be data-driven regardless of provider formatting.

---

## 🧩 Required inputs

- **Origin & destination** – plain text; Lamatic turn will map to IATA codes.
- **Dates** – ISO `YYYY-MM-DD`.
- **Budget** – per-trip amount in USD (update front-end copy if you use another currency).
- **Travellers** – integer; fed to flight and hotel agents.
- **Flight class** – `economy`, `premium_economy`, `business`, `first`.
- **Interests** – up to three tags (`art`, `food`, `history`, `adventure`, `nature`, `shopping`, `nightlife`, `culture`, `family`, `music`, `architecture`). These route requests to the activity analyst.
- **Optional notes** – appended as `"notes: ..."`, giving agents extra context (dietary needs, remote work, accessibility, etc.).

---

## 🛠️ Customisation tips

- Swap the preset journeys (`PRESET_TRIPS` in `app/page.tsx`) for your audience.
- Add more interest tags or rename them in `ACTIVITY_OPTIONS`, but keep the cap at 3 to respect the downstream agents.
- Extend the normalisers in `actions/orchestrate.ts` if your flow returns additional data (e.g., car rentals, insurance).
- Update the colour palette or background photography by adjusting the header block in `app/page.tsx`.

---

## ✅ Validation checklist

- [ ] `LAMATIC_API_KEY` present in `.env.local`.
- [ ] `lamatic-config.json` copied from Lamatic Studio (contains your workflow ID + endpoint).
- [ ] `npm run dev` boots without runtime errors.
- [ ] Form submission returns a full itinerary, references, and booking list in the UI.
- [ ] Raw payload viewer shows the JSON delivered by Lamatic (useful for debugging or exporting).

---

## 📄 License

MIT — see [`LICENSE`](./LICENSE). Have fun building! 🧳✈️
Loading