# lefevrk/oc-entrainez-votre-agent-rl architecture

> Architecture diagram of the GitHub repository lefevrk/oc-entrainez-votre-agent-rl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lefevrk/oc-entrainez-votre-agent-rl
- Repository: https://github.com/lefevrk/oc-entrainez-votre-agent-rl
- Video tour (about a minute): https://gitdiagram.com/lefevrk/oc-entrainez-votre-agent-rl/video

## Overview

Eagle-1 is a local DQN lunar-lander autopilot exposed through an API, a Streamlit flight viewer, and an interactive performance dashboard. Users request an action or a complete flight; the API runs the pilot and simulator, records episodes, and serves history, video, and statistics for the interfaces to display. The README documents notebook-based API use as well. Relationships are based on the supplied excerpts, SOURCE INDEX references, and README; unsampled page and API internals are not inferred beyond those sources.

Main entry points: [`src/api/main.py`](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/api/main.py) (API endpoints), [`src/app/main.py`](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/app/main.py) (Streamlit app), [`src/rl_pilot/pilots.py`](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/pilots.py) (DQN pilot), [`src/rl_pilot/client.py`](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/client.py) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_streamlit["Streamlit app<br/>[main.py]"]
  node_flight_page["Flight viewer<br/>[partie.py]"]
  node_dashboard["Performance dashboard<br/>[tableau_de_bord.py]"]
  node_http_client["HTTP client<br/>[client.py]"]
end

subgraph group_service["API service"]
  node_api["API endpoints<br/>[main.py]"]
  node_schemas["Request and response schemas<br/>[schemas.py]"]
end

subgraph group_runtime["Flight runtime"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_pilot["DQN pilot<br/>[pilots.py]"]
  node_model["Trained DQN model"]
  node_simulation["LunarLander simulation<br/>[simulation.py]"]
end

subgraph group_history["History and analytics"]
  node_store[("Run history store<br/>[storage.py]")]
  node_stats["Run statistics<br/>[stats.py]"]
end

node_user(("User / notebook"))

node_user -->|"uses"| node_streamlit
node_user -->|"requests flights"| node_api
node_streamlit -->|"routes to"| node_flight_page
node_streamlit -->|"routes to"| node_dashboard
node_streamlit -->|"checks service"| node_http_client
node_flight_page -->|"requests and reads"| node_http_client
node_dashboard -->|"requests runs and stats"| node_http_client
node_http_client -->|"calls HTTP endpoints"| node_api
node_api -->|"validates and formats"| node_schemas
node_api -->|"gets runtime paths"| node_config
node_api -->|"loads and queries"| node_pilot
node_api -->|"runs episodes"| node_simulation
node_api -->|"records and reads"| node_store
node_api -->|"summarizes history"| node_stats
node_pilot -->|"gets model path"| node_config
node_pilot -->|"loads weights"| node_model
node_simulation -->|"requests decisions"| node_pilot
node_store -->|"stores episode data"| node_simulation
node_stats -->|"uses outcome thresholds"| node_simulation

click node_streamlit "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/app/main.py"
click node_flight_page "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/app/pages/partie.py"
click node_dashboard "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/app/pages/tableau_de_bord.py"
click node_http_client "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/client.py"
click node_api "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/api/main.py"
click node_schemas "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/api/schemas.py"
click node_config "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/config.py"
click node_pilot "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/pilots.py"
click node_model "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/models/dqn_lunarlander_best.zip"
click node_simulation "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/simulation.py"
click node_store "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/storage.py"
click node_stats "https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/stats.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_streamlit,node_flight_page,node_dashboard,node_http_client,node_user toneBlue
class node_api,node_schemas toneAmber
class node_config,node_pilot,node_model,node_simulation toneMint
class node_store,node_stats toneRose
```

## Components

### User interfaces

- [Streamlit app](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/app/main.py): `src/app/main.py`
- [Flight viewer](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/app/pages/partie.py): `src/app/pages/partie.py`
- [Performance dashboard](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/app/pages/tableau_de_bord.py): `src/app/pages/tableau_de_bord.py`
- [HTTP client](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/client.py): `src/rl_pilot/client.py`

### API service

- [API endpoints](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/api/main.py): `src/api/main.py`
- [Request and response schemas](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/api/schemas.py): `src/api/schemas.py`

### Flight runtime

- [Runtime configuration](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/config.py): `src/rl_pilot/config.py`
- [DQN pilot](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/pilots.py): `src/rl_pilot/pilots.py`
- [Trained DQN model](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/models/dqn_lunarlander_best.zip): `models/dqn_lunarlander_best.zip`
- [LunarLander simulation](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/simulation.py): `src/rl_pilot/simulation.py`

### History and analytics

- [Run history store](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/storage.py): `src/rl_pilot/storage.py`
- [Run statistics](https://github.com/lefevrk/oc-entrainez-votre-agent-rl/blob/main/src/rl_pilot/stats.py): `src/rl_pilot/stats.py`

### Other components

- **User / notebook**

## Connections

- User / notebook → Streamlit app: uses (evidence: `README.md`)
- User / notebook → API endpoints: requests flights (evidence: `README.md`)
- Streamlit app → Flight viewer: routes to (evidence: `src/app/main.py`)
- Streamlit app → Performance dashboard: routes to (evidence: `src/app/main.py`)
- Streamlit app → HTTP client: checks service (evidence: `src/app/main.py`)
- Flight viewer → HTTP client: requests and reads (evidence: `src/app/pages/partie.py`)
- Performance dashboard → HTTP client: requests runs and stats (evidence: `src/app/pages/tableau_de_bord.py`)
- HTTP client → API endpoints: calls HTTP endpoints (evidence: `src/rl_pilot/client.py`)
- API endpoints → Request and response schemas: validates and formats (evidence: `src/api/main.py`)
- API endpoints → Runtime configuration: gets runtime paths (evidence: `src/api/main.py`)
- API endpoints → DQN pilot: loads and queries (evidence: `src/api/main.py`)
- API endpoints → LunarLander simulation: runs episodes (evidence: `src/api/main.py`)
- API endpoints → Run history store: records and reads (evidence: `src/api/main.py`)
- API endpoints → Run statistics: summarizes history (evidence: `src/api/main.py`)
- DQN pilot → Runtime configuration: gets model path (evidence: `src/rl_pilot/pilots.py`)
- DQN pilot → Trained DQN model: loads weights (evidence: `src/rl_pilot/pilots.py`)
- LunarLander simulation → DQN pilot: requests decisions (evidence: `src/rl_pilot/simulation.py`)
- Run history store → LunarLander simulation: stores episode data (evidence: `src/rl_pilot/storage.py`)
- Run statistics → LunarLander simulation: uses outcome thresholds (evidence: `src/rl_pilot/stats.py`)
