# tanujkumar24/travel-agent-n8n architecture

> Architecture diagram of the GitHub repository tanujkumar24/travel-agent-n8n, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tanujkumar24/travel-agent-n8n
- Repository: https://github.com/tanujkumar24/travel-agent-n8n

## Overview

##### Project type and purpose
- This is an open-source, low-code **AI-powered travel assistant** built on **n8n**. Its primary purpose is to orchestrate AI and API integrations—Mistral for NLP, Google Gemini for text generation, Eleven Labs for voice synthesis, Pinecone for vector search, plus Flights/Resort/Activity APIs—into a single, automated travel-planning workflow.

##### File structure
- Top level:
- LICENSE – licensing terms.
- README.md – project overview, features, tech stack, usage.
- Travel_Agent.json – the exported n8n workflow definition (all nodes and connections).
- There are no traditional “src” or “lib” folders; instead the entire logic lives in the JSON that defines the n8n graph.

##### README for additional insights
- Confirms event-driven handling via a webhook entry point.
- Describes 6 sequential steps: from user webhook > Mistral extraction > API calls for flights/resorts/activities > Google Gemini email draft > Eleven Labs TTS > webhook response.
- Tech stack highlights external AI services, vector DB, and low-code orchestration.

a. Main components
- “User” (external client)
- n8n Orchestrator (hosted engine or cloud)
- Webhook Listener Node
- Mistral AI Node
- Flights API Connector
- Resorts/Activities API Connector
- Pinecone Vector DB
- Google Gemini Email Node
- Eleven Labs TTS Node
- Response Webhook Node
b. Relationships & Data Flow
1. User → Webhook Listener
2. Listener → Mistral AI (extracts dates/locations)
3. Mistral → Flights API + Resorts/Activities APIs (parallel calls)
4. API results → Pinecone (optional vector search)
5. Aggregated data → Google Gemini (compose itinerary/email)
6. Generated text → Eleven Labs (voice synthesis)
7. Synthesized audio & structured JSON → Response Webhook → User
c. Architectural patterns & principles
- **Event-driven orchestration**: each n8n node is a self-contained service call.
- **Parallelization**: recommend showing Flights vs. Resorts/Activities as parallel branches.
- **Separation of concerns**: extraction vs. data retrieval vs. content generation vs. delivery.
d. Key technologies & integrations
- n8n workflow engine
- Mistral AI API
- Standard REST APIs (Flights, Resorts, Activities)
- Pinecone vector database
- Google Gemini AI
- Eleven Labs TTS
- Webhooks for inbound & outbound communication

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External User
    User((User)):::external

    %% Orchestration Layer
    subgraph "n8n Orchestrator" 
        direction TB
        WorkflowDef["Workflow Definition"]:::orchestration
        WebhookListener["Webhook Listener Node"]:::orchestration
        MistralAI["Mistral AI Node"]:::ai
        subgraph "API Calls" 
            direction TB
            FlightsAPI["Flights API Connector"]:::api
            ResortsActivitiesAPI["Resorts/Activities API Connector"]:::api
        end
        PineconeDB[(Pinecone Vector DB)]:::db
        GoogleGemini["Google Gemini Email Node"]:::ai
        ElevenLabsTTS["Eleven Labs TTS Node"]:::ai
        ResponseWebhook["Response Webhook Node"]:::orchestration
    end

    %% Connections
    User -->|"{userRequest}"| WebhookListener
    WebhookListener -->|"{location,date}"| MistralAI
    MistralAI -->|"{location,date}"| FlightsAPI
    MistralAI -->|"{location,date}"| ResortsActivitiesAPI
    FlightsAPI -->|FlightOffers| PineconeDB
    ResortsActivitiesAPI -->|ResortActivityData| PineconeDB
    PineconeDB -->|AggregatedData| GoogleGemini
    GoogleGemini -->|EmailDraft| ElevenLabsTTS
    ElevenLabsTTS -->|AudioFile,JSON| ResponseWebhook
    ResponseWebhook -->|"{itineraryPayload}"| User

    %% Legend
    subgraph "Legend"
        direction TB
        A["Blue: Orchestration"]:::orchestration
        B["Green: AI Services"]:::ai
        C["Orange: External APIs"]:::api
        D["Purple: Database"]:::db
        E["Gray: External Actor"]:::external
    end

    %% Click Events
    click WorkflowDef "https://github.com/tanujkumar24/travel-agent-n8n/blob/main/Travel_Agent.json"
    click WebhookListener "https://github.com/tanujkumar24/travel-agent-n8n/blob/main/Travel_Agent.json"
    click MistralAI "https://github.com/tanujkumar24/travel-agent-n8n/blob/main/Travel_Agent.json"
    click FlightsAPI "https://github.com/tanujkumar24/travel-agent-n8n/blob/main/Travel_Agent.json"
    click ResortsActivitiesAPI "https://github.com/tanujkumar24/travel-agent-n8n/blob/main/Travel_Agent.json"
    click PineconeDB "https://github.com/tanujkumar24/travel-agent-n8n/blob/main/Travel_Agent.json"
    click GoogleGemini "https://github.com/tanujkumar24/travel-agent-n8n/blob/main/Travel_Agent.json"
    click ElevenLabsTTS "https://github.com/tanujkumar24/travel-agent-n8n/blob/main/Travel_Agent.json"
    click ResponseWebhook "https://github.com/tanujkumar24/travel-agent-n8n/blob/main/Travel_Agent.json"
    click WorkflowDef "https://github.com/tanujkumar24/travel-agent-n8n/blob/main/README.md"
    click WorkflowDef "https://github.com/tanujkumar24/travel-agent-n8n/tree/main/LICENSE"

    %% Styles
    classDef orchestration fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef ai fill:#90EE90,stroke:#000,stroke-width:1px
    classDef api fill:#FFA500,stroke:#000,stroke-width:1px
    classDef db fill:#DDA0DD,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
```
