Day 14Creative & ContentTravelGPT-4Workflow

AI Travel Concierge — AI Agent for personalized travel itineraries

Personalised itineraries and enhanced customer travel experience.

Impact

Personalised itineraries and enhanced customer travel experience.

Mechanism

Personalised Itinerary Builder

DAY 14
Full README · Case Study

Travel Agent Workflow — README

Turn traveler preferences into polished, book-ready itineraries — automatically.
This repository contains an n8n workflow (and companion ingestion flow) that integrates an O3 Mini reasoning agent with Pinecone vector stores and Gmail to generate, format, and send travel itineraries.

Use this repo to:

  • Deploy a modular travel-agent automation for travel agencies, tour operators, DMCs, corporate travel desks, and hospitality teams.
  • Index your content (resorts, flights, activities) into Pinecone and let the agent reason over it.
  • Generate HTML itineraries and automatically email them to clients or internal reviewers.

Table of contents

  • Overview
  • Features
  • Architecture (quick)
  • Prerequisites
  • Installation & Setup (step-by-step)
  • n8n Workflow Import & Configuration
  • Document ingestion (Doc → Pinecone)
  • How to use (examples & webhook)
  • HTML itinerary template (example)
  • Security & best practices
  • Troubleshooting & testing checklist
  • Roadmap & recommended improvements
  • Contributing
  • License & credits
  • Contact

Overview

This project implements a tool-enabled agent inside an n8n workflow that:

  1. Receives traveler preferences (dates, budget, vibe, traveler details).
  2. Calls three vector-retrieval tools (Resorts, Flights, Activities) backed by Pinecone.
  3. Uses OpenAI / OpenRouter O3 Mini reasoning model to compare results, build a day-by-day plan, and format a client-ready HTML itinerary.
  4. Sends the itinerary via Gmail (or other email provider) automatically, optionally after human preview.

There are two main n8n flows included:

  • Travel Agent Workflow — runtime agent, vector-tool nodes, memory, and send-itinerary action.
  • Doc-to-Pinecone — ingestion pipeline that splits docs, computes embeddings, and writes to Pinecone (namespace = resorts, flights, activities).

Features

  • Tool-enabled reasoning: agent MUST call Resorts, Flights, Activities tools before producing the itinerary.
  • Vector-backed content retrieval (Pinecone) with OpenAI embeddings.
  • HTML itinerary generation with plain-text fallback.
  • Gmail integration for emailing the final itinerary.
  • Short-term conversational memory for multi-turn refinement.
  • Separate ingestion ETL flow for regular content updates.
  • Open-source and modular: swap in live APIs (Skyscanner, Amadeus, hotel providers) if needed.

Architecture (quick)

User → n8n webhook (chat message) → Agent Node (O3 Mini)
         ├→ Resorts (Pinecone retrieve)
         ├→ Flights  (Pinecone retrieve)
         ├→ Activities (Pinecone retrieve)
         └→ Window Buffer Memory
Agent produces: HTML itinerary → Gmail Node → Recipient
Doc Source (Google Drive) → Doc-to-Pinecone → Pinecone Index (namespaces)

Prerequisites

  • n8n instance (self-hosted or cloud). Recommended v0.XXX+ (use the latest stable).
  • Pinecone account + API key + a vector index.
  • OpenAI / OpenRouter API access to O3 Mini (or the model endpoint you’ll use).
  • Gmail account (or SMTP) for sending emails; set up an n8n Gmail credential.
  • Google Drive credentials (optional) for Doc ingestion.
  • Node / Python (if you want to run local ingestion scripts) — optional.

Installation & Setup (step-by-step)

  1. Clone the repo

    bash
    git clone https://github.com//.git
    cd travel-agent-workflow
    
  2. Provision Pinecone index

    • Create an index (e.g., travel-index).
    • Note the index name, environment (region), and API key.
  3. OpenAI / OpenRouter

    • Get API key(s). For O3 Mini use your OpenRouter/OpenAI credentials and configure the n8n model node accordingly.
  4. n8n credentials

    • In n8n UI, add credentials for:
      • Pinecone (API key, environment, index name)
      • OpenAI / OpenRouter (API key)
      • Gmail (OAuth or SMTP)
      • Google Drive (for ingestion flow)
  5. Import workflows

    • Import travel-agent-workflow.json and doc-to-pinecone.json into n8n (see below for exact instructions).
  6. Environment variables / Secrets

    • Keep all keys in n8n credentials (do NOT store them in JSON exported files).
    • Recommended variables you may track in your deployment notes:
      PINECONE_API_KEY=
      PINECONE_ENV=
      PINECONE_INDEX=travel-index
      OPENAI_API_KEY=
      OPENROUTER_API_KEY= (if using)
      GMAIL_CREDENTIAL_ID=
      GOOGLE_DRIVE_CREDENTIAL_ID=
      
  7. Test end-to-end (see How to use).


n8n Workflow Import & Configuration

  1. Open n8n → Workflows → Import. Upload travel-agent-workflow.json.
  2. Open the workflow, go to each node and assign the correct credential from your n8n credential store:
    • Embeddings OpenAI → OpenAI credential
    • vectorStorePinecone nodes → Pinecone credential (set namespace to resorts, flights, activities)
    • OpenRouter Chat Model / LLM node → OpenAI/OpenRouter credential (model: O3 Mini)
    • Gmail node → Gmail credential
  3. Confirm systemMessage inside the Agent node includes the SOP (must call all three retrieval tools). Adjust tone and thresholds as needed.
  4. Toggle the workflow to active and ensure webhook credentials/routes are set.

Important: The imported JSON may contain credential IDs — replace them with your own n8n credentials.


Document ingestion (Doc → Pinecone)

There is a companion workflow doc-to-pinecone.json that:

  • Downloads Google Doc content (via Google Drive node)
  • Splits text (chunk size 500, overlap 50)
  • Computes OpenAI embeddings
  • Upserts vectors into Pinecone with namespace metadata

Usage:

  • Import into n8n.
  • Connect the Google Drive node to fetch a doc or set to run periodically.
  • Run once to seed the resorts namespace. Repeat with different doc sets for flights and activities or change the namespace parameter.

Tips:

  • Keep metadata (title, url, last_updated, source_type) with each vector.
  • Regularly re-index or implement incremental updates for freshness.

How to use (examples & webhook)

Sample webhook trigger payload

Send a POST to your n8n webhook with user preferences. Example:

json
POST /webhook/travel-agent
Content-Type: application/json

{
  "user": {
    "name": "Priya Sharma",
    "email": "priya@example.com"
  },
  "preferences": {
    "destination": "Kerala, India",
    "dates": {
      "from": "2026-02-10",
      "to": "2026-02-15"
    },
    "budget": "mid-range",
    "vibe": "relaxation + culture",
    "travelers": 2,
    "special_requests": "vegetarian meals, wheelchair access"
  }
}

cURL example to test

bash
curl -X POST https:///webhook/travel-agent \
  -H "Content-Type: application/json" \
  -d '{
    "user": {"name": "Priya Sharma", "email": "priya@example.com"},
    "preferences": {"destination":"Kerala, India","dates":{"from":"2026-02-10","to":"2026-02-15"},"budget":"mid-range","vibe":"relaxation + culture","travelers":2}
  }'

When triggered the agent will:

  1. Create an embedding for the query.
  2. Call Resorts/Flights/Activities tools (Pinecone retrieve).
  3. Build a day-by-day itinerary (HTML + plain-text).
  4. Send email to user.email via Gmail node (or send to an internal preview inbox if configured).

HTML itinerary template (example)

Below is a compact example you can use as a starting template inside the agent response (the agent should output emailBody with this structure).

html

  
    
    Your Itinerary
    
      body{font-family:Arial, Helvetica, sans-serif; line-height:1.5;}
      .hero{background:#f5f7fb;padding:20px;border-radius:10px;}
      .day{margin:16px 0;padding:12px;border-left:4px solid #2b7cff;background:#fff;border-radius:8px;}
      .section-title{font-weight:700;margin-bottom:8px;}
      .small{font-size:0.9rem;color:#666;}
    
  
  
    
      
# Your Trip — Kerala, Feb 10–15

      Prepared for Priya Sharma • Generated by Travel Agent Workflow

    

    
      Day 1 — Arrival & Relax
      Arrive at Cochin; transfer to The Backwater Resort. Evening: Houseboat cruise (2 hrs).

      Resort highlights: lagoon views, Ayurvedic spa, vegetarian menu.

    

    
    
    Notes: Flights shown are suggestions. Prices and availability should be confirmed before booking.

  

Plain-text fallback: Always include a plain-text summary below the HTML or as an alternate mime part.


System prompt (snippet / example)

Place this inside the Agent node systemMessage. The one below is an example — edit to match your brand voice and safety rules.

You are TravelAgentGPT, an assistant that MUST call three tools — Resorts, Flights, Activities — for any itinerary request.
Steps:
1) Call each tool using the user's preferences; fetch top 3 high-similarity results.
2) If any tool returns nothing, respond with a clarifying question instead of hallucinating.
3) Build a balanced day-by-day itinerary in HTML and plain-text.
4) Output JSON: { "subject": "...", "emailBody": "...", "summary": "..." }
5) Finally call the Send Itinerary tool to email the result.
Prioritize traveler comfort, logistical feasibility, and accessibility.

Security & best practices

  • Never commit API keys to the repo. Use n8n credentials or environment variables.
  • Rotate keys if a workflow export was shared publicly.
  • Validate recipient emails and confirm before auto-sending in production (add a preview/approval step).
  • Sanitize HTML outputs to avoid XSS if you ever host generated HTML on a public site. Use a sanitizer on the server before sending.
  • Limit PII in vector stores. Add pii=false metadata where possible and encrypt logs.
  • Monitor costs: track embeddings and LLM call volumes; set usage alerts.

Troubleshooting & testing checklist

  • No data returned from namespace? — Check Pinecone namespace names and index. Confirm the ingestion workflow completed successfully.
  • Agent ignoring tools? — Ensure the system prompt enforces tool calls, and the Agent node is wired to the tool nodes.
  • Email not sending? — Confirm Gmail credential in n8n, check daily sending limits, and inspect node error logs.
  • Poor retrieval quality? — Ensure embeddings used for ingestion and retrieval are the same model; increase chunk overlap or use better-quality source docs.
  • Large email truncated? — Reduce HTML size or convert to PDF attachment for long documents.
  • Relevance thresholds — Add logic to check top-k similarity scores; if below threshold (e.g., `).
  1. Add tests or documentation changes.
  2. Open a pull request describing the change and reasoning.

Please avoid adding secrets or credentials to PRs.


License

MIT License — see LICENSE file.
(Include proper author attribution if you're using third-party code or assets.)


Credits & references

  • Built for the 30 Days, 30 AI Agents series.
  • Uses n8n workflows, Pinecone vector DB, OpenAI/OpenRouter models, and Gmail for email delivery.

Contact

Want this deployed for your travel business (agency, DMC, corporate travel team, or hospitality group)?
Comment “Agent 14” or DM me on LinkedIn / open an issue in this repo and I’ll help with onboarding & customization.


Quick-start checklist (copy-paste)

  1. Create Pinecone index travel-index.
  2. Add OpenAI/OpenRouter & Pinecone credentials into n8n.
  3. Import travel-agent-workflow.json & doc-to-pinecone.json.
  4. Run doc-to-pinecone to seed resorts, flights, activities.
  5. Test webhook with sample payload (see README examples).
  6. Configure email preview before sending in production.

Explore more agents

30 open-source systems · full registry

Browse All 30 Agents