Skip to content

Instantly share code, notes, and snippets.

@emonakov
Last active November 17, 2025 10:57
Show Gist options
  • Select an option

  • Save emonakov/aab9c89473fb084d5554a12b8b8ec6d2 to your computer and use it in GitHub Desktop.

Select an option

Save emonakov/aab9c89473fb084d5554a12b8b8ec6d2 to your computer and use it in GitHub Desktop.

1. High-Level System Architecture

graph TB
    subgraph "Data Layer"
        Gems[("Gems DB<br/>name, headline, address,<br/>coordinates, keywords,<br/>images, features")]
        Services[("Services DB<br/>name, description,<br/>pricing, duration<br/>(TOUR type only)")]
    end
    
    subgraph "Embedding Layer"
        GemEmbed[("GemEmbeddings<br/>vector(1536)")]
        ServiceEmbed[("ServiceEmbeddings<br/>vector(1536)")]
        EmbedGen["Embedding Generator<br/>(OpenAI/Gemini)"]
    end
    
    subgraph "AI Generation Layer"
        VectorSearch["Vector Search<br/>(pgvector + HNSW)"]
        LLM["LLM<br/>(GPT-4/Claude)"]
    end
    
    subgraph "Output Layer"
        Itinerary[("Itinerary DB<br/>stops, services,<br/>suggestions")]
    end
    
    Gems -->|"one-time embed"| EmbedGen
    Services -->|"one-time embed"| EmbedGen
    EmbedGen --> GemEmbed
    EmbedGen --> ServiceEmbed
    
    GemEmbed --> VectorSearch
    ServiceEmbed --> VectorSearch
    
    VectorSearch -->|"relevant gems"| LLM
    LLM -->|"generated itinerary"| Itinerary
    VectorSearch -->|"relevant services"| Itinerary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment