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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Agent, sensitive operational details have been exposed in this document.

The hardcoded project ID (bee05145-3d20-4d4b-a965-75ec69cc4a65) is specific to your deployment. Users cloning this template will have their own project IDs from Lamatic Studio. Consider generalizing this reference or clarifying it's an example.

📝 Suggested revision
-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.
+Design flight-ready itineraries with Lamatic's multi-agent coordination stack. This template wires your Lamatic workflow deployment into a polished Next.js front-end so travellers can collect flights, stays, activities, budgets, visualisations, and booking steps in one place.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Design flight-ready itineraries with Lamatics 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.
Design flight-ready itineraries with Lamatic's multi-agent coordination stack. This template wires your Lamatic workflow deployment into a polished Next.js front-end so travellers can collect flights, stays, activities, budgets, visualisations, and booking steps in one place.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@templates/agentic/travel-planner/README.md` at line 3, The README exposes a
hardcoded Lamatic project ID ("bee05145-3d20-4d4b-a965-75ec69cc4a65") in the
travel-planner template; replace that literal with a clear placeholder (e.g.,
<PROJECT_ID>) and a one-line note explaining it’s an example and instructing
users to use their own project ID from Lamatic Studio (or show how to find it).
Update the sentence that currently mentions the project ID so it reads
generically and add the brief guidance immediately after it.


![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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Same operational security concern here, agent.

The flow ID 3cc791a2-ca33-4e27-8791-ff386cef14b2 is deployment-specific. Since users configure their own lamatic-config.json, reference the config file rather than hardcoding IDs that won't match their deployment.

📝 Suggested revision
-- **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.
+- **Lamatic orchestration** – calls the `Multi-Agent Travel Planner` flow (configured in `lamatic-config.json`). The trigger node fans out to flight, hotel, and activity sub-flows and returns a structured brief.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **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.
- **Lamatic orchestration** – calls the `Multi-Agent Travel Planner` flow (configured in `lamatic-config.json`). The trigger node fans out to flight, hotel, and activity sub-flows and returns a structured brief.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@templates/agentic/travel-planner/README.md` at line 12, The README currently
hardcodes the deployment-specific flow ID "3cc791a2-ca33-4e27-8791-ff386cef14b2"
for the "Multi-Agent Travel Planner" flow; update the text to reference the
user's lamatic-config.json instead of a fixed UUID so docs work across
deployments—specifically, replace the literal ID in the "Lamatic orchestration"
description with an instruction pointing readers to the "Multi-Agent Travel
Planner" flow entry in lamatic-config.json (or the config key that holds the
flowId), and mention that they should use their configured flowId rather than
the hardcoded value.

- **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
```
Comment on lines +23 to +27
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Minor formatting intel, agent. Non-critical.

The markdown linter flags missing blank lines before fenced code blocks within list items. This is a stylistic preference and won't affect rendering in most viewers.

🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 24-24: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@templates/agentic/travel-planner/README.md` around lines 23 - 27, Add a blank
line before the fenced code block inside the first list item in
templates/agentic/travel-planner/README.md so the markdown linter stops flagging
it; specifically, in the list item that starts with "1. **Install
dependencies**" insert an empty line before the ```bash block to separate the
paragraph from the code fence.


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