# elouansalaun/lidar_agent architecture

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

- Interactive diagram: https://gitdiagram.com/elouansalaun/lidar_agent
- Repository: https://github.com/elouansalaun/lidar_agent

## Overview

LiDAR AI Agent answers Montreal-area questions by loading and processing airborne point clouds, classifying points, extracting and filtering buildings, validating tool results, and presenting answers with maps and visualizations. Users can run this through the agent or a fixed-parameter pipeline UI; the repository also includes a model-training and evaluation path. The README documents the main pipeline and agent capabilities; some subsystem links below rely on that documentation and the SOURCE INDEX rather than sampled implementation excerpts.

Main entry points: [`src/tools/registry.py`](https://github.com/elouansalaun/lidar_agent/blob/main/src/tools/registry.py) (Tool registry), [`streamlit_app.py`](https://github.com/elouansalaun/lidar_agent/blob/main/streamlit_app.py) (Streamlit interface), [`src/agent/graph.py`](https://github.com/elouansalaun/lidar_agent/blob/main/src/agent/graph.py) (Agent graph), [`src/tools/lidar_tools.py`](https://github.com/elouansalaun/lidar_agent/blob/main/src/tools/lidar_tools.py) (LiDAR tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_streamlit["Streamlit interface<br/>[streamlit_app.py]"]
  node_workflow["Fixed workflow<br/>[workflow.py]"]
end

subgraph group_agent["Agent and orchestration"]
  node_agent_graph["Agent graph<br/>[graph.py]"]
  node_llm["LLM adapter<br/>[llm.py]"]
  node_offline["Offline planner<br/>[offline.py]"]
  node_validator["Result validator<br/>[validator.py]"]
  node_registry["Tool registry<br/>[registry.py]"]
end

subgraph group_processing["LiDAR processing"]
  node_lidar_tools["LiDAR tools<br/>[lidar_tools.py]"]
  node_point_io["Point-cloud I/O<br/>[io.py]"]
  node_ground["Ground normalization<br/>[ground.py]"]
  node_features["Feature extraction<br/>[features.py]"]
end

subgraph group_analysis["Classification and buildings"]
  node_classifier["Point classifier<br/>[classify.py]"]
  node_ml_tools["Classification tools<br/>[ml_tools.py]"]
  node_dataset["Training dataset<br/>[dataset.py]"]
  node_buildings["Building analysis<br/>[analysis.py]"]
  node_gis_tools["GIS tools<br/>[gis_tools.py]"]
end

subgraph group_results["Visualization and data"]
  node_map["Interactive maps<br/>[maps.py]"]
  node_figures["Result views<br/>[figures.py]"]
  node_raw_tiles["Raw LiDAR tiles"]
  node_processed["Processed data"]
  node_outputs["Generated outputs"]
end

node_user(("Questioner"))
node_claude["Claude API"]

node_user -->|"asks question"| node_streamlit
node_streamlit -->|"runs agent"| node_agent_graph
node_streamlit -->|"runs pipeline mode"| node_workflow
node_agent_graph -->|"requests plan"| node_llm
node_llm -->|"calls API"| node_claude
node_llm -->|"selects fallback"| node_offline
node_agent_graph -->|"dispatches tools"| node_registry
node_agent_graph -->|"validates results"| node_validator
node_workflow -->|"runs tools"| node_registry
node_workflow -->|"checks results"| node_validator
node_registry -->|"registers tools"| node_lidar_tools
node_registry -->|"registers tools"| node_ml_tools
node_registry -->|"registers tools"| node_gis_tools
node_lidar_tools -->|"loads and saves"| node_point_io
node_point_io -->|"reads tiles"| node_raw_tiles
node_lidar_tools -->|"normalizes height"| node_ground
node_lidar_tools -->|"preprocesses points"| node_features
node_ml_tools -->|"classifies points"| node_classifier
node_classifier -->|"computes features"| node_features
node_gis_tools -->|"extracts buildings"| node_buildings
node_gis_tools -->|"creates map"| node_map
node_buildings -->|"supplies footprints"| node_map
node_dataset -->|"builds samples"| node_features
node_dataset -->|"loads blocks"| node_point_io
node_point_io -->|"writes intermediates"| node_processed
node_map -->|"saves map"| node_outputs
node_streamlit -->|"renders results"| node_figures

click node_streamlit "https://github.com/elouansalaun/lidar_agent/blob/main/streamlit_app.py"
click node_workflow "https://github.com/elouansalaun/lidar_agent/blob/main/src/workflow.py"
click node_agent_graph "https://github.com/elouansalaun/lidar_agent/blob/main/src/agent/graph.py"
click node_llm "https://github.com/elouansalaun/lidar_agent/blob/main/src/agent/llm.py"
click node_offline "https://github.com/elouansalaun/lidar_agent/blob/main/src/agent/offline.py"
click node_validator "https://github.com/elouansalaun/lidar_agent/blob/main/src/agent/validator.py"
click node_registry "https://github.com/elouansalaun/lidar_agent/blob/main/src/tools/registry.py"
click node_lidar_tools "https://github.com/elouansalaun/lidar_agent/blob/main/src/tools/lidar_tools.py"
click node_point_io "https://github.com/elouansalaun/lidar_agent/blob/main/src/lidar/io.py"
click node_ground "https://github.com/elouansalaun/lidar_agent/blob/main/src/lidar/ground.py"
click node_features "https://github.com/elouansalaun/lidar_agent/blob/main/src/lidar/features.py"
click node_classifier "https://github.com/elouansalaun/lidar_agent/blob/main/src/ml/classify.py"
click node_ml_tools "https://github.com/elouansalaun/lidar_agent/blob/main/src/tools/ml_tools.py"
click node_dataset "https://github.com/elouansalaun/lidar_agent/blob/main/src/ml/dataset.py"
click node_buildings "https://github.com/elouansalaun/lidar_agent/blob/main/src/buildings/analysis.py"
click node_gis_tools "https://github.com/elouansalaun/lidar_agent/blob/main/src/tools/gis_tools.py"
click node_map "https://github.com/elouansalaun/lidar_agent/blob/main/src/visualization/maps.py"
click node_figures "https://github.com/elouansalaun/lidar_agent/blob/main/src/visualization/figures.py"
click node_raw_tiles "https://github.com/elouansalaun/lidar_agent/tree/main/data/raw_tiles"
click node_processed "https://github.com/elouansalaun/lidar_agent/tree/main/data/processed"
click node_outputs "https://github.com/elouansalaun/lidar_agent/tree/main/data/outputs"

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_streamlit,node_workflow toneBlue
class node_agent_graph,node_llm,node_offline,node_validator,node_registry toneAmber
class node_lidar_tools,node_point_io,node_ground,node_features,node_claude toneMint
class node_classifier,node_ml_tools,node_dataset,node_buildings,node_gis_tools toneRose
class node_map,node_figures,node_raw_tiles,node_processed,node_outputs,node_user toneIndigo
```

## Components

### User interfaces

- [Streamlit interface](https://github.com/elouansalaun/lidar_agent/blob/main/streamlit_app.py): `streamlit_app.py`
- [Fixed workflow](https://github.com/elouansalaun/lidar_agent/blob/main/src/workflow.py): `src/workflow.py`

### Agent and orchestration

- [Agent graph](https://github.com/elouansalaun/lidar_agent/blob/main/src/agent/graph.py): `src/agent/graph.py`
- [LLM adapter](https://github.com/elouansalaun/lidar_agent/blob/main/src/agent/llm.py): `src/agent/llm.py`
- [Offline planner](https://github.com/elouansalaun/lidar_agent/blob/main/src/agent/offline.py): `src/agent/offline.py`
- [Result validator](https://github.com/elouansalaun/lidar_agent/blob/main/src/agent/validator.py): `src/agent/validator.py`
- [Tool registry](https://github.com/elouansalaun/lidar_agent/blob/main/src/tools/registry.py): `src/tools/registry.py`

### LiDAR processing

- [LiDAR tools](https://github.com/elouansalaun/lidar_agent/blob/main/src/tools/lidar_tools.py): `src/tools/lidar_tools.py`
- [Point-cloud I/O](https://github.com/elouansalaun/lidar_agent/blob/main/src/lidar/io.py): `src/lidar/io.py`
- [Ground normalization](https://github.com/elouansalaun/lidar_agent/blob/main/src/lidar/ground.py): `src/lidar/ground.py`
- [Feature extraction](https://github.com/elouansalaun/lidar_agent/blob/main/src/lidar/features.py): `src/lidar/features.py`

### Classification and buildings

- [Point classifier](https://github.com/elouansalaun/lidar_agent/blob/main/src/ml/classify.py): `src/ml/classify.py`
- [Classification tools](https://github.com/elouansalaun/lidar_agent/blob/main/src/tools/ml_tools.py): `src/tools/ml_tools.py`
- [Training dataset](https://github.com/elouansalaun/lidar_agent/blob/main/src/ml/dataset.py): `src/ml/dataset.py`
- [Building analysis](https://github.com/elouansalaun/lidar_agent/blob/main/src/buildings/analysis.py): `src/buildings/analysis.py`
- [GIS tools](https://github.com/elouansalaun/lidar_agent/blob/main/src/tools/gis_tools.py): `src/tools/gis_tools.py`

### Visualization and data

- [Interactive maps](https://github.com/elouansalaun/lidar_agent/blob/main/src/visualization/maps.py): `src/visualization/maps.py`
- [Result views](https://github.com/elouansalaun/lidar_agent/blob/main/src/visualization/figures.py): `src/visualization/figures.py`
- [Raw LiDAR tiles](https://github.com/elouansalaun/lidar_agent/tree/main/data/raw_tiles): `data/raw_tiles`
- [Processed data](https://github.com/elouansalaun/lidar_agent/tree/main/data/processed): `data/processed`
- [Generated outputs](https://github.com/elouansalaun/lidar_agent/tree/main/data/outputs): `data/outputs`

### Other components

- **Questioner**
- **Claude API**

## Connections

- Questioner → Streamlit interface: asks question (evidence: `README.md`)
- Streamlit interface → Agent graph: runs agent (evidence: `streamlit_app.py`)
- Streamlit interface → Fixed workflow: runs pipeline mode (evidence: `README.md`)
- Agent graph → LLM adapter: requests plan (evidence: `src/agent/graph.py`)
- LLM adapter → Claude API: calls API (evidence: `src/agent/llm.py`)
- LLM adapter → Offline planner: selects fallback (evidence: `src/agent/llm.py`)
- Agent graph → Tool registry: dispatches tools (evidence: `src/agent/graph.py`)
- Agent graph → Result validator: validates results (evidence: `src/agent/graph.py`)
- Fixed workflow → Tool registry: runs tools (evidence: `src/workflow.py`)
- Fixed workflow → Result validator: checks results (evidence: `src/workflow.py`)
- Tool registry → LiDAR tools: registers tools (evidence: `src/tools/lidar_tools.py`)
- Tool registry → Classification tools: registers tools (evidence: `src/tools/ml_tools.py`)
- Tool registry → GIS tools: registers tools (evidence: `src/tools/gis_tools.py`)
- LiDAR tools → Point-cloud I/O: loads and saves (evidence: `src/tools/lidar_tools.py`)
- Point-cloud I/O → Raw LiDAR tiles: reads tiles (evidence: `README.md`)
- LiDAR tools → Ground normalization: normalizes height (evidence: `src/tools/lidar_tools.py`)
- LiDAR tools → Feature extraction: preprocesses points
- Classification tools → Point classifier: classifies points (evidence: `src/tools/ml_tools.py`)
- Point classifier → Feature extraction: computes features (evidence: `src/ml/classify.py`)
- GIS tools → Building analysis: extracts buildings (evidence: `src/tools/gis_tools.py`)
- GIS tools → Interactive maps: creates map (evidence: `src/tools/gis_tools.py`)
- Building analysis → Interactive maps: supplies footprints (evidence: `README.md`)
- Training dataset → Feature extraction: builds samples (evidence: `src/ml/dataset.py`)
- Training dataset → Point-cloud I/O: loads blocks (evidence: `src/ml/dataset.py`)
- Point-cloud I/O → Processed data: writes intermediates
- Interactive maps → Generated outputs: saves map (evidence: `README.md`)
- Streamlit interface → Result views: renders results (evidence: `streamlit_app.py`)
