# drehnstrom/genai-notebooks architecture

> Architecture diagram of the GitHub repository drehnstrom/genai-notebooks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/drehnstrom/genai-notebooks
- Repository: https://github.com/drehnstrom/genai-notebooks

## Overview

This repository is a collection of Google AI/Vertex AI learning examples, alongside a Flask chatbot that accepts a question and returns a Gemini or PaLM response. The chatbot’s request handling, model calls, Markdown formatting, and HTML rendering are visible in the sampled source. The notebook and prompt-example files indicate additional capabilities, but their internal workflows are not shown; they are represented as standalone examples rather than connected components.

Main entry points: [`flask-demo/main.py`](https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/main.py) (Chat Handler), [`flask-demo/config.yaml`](https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/config.yaml) (App Config), [`flask-demo/templates/index.html`](https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/templates/index.html) (Chat View)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chat["Flask Chatbot"]
  node_handler["Chat Handler<br/>[main.py]"]
  node_config["App Config<br/>[config.yaml]"]
  node_gemini["Gemini Response<br/>[main.py]"]
  node_palm["PaLM Response<br/>[main.py]"]
  node_format["Markdown Format<br/>[main.py]"]
  node_template["Chat View<br/>[index.html]"]
end

subgraph group_models["Model Examples"]
  node_basicgpt["Basic GPT"]
  node_basicgemini["Basic Gemini"]
  node_claude["Claude Intro"]
  node_geminiex["Gemini Examples"]
  node_palmex["PaLM Examples"]
  node_imagen["Imagen Examples"]
  node_function["Function Calling"]
  node_codegen["Code Generation"]
  node_evaluation["Evaluation Demo"]
  node_unittest["Gemini Testing"]
  node_weather["Weather Alerts"]
end

subgraph group_retrieval["Data and Retrieval"]
  node_embeddings["Text Embeddings"]
  node_bigqueryvectors["BigQuery Vectors"]
  node_bigquerysearch["BigQuery Search"]
  node_bigqueryqa["BigQuery Q&amp;A"]
  node_embeddingqa["Embedding Q&amp;A"]
  node_vector["Vector Search"]
  node_discovery["Discovery Data Store"]
  node_langchainqa["LangChain Data Q&amp;A"]
  node_langchainsql["LangChain SQL"]
  node_langchain["LangChain Basics"]
  node_langchaincommunity["LangChain Community"]
  node_summary["Document Summary"]
end

subgraph group_prompts["Prompt Examples"]
  node_promptfiles["Prompt Patterns"]
end

node_visitor(("Visitor"))

node_visitor -->|"submits request"| node_handler
node_handler -->|"reads settings"| node_config
node_handler -->|"calls Gemini"| node_gemini
node_handler -->|"calls PaLM"| node_palm
node_handler -->|"formats response"| node_format
node_handler -->|"renders view"| node_template

click node_handler "https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/main.py"
click node_config "https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/config.yaml"
click node_gemini "https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/main.py"
click node_palm "https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/main.py"
click node_format "https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/main.py"
click node_template "https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/templates/index.html"
click node_basicgpt "https://github.com/drehnstrom/genai-notebooks/blob/main/Basic%20GPT%20Code.ipynb"
click node_basicgemini "https://github.com/drehnstrom/genai-notebooks/blob/main/Basic%20Gemini%20Code.ipynb"
click node_claude "https://github.com/drehnstrom/genai-notebooks/blob/main/Anthropic%20Claude%203%20Intro.ipynb"
click node_geminiex "https://github.com/drehnstrom/genai-notebooks/blob/main/Gemini%20Examples.ipynb"
click node_palmex "https://github.com/drehnstrom/genai-notebooks/blob/main/PaLM%20Examples.ipynb"
click node_imagen "https://github.com/drehnstrom/genai-notebooks/blob/main/Imagen%20Examples.ipynb"
click node_function "https://github.com/drehnstrom/genai-notebooks/blob/main/Function%20Calling%20Demo.ipynb"
click node_codegen "https://github.com/drehnstrom/genai-notebooks/blob/main/Code%20Generation.ipynb"
click node_evaluation "https://github.com/drehnstrom/genai-notebooks/blob/main/Evaluation%20API%20Demo.ipynb"
click node_unittest "https://github.com/drehnstrom/genai-notebooks/blob/main/Unit%20Testing%20Gemini.ipynb"
click node_embeddings "https://github.com/drehnstrom/genai-notebooks/blob/main/Text%20Embeddings%20Demo.ipynb"
click node_bigqueryvectors "https://github.com/drehnstrom/genai-notebooks/blob/main/Embeddings_%20Store%20Vectors%20in%20BigQuery.ipynb"
click node_bigquerysearch "https://github.com/drehnstrom/genai-notebooks/blob/main/Embeddings%20-%20Vector%20Search%20with%20BigQuery.ipynb"
click node_bigqueryqa "https://github.com/drehnstrom/genai-notebooks/blob/main/Embeddings%20Q%26A%20with%20BigQuery.ipynb"
click node_embeddingqa "https://github.com/drehnstrom/genai-notebooks/blob/main/Embeddings%20QA%20Example.ipynb"
click node_vector "https://github.com/drehnstrom/genai-notebooks/blob/main/Vector%20Search%20Tutorial.ipynb"
click node_discovery "https://github.com/drehnstrom/genai-notebooks/blob/main/Discovery%20API%20using%20Vertex%20AI%20Data%20Store.ipynb"
click node_langchainqa "https://github.com/drehnstrom/genai-notebooks/blob/main/LangChain%20QA%20with%20Data%20Store.ipynb"
click node_langchainsql "https://github.com/drehnstrom/genai-notebooks/blob/main/LangChain%20NL%20to%20SQL.ipynb"
click node_langchain "https://github.com/drehnstrom/genai-notebooks/blob/main/LangChain%20Basics.ipynb"
click node_langchaincommunity "https://github.com/drehnstrom/genai-notebooks/blob/main/LangChain%20Google%20Community.ipynb"
click node_summary "https://github.com/drehnstrom/genai-notebooks/blob/main/Large%20Document%20Summarization.ipynb"
click node_promptfiles "https://github.com/drehnstrom/genai-notebooks/tree/main/prompt-examples"
click node_weather "https://github.com/drehnstrom/genai-notebooks/blob/main/gemini-weather-alerts-for-ariports.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_handler,node_config,node_gemini,node_palm,node_format,node_template toneBlue
class node_basicgpt,node_basicgemini,node_claude,node_geminiex,node_palmex,node_imagen,node_function,node_codegen,node_evaluation,node_unittest,node_weather toneAmber
class node_embeddings,node_bigqueryvectors,node_bigquerysearch,node_bigqueryqa,node_embeddingqa,node_vector,node_discovery,node_langchainqa,node_langchainsql,node_langchain,node_langchaincommunity,node_summary toneMint
class node_promptfiles toneRose
class node_visitor toneIndigo
```

## Components

### Flask Chatbot

- [Chat Handler](https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/main.py): `flask-demo/main.py`
- [App Config](https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/config.yaml): `flask-demo/config.yaml`
- [Gemini Response](https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/main.py): `flask-demo/main.py`
- [PaLM Response](https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/main.py): `flask-demo/main.py`
- [Markdown Format](https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/main.py): `flask-demo/main.py`
- [Chat View](https://github.com/drehnstrom/genai-notebooks/blob/main/flask-demo/templates/index.html): `flask-demo/templates/index.html`

### Model Examples

- [Basic GPT](https://github.com/drehnstrom/genai-notebooks/blob/main/Basic%20GPT%20Code.ipynb): `Basic GPT Code.ipynb`
- [Basic Gemini](https://github.com/drehnstrom/genai-notebooks/blob/main/Basic%20Gemini%20Code.ipynb): `Basic Gemini Code.ipynb`
- [Claude Intro](https://github.com/drehnstrom/genai-notebooks/blob/main/Anthropic%20Claude%203%20Intro.ipynb): `Anthropic Claude 3 Intro.ipynb`
- [Gemini Examples](https://github.com/drehnstrom/genai-notebooks/blob/main/Gemini%20Examples.ipynb): `Gemini Examples.ipynb`
- [PaLM Examples](https://github.com/drehnstrom/genai-notebooks/blob/main/PaLM%20Examples.ipynb): `PaLM Examples.ipynb`
- [Imagen Examples](https://github.com/drehnstrom/genai-notebooks/blob/main/Imagen%20Examples.ipynb): `Imagen Examples.ipynb`
- [Function Calling](https://github.com/drehnstrom/genai-notebooks/blob/main/Function%20Calling%20Demo.ipynb): `Function Calling Demo.ipynb`
- [Code Generation](https://github.com/drehnstrom/genai-notebooks/blob/main/Code%20Generation.ipynb): `Code Generation.ipynb`
- [Evaluation Demo](https://github.com/drehnstrom/genai-notebooks/blob/main/Evaluation%20API%20Demo.ipynb): `Evaluation API Demo.ipynb`
- [Gemini Testing](https://github.com/drehnstrom/genai-notebooks/blob/main/Unit%20Testing%20Gemini.ipynb): `Unit Testing Gemini.ipynb`
- [Weather Alerts](https://github.com/drehnstrom/genai-notebooks/blob/main/gemini-weather-alerts-for-ariports.ipynb): `gemini-weather-alerts-for-ariports.ipynb`

### Data and Retrieval

- [Text Embeddings](https://github.com/drehnstrom/genai-notebooks/blob/main/Text%20Embeddings%20Demo.ipynb): `Text Embeddings Demo.ipynb`
- [BigQuery Vectors](https://github.com/drehnstrom/genai-notebooks/blob/main/Embeddings_%20Store%20Vectors%20in%20BigQuery.ipynb): `Embeddings_ Store Vectors in BigQuery.ipynb`
- [BigQuery Search](https://github.com/drehnstrom/genai-notebooks/blob/main/Embeddings%20-%20Vector%20Search%20with%20BigQuery.ipynb): `Embeddings - Vector Search with BigQuery.ipynb`
- [BigQuery Q&A](https://github.com/drehnstrom/genai-notebooks/blob/main/Embeddings%20Q%26A%20with%20BigQuery.ipynb): `Embeddings Q&A with BigQuery.ipynb`
- [Embedding Q&A](https://github.com/drehnstrom/genai-notebooks/blob/main/Embeddings%20QA%20Example.ipynb): `Embeddings QA Example.ipynb`
- [Vector Search](https://github.com/drehnstrom/genai-notebooks/blob/main/Vector%20Search%20Tutorial.ipynb): `Vector Search Tutorial.ipynb`
- [Discovery Data Store](https://github.com/drehnstrom/genai-notebooks/blob/main/Discovery%20API%20using%20Vertex%20AI%20Data%20Store.ipynb): `Discovery API using Vertex AI Data Store.ipynb`
- [LangChain Data Q&A](https://github.com/drehnstrom/genai-notebooks/blob/main/LangChain%20QA%20with%20Data%20Store.ipynb): `LangChain QA with Data Store.ipynb`
- [LangChain SQL](https://github.com/drehnstrom/genai-notebooks/blob/main/LangChain%20NL%20to%20SQL.ipynb): `LangChain NL to SQL.ipynb`
- [LangChain Basics](https://github.com/drehnstrom/genai-notebooks/blob/main/LangChain%20Basics.ipynb): `LangChain Basics.ipynb`
- [LangChain Community](https://github.com/drehnstrom/genai-notebooks/blob/main/LangChain%20Google%20Community.ipynb): `LangChain Google Community.ipynb`
- [Document Summary](https://github.com/drehnstrom/genai-notebooks/blob/main/Large%20Document%20Summarization.ipynb): `Large Document Summarization.ipynb`

### Prompt Examples

- [Prompt Patterns](https://github.com/drehnstrom/genai-notebooks/tree/main/prompt-examples): `prompt-examples`

### Other components

- **Visitor**

## Connections

- Visitor → Chat Handler: submits request (evidence: `flask-demo/main.py`)
- Chat Handler → App Config: reads settings (evidence: `flask-demo/main.py`)
- Chat Handler → Gemini Response: calls Gemini (evidence: `flask-demo/main.py`)
- Chat Handler → PaLM Response: calls PaLM (evidence: `flask-demo/main.py`)
- Chat Handler → Markdown Format: formats response (evidence: `flask-demo/main.py`)
- Chat Handler → Chat View: renders view (evidence: `flask-demo/main.py`)
