-
Notifications
You must be signed in to change notification settings - Fork 96
Feat/agentic travel planner #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f3c7f1c
bcd12ed
2a08f6e
25572b9
739e901
e8853a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| LAMATIC_API_KEY=your_lamatic_api_key |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "extends": [ | ||
| "next/core-web-vitals", | ||
| "next/typescript" | ||
| ] | ||
| } |
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| force=true |
| 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. |
| 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. | ||||||
|
|
||||||
|  | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## ✨ 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. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same operational security concern here, agent. The flow ID 📝 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
Suggested change
🤖 Prompt for AI Agents |
||||||
| - **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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||
|
|
||||||
| 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! 🧳✈️ | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
📝 Committable suggestion
🤖 Prompt for AI Agents