# databricks-solutions/lakebase-for-ai-developers architecture

> Architecture diagram of the GitHub repository databricks-solutions/lakebase-for-ai-developers, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/databricks-solutions/lakebase-for-ai-developers
- Repository: https://github.com/databricks-solutions/lakebase-for-ai-developers

## Overview

This is a manufacturing supply-chain planner copilot: a planner submits a question, the graph routes it to parallel knowledge, analytics, and operational gathering, then hydrates memory, proposes a plan, and pauses for approval when needed before commit. The React app provides chat, review, and backend exploration; Lakebase backs resumable state and memory, while Genie and retrieval services supply evidence. Evaluation and data preparation are separate product-support branches. Some subsystem links are documented in the README; unsampled implementations are represented only at paths supported by the tree or source index.

Main entry points: [`agent_server/graph/planner.py`](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/planner.py) (Plan and gate), [`frontend/src/App.tsx`](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/frontend/src/App.tsx) (React app), [`agent_server/graph/gather_nodes.py`](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/gather_nodes.py) (Gather agents), [`agent_server/agent.py`](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/agent.py) (Agent adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Planner experience"]
  node_web_ui["React app<br/>[App.tsx]"]
  node_chat_panel["Chat panel<br/>[ChatPanel.tsx]"]
  node_review_panel["Approval review<br/>[ReviewPanel.tsx]"]
  node_explorer["Backend explorer<br/>[ExplorerDrawer.tsx]"]
  node_backend_api["Agent API<br/>[webapp.py]"]
end

subgraph group_orchestration["Agent workflow"]
  node_agent_adapter["Agent adapter<br/>[agent.py]"]
  node_graph["Graph assembly<br/>[build_graph.py]"]
  node_supervisor["Supervisor routing<br/>[supervisor.py]"]
  node_planner_gate["Plan and gate<br/>[planner.py]"]
  node_approval["Human approval<br/>[planner.py]"]
  node_contracts["Shared contracts<br/>[contracts.py]"]
  node_config["Runtime settings<br/>[config.py]"]
end

subgraph group_evidence["Evidence retrieval"]
  node_gatherers["Gather agents<br/>[gather_nodes.py]"]
  node_knowledge["Knowledge retrieval<br/>[knowledge_tool.py]"]
  node_genie["Genie analytics<br/>[genie_tool.py]"]
  node_operational["Operational retrieval<br/>[operational_db.py]"]
end

subgraph group_persistence["State and memory"]
  node_memory_hydration["Memory hydration<br/>[memory_nodes.py]"]
  node_memory_policy["Memory policy<br/>[memory.py]"]
  node_lakebase[("Lakebase state<br/>[lakebase.py]")]
end

subgraph group_support["Data and evaluation"]
  node_genie_setup["Genie setup<br/>[genie_config.py]"]
  node_knowledge_ingest["Knowledge ingestion"]
  node_operational_seed["Operational data setup"]
  node_evaluation["Agent evaluation<br/>[runners.py]"]
  node_eval_reports["Evaluation reports<br/>[report.py]"]
end

node_planner_user(("Planner"))
node_genie_service["Databricks Genie"]
node_vector_search[("Mosaic Vector Search")]
node_mlflow["MLflow tracing"]

node_planner_user -->|"asks"| node_web_ui
node_web_ui -->|"renders"| node_chat_panel
node_chat_panel -->|"sends chat"| node_backend_api
node_web_ui -->|"resumes approval"| node_backend_api
node_web_ui -->|"presents review"| node_review_panel
node_web_ui -->|"opens explorer"| node_explorer
node_backend_api -->|"serves agent"| node_agent_adapter
node_agent_adapter -->|"runs graph"| node_graph
node_graph -->|"starts routing"| node_supervisor
node_supervisor -->|"dispatches"| node_gatherers
node_gatherers -.->|"retrieves knowledge"| node_knowledge
node_gatherers -.->|"queries analytics"| node_genie
node_gatherers -.->|"queries operations"| node_operational
node_knowledge -->|"searches index"| node_vector_search
node_genie -->|"queries"| node_genie_service
node_operational -->|"hybrid queries"| node_lakebase
node_gatherers -->|"fan in"| node_memory_hydration
node_memory_hydration -->|"supplies context"| node_planner_gate
node_memory_hydration -.->|"uses memory"| node_memory_policy
node_memory_policy -->|"stores memories"| node_lakebase
node_graph -->|"routes workflow"| node_planner_gate
node_planner_gate -->|"interrupts for review"| node_approval
node_approval -->|"resumes decision"| node_planner_gate
node_planner_gate -->|"checkpoints and commits"| node_lakebase
node_agent_adapter -->|"traces run"| node_mlflow
node_planner_gate -->|"uses shared shapes"| node_contracts
node_agent_adapter -->|"reads settings"| node_config
node_knowledge_ingest -->|"builds index"| node_vector_search
node_genie_setup -->|"configures space"| node_genie_service
node_operational_seed -->|"seeds data"| node_lakebase
node_evaluation -->|"evaluates runs"| node_graph
node_evaluation -.->|"writes results"| node_eval_reports

click node_web_ui "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/frontend/src/App.tsx"
click node_chat_panel "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/frontend/src/components/ChatPanel.tsx"
click node_review_panel "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/frontend/src/components/ReviewPanel.tsx"
click node_explorer "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/frontend/src/components/ExplorerDrawer.tsx"
click node_backend_api "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/webapp.py"
click node_agent_adapter "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/agent.py"
click node_graph "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/build_graph.py"
click node_supervisor "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/supervisor.py"
click node_gatherers "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/gather_nodes.py"
click node_knowledge "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/tools/knowledge_tool.py"
click node_genie "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/tools/genie_tool.py"
click node_operational "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/operational_db.py"
click node_planner_gate "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/planner.py"
click node_approval "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/planner.py"
click node_contracts "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/contracts.py"
click node_config "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/config.py"
click node_memory_hydration "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/memory_nodes.py"
click node_memory_policy "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/memory.py"
click node_lakebase "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/lakebase.py"
click node_genie_setup "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/data/genie/genie_config.py"
click node_knowledge_ingest "https://github.com/databricks-solutions/lakebase-for-ai-developers/tree/main/data/knowledge"
click node_operational_seed "https://github.com/databricks-solutions/lakebase-for-ai-developers/tree/main/data/operational"
click node_evaluation "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/evaluation/runners.py"
click node_eval_reports "https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/evaluation/report.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_web_ui,node_chat_panel,node_review_panel,node_explorer,node_backend_api toneBlue
class node_agent_adapter,node_graph,node_supervisor,node_planner_gate,node_approval,node_contracts,node_config,node_vector_search toneAmber
class node_gatherers,node_knowledge,node_genie,node_operational toneMint
class node_memory_hydration,node_memory_policy,node_lakebase toneRose
class node_genie_setup,node_knowledge_ingest,node_operational_seed,node_evaluation,node_eval_reports,node_planner_user,node_genie_service,node_mlflow toneIndigo
```

## Components

### Planner experience

- [React app](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Chat panel](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/frontend/src/components/ChatPanel.tsx): `frontend/src/components/ChatPanel.tsx`
- [Approval review](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/frontend/src/components/ReviewPanel.tsx): `frontend/src/components/ReviewPanel.tsx`
- [Backend explorer](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/frontend/src/components/ExplorerDrawer.tsx): `frontend/src/components/ExplorerDrawer.tsx`
- [Agent API](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/webapp.py): `agent_server/webapp.py`

### Agent workflow

- [Agent adapter](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/agent.py): `agent_server/agent.py`
- [Graph assembly](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/build_graph.py): `agent_server/graph/build_graph.py`
- [Supervisor routing](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/supervisor.py): `agent_server/graph/supervisor.py`
- [Plan and gate](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/planner.py): `agent_server/graph/planner.py`
- [Human approval](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/planner.py): `agent_server/graph/planner.py`
- [Shared contracts](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/contracts.py): `agent_server/contracts.py`
- [Runtime settings](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/config.py): `agent_server/config.py`

### Evidence retrieval

- [Gather agents](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/gather_nodes.py): `agent_server/graph/gather_nodes.py`
- [Knowledge retrieval](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/tools/knowledge_tool.py): `agent_server/tools/knowledge_tool.py`
- [Genie analytics](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/tools/genie_tool.py): `agent_server/tools/genie_tool.py`
- [Operational retrieval](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/operational_db.py): `agent_server/operational_db.py`

### State and memory

- [Memory hydration](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/graph/memory_nodes.py): `agent_server/graph/memory_nodes.py`
- [Memory policy](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/memory.py): `agent_server/memory.py`
- [Lakebase state](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/lakebase.py): `agent_server/lakebase.py`

### Data and evaluation

- [Genie setup](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/data/genie/genie_config.py): `data/genie/genie_config.py`
- [Knowledge ingestion](https://github.com/databricks-solutions/lakebase-for-ai-developers/tree/main/data/knowledge): `data/knowledge`
- [Operational data setup](https://github.com/databricks-solutions/lakebase-for-ai-developers/tree/main/data/operational): `data/operational`
- [Agent evaluation](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/evaluation/runners.py): `agent_server/evaluation/runners.py`
- [Evaluation reports](https://github.com/databricks-solutions/lakebase-for-ai-developers/blob/main/agent_server/evaluation/report.py): `agent_server/evaluation/report.py`

### Other components

- **Planner**
- **Databricks Genie**
- **Mosaic Vector Search**
- **MLflow tracing**

## Connections

- Planner → React app: asks (evidence: `README.md`)
- React app → Chat panel: renders (evidence: `frontend/src/App.tsx`)
- Chat panel → Agent API: sends chat (evidence: `frontend/src/components/ChatPanel.tsx`)
- React app → Agent API: resumes approval (evidence: `frontend/src/App.tsx`)
- React app → Approval review: presents review (evidence: `README.md`)
- React app → Backend explorer: opens explorer (evidence: `frontend/src/App.tsx`)
- Agent API → Agent adapter: serves agent (evidence: `agent_server/webapp.py`)
- Agent adapter → Graph assembly: runs graph (evidence: `agent_server/agent.py`)
- Graph assembly → Supervisor routing: starts routing (evidence: `agent_server/graph/build_graph.py`)
- Supervisor routing → Gather agents: dispatches (evidence: `agent_server/graph/build_graph.py`)
- Gather agents → Knowledge retrieval: retrieves knowledge
- Gather agents → Genie analytics: queries analytics
- Gather agents → Operational retrieval: queries operations
- Knowledge retrieval → Mosaic Vector Search: searches index (evidence: `README.md`)
- Genie analytics → Databricks Genie: queries (evidence: `README.md`)
- Operational retrieval → Lakebase state: hybrid queries (evidence: `README.md`)
- Gather agents → Memory hydration: fan in (evidence: `agent_server/graph/build_graph.py`)
- Memory hydration → Plan and gate: supplies context (evidence: `agent_server/graph/build_graph.py`)
- Memory hydration → Memory policy: uses memory
- Memory policy → Lakebase state: stores memories (evidence: `README.md`)
- Graph assembly → Plan and gate: routes workflow (evidence: `agent_server/graph/build_graph.py`)
- Plan and gate → Human approval: interrupts for review (evidence: `README.md`)
- Human approval → Plan and gate: resumes decision (evidence: `README.md`)
- Plan and gate → Lakebase state: checkpoints and commits (evidence: `README.md`)
- Agent adapter → MLflow tracing: traces run (evidence: `README.md`)
- Plan and gate → Shared contracts: uses shared shapes (evidence: `agent_server/graph/planner.py`)
- Agent adapter → Runtime settings: reads settings (evidence: `agent_server/agent.py`)
- Knowledge ingestion → Mosaic Vector Search: builds index (evidence: `README.md`)
- Genie setup → Databricks Genie: configures space (evidence: `README.md`)
- Operational data setup → Lakebase state: seeds data (evidence: `README.md`)
- Agent evaluation → Graph assembly: evaluates runs (evidence: `agent_server/evaluation/runners.py`)
- Agent evaluation → Evaluation reports: writes results
