# rob-mckenna/foundry-databricks-genie-connector architecture

> Architecture diagram of the GitHub repository rob-mckenna/foundry-databricks-genie-connector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rob-mckenna/foundry-databricks-genie-connector
- Repository: https://github.com/rob-mckenna/foundry-databricks-genie-connector

## Overview

This repository is a Foundry-to-Databricks Genie connector: it validates configuration and provisions a reusable Toolbox and OAuth project connection, which Foundry agents use to reach either Genie Agent or Genie One. The optional bootstrap provisions a dedicated test agent and can run a consent-aware smoke test; the separate test-agent command exercises an existing agent. Edges between runtime services follow the README’s documented flow. Source excerpts show CLI dispatch, setup and bootstrap ownership; the implementation of agent_test.py and some setup details was not sampled.

Main entry points: [`src/foundry_databricks_genie/cli.py`](https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/cli.py) (Command CLI), [`src/foundry_databricks_genie/setup.py`](https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/setup.py) (Resource setup), [`src/foundry_databricks_genie/bootstrap.py`](https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/bootstrap.py) (Test-agent bootstrap), [`src/foundry_databricks_genie/agent_test.py`](https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/agent_test.py) (Existing-agent test)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Configuration and CLI"]
  node_cli["Command CLI<br/>[cli.py]"]
  node_config["Configuration validation<br/>[config.py]"]
end

subgraph group_provision["Foundry provisioning"]
  node_setup["Resource setup<br/>[setup.py]"]
  node_toolbox["Reusable Toolbox"]
  node_project_connection["OAuth project connection"]
end

subgraph group_agent["Agent testing"]
  node_bootstrap["Test-agent bootstrap<br/>[bootstrap.py]"]
  node_agent_test["Existing-agent test<br/>[agent_test.py]"]
  node_smoke["Consent-aware smoke test<br/>[smoke.py]"]
  node_foundry_agent["Foundry agents"]
end

subgraph group_databricks["Databricks analytics"]
  node_databricks["Databricks workspace"]
  node_gateway["Unity Gateway"]
  node_genie_one["Genie One"]
  node_genie_agent["Curated Genie Agent"]
  node_unity_data[("Unity Catalog data")]
end

node_user(("Operator"))
node_azd["Azure Developer CLI"]
node_genie_user(("End user"))

node_user -->|"runs commands"| node_cli
node_cli -->|"loads settings"| node_config
node_cli -->|"dispatches setup"| node_setup
node_cli -->|"dispatches bootstrap"| node_bootstrap
node_cli -->|"dispatches test"| node_agent_test
node_setup -->|"runs provisioning commands"| node_azd
node_setup -->|"creates and checks"| node_toolbox
node_setup -->|"creates or verifies"| node_project_connection
node_bootstrap -->|"provisions resources"| node_setup
node_bootstrap -->|"runs optional test"| node_smoke
node_foundry_agent -->|"calls tools through"| node_toolbox
node_toolbox -->|"uses connection"| node_project_connection
node_project_connection -->|"authenticates to"| node_databricks
node_genie_user -->|"authorizes per user"| node_project_connection
node_databricks -->|"routes Genie One via"| node_gateway
node_gateway -->|"dispatches queries"| node_genie_one
node_databricks -->|"serves curated MCP"| node_genie_agent
node_genie_one -->|"queries governed data"| node_unity_data
node_genie_agent -->|"queries governed data"| node_unity_data
node_agent_test -->|"tests existing agent"| node_foundry_agent
node_smoke -->|"invokes test agent"| node_foundry_agent

click node_cli "https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/cli.py"
click node_config "https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/config.py"
click node_setup "https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/setup.py"
click node_bootstrap "https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/bootstrap.py"
click node_agent_test "https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/agent_test.py"
click node_smoke "https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/smoke.py"

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_cli,node_config,node_genie_user toneBlue
class node_setup,node_toolbox,node_project_connection toneAmber
class node_bootstrap,node_agent_test,node_smoke,node_foundry_agent toneMint
class node_databricks,node_gateway,node_genie_one,node_genie_agent,node_unity_data toneRose
class node_user,node_azd toneIndigo
```

## Components

### Configuration and CLI

- [Command CLI](https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/cli.py): `src/foundry_databricks_genie/cli.py`
- [Configuration validation](https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/config.py): `src/foundry_databricks_genie/config.py`

### Foundry provisioning

- [Resource setup](https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/setup.py): `src/foundry_databricks_genie/setup.py`
- **Reusable Toolbox**
- **OAuth project connection**

### Agent testing

- [Test-agent bootstrap](https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/bootstrap.py): `src/foundry_databricks_genie/bootstrap.py`
- [Existing-agent test](https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/agent_test.py): `src/foundry_databricks_genie/agent_test.py`
- [Consent-aware smoke test](https://github.com/rob-mckenna/foundry-databricks-genie-connector/blob/main/src/foundry_databricks_genie/smoke.py): `src/foundry_databricks_genie/smoke.py`
- **Foundry agents**

### Databricks analytics

- **Databricks workspace**
- **Unity Gateway**
- **Genie One**
- **Curated Genie Agent**
- **Unity Catalog data**

### Other components

- **Operator**
- **Azure Developer CLI**
- **End user**

## Connections

- Operator → Command CLI: runs commands (evidence: `README.md`)
- Command CLI → Configuration validation: loads settings (evidence: `src/foundry_databricks_genie/cli.py`)
- Command CLI → Resource setup: dispatches setup (evidence: `src/foundry_databricks_genie/cli.py`)
- Command CLI → Test-agent bootstrap: dispatches bootstrap (evidence: `src/foundry_databricks_genie/cli.py`)
- Command CLI → Existing-agent test: dispatches test (evidence: `src/foundry_databricks_genie/cli.py`)
- Resource setup → Azure Developer CLI: runs provisioning commands (evidence: `src/foundry_databricks_genie/setup.py`)
- Resource setup → Reusable Toolbox: creates and checks (evidence: `src/foundry_databricks_genie/setup.py`)
- Resource setup → OAuth project connection: creates or verifies (evidence: `src/foundry_databricks_genie/setup.py`)
- Test-agent bootstrap → Resource setup: provisions resources (evidence: `src/foundry_databricks_genie/bootstrap.py`)
- Test-agent bootstrap → Consent-aware smoke test: runs optional test (evidence: `src/foundry_databricks_genie/bootstrap.py`)
- Foundry agents → Reusable Toolbox: calls tools through (evidence: `README.md`)
- Reusable Toolbox → OAuth project connection: uses connection (evidence: `README.md`)
- OAuth project connection → Databricks workspace: authenticates to (evidence: `README.md`)
- End user → OAuth project connection: authorizes per user (evidence: `README.md`)
- Databricks workspace → Unity Gateway: routes Genie One via (evidence: `README.md`)
- Unity Gateway → Genie One: dispatches queries (evidence: `README.md`)
- Databricks workspace → Curated Genie Agent: serves curated MCP (evidence: `README.md`)
- Genie One → Unity Catalog data: queries governed data (evidence: `README.md`)
- Curated Genie Agent → Unity Catalog data: queries governed data (evidence: `README.md`)
- Existing-agent test → Foundry agents: tests existing agent (evidence: `README.md`)
- Consent-aware smoke test → Foundry agents: invokes test agent
