# supoz9/edge-ai-education architecture

> Architecture diagram of the GitHub repository supoz9/edge-ai-education, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/supoz9/edge-ai-education
- Repository: https://github.com/supoz9/edge-ai-education

## Overview

Edge-AI-Education is a local Bac Pro CIEL tutoring system: a student asks through Open WebUI, the API retrieves permitted course passages, builds a Socratic prompt, and requests an answer from Ollama. Its distinct content stages are corpus organization, ingestion and chunking, hybrid retrieval, and guided generation. The graph includes the documented restricted-solution safeguard and historical agent profiles. Ingestion, retrieval, and API wiring are supported by sampled source; Open WebUI and deployment details come from the README and tree, so uncertain runtime links are omitted.

Main entry points: [`rag/ingest.py`](https://github.com/supoz9/edge-ai-education/blob/main/rag/ingest.py) (Corpus ingestion), [`api-openwebui/api.py`](https://github.com/supoz9/edge-ai-education/blob/main/api-openwebui/api.py) (Chat API), [`rag/retrieval.py`](https://github.com/supoz9/edge-ai-education/blob/main/rag/retrieval.py) (Hybrid retrieval), [`corpus_ciel/01_referentiel`](https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/01_referentiel) (Referentiel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Learning corpus"]
  node_referentiel["Referentiel"]
  node_cours["Courses"]
  node_tp["TP statements"]
  node_datasheets["Datasheets"]
  node_corriges["Restricted solutions"]
  node_aides["Restricted hints"]
end

subgraph group_rag["RAG pipeline"]
  node_ingest["Corpus ingestion<br/>[ingest.py]"]
  node_chunking["Metadata and chunks<br/>[chunking.py]"]
  node_retrieval["Hybrid retrieval<br/>[retrieval.py]"]
  node_chroma[("Chroma index")]
  node_embedder["BGE-M3 embedder"]
end

subgraph group_tutor["Tutoring runtime"]
  node_openwebui["Open WebUI"]
  node_api["Chat API<br/>[api.py]"]
  node_prompts["Socratic prompts<br/>[prompts.py]"]
  node_ollama["Ollama"]
end

subgraph group_agents["Agent profiles"]
  node_agents["Demo tutors"]
end

node_student(("Student"))

node_student -->|"asks through"| node_openwebui
node_openwebui -->|"sends chat"| node_api
node_api -->|"requests passages"| node_retrieval
node_api -->|"builds messages"| node_prompts
node_api -->|"requests generation"| node_ollama
node_api -->|"returns answer"| node_openwebui
node_referentiel -->|"read"| node_ingest
node_cours -->|"read"| node_ingest
node_tp -->|"read"| node_ingest
node_datasheets -->|"read"| node_ingest
node_corriges -->|"excluded by default"| node_ingest
node_aides -->|"excluded by default"| node_ingest
node_ingest -->|"parses and chunks"| node_chunking
node_ingest -->|"encodes chunks"| node_embedder
node_ingest -->|"writes vectors"| node_chroma
node_retrieval -->|"encodes query"| node_embedder
node_retrieval -->|"queries index"| node_chroma

click node_api "https://github.com/supoz9/edge-ai-education/blob/main/api-openwebui/api.py"
click node_prompts "https://github.com/supoz9/edge-ai-education/blob/main/api-openwebui/prompts.py"
click node_referentiel "https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/01_referentiel"
click node_cours "https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/02_cours"
click node_tp "https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/03_tp_enonces"
click node_datasheets "https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/04_datasheets"
click node_corriges "https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/05_corriges"
click node_aides "https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/06_coups_de_pouce"
click node_ingest "https://github.com/supoz9/edge-ai-education/blob/main/rag/ingest.py"
click node_chunking "https://github.com/supoz9/edge-ai-education/blob/main/rag/chunking.py"
click node_retrieval "https://github.com/supoz9/edge-ai-education/blob/main/rag/retrieval.py"
click node_agents "https://github.com/supoz9/edge-ai-education/tree/main/agents"

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_referentiel,node_cours,node_tp,node_datasheets,node_corriges,node_aides toneBlue
class node_ingest,node_chunking,node_retrieval,node_chroma,node_embedder toneAmber
class node_openwebui,node_api,node_prompts,node_ollama toneMint
class node_agents toneRose
class node_student toneIndigo
```

## Components

### Learning corpus

- [Referentiel](https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/01_referentiel): `corpus_ciel/01_referentiel`
- [Courses](https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/02_cours): `corpus_ciel/02_cours`
- [TP statements](https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/03_tp_enonces): `corpus_ciel/03_tp_enonces`
- [Datasheets](https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/04_datasheets): `corpus_ciel/04_datasheets`
- [Restricted solutions](https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/05_corriges): `corpus_ciel/05_corriges`
- [Restricted hints](https://github.com/supoz9/edge-ai-education/tree/main/corpus_ciel/06_coups_de_pouce): `corpus_ciel/06_coups_de_pouce`

### RAG pipeline

- [Corpus ingestion](https://github.com/supoz9/edge-ai-education/blob/main/rag/ingest.py): `rag/ingest.py`
- [Metadata and chunks](https://github.com/supoz9/edge-ai-education/blob/main/rag/chunking.py): `rag/chunking.py`
- [Hybrid retrieval](https://github.com/supoz9/edge-ai-education/blob/main/rag/retrieval.py): `rag/retrieval.py`
- **Chroma index**
- **BGE-M3 embedder**

### Tutoring runtime

- **Open WebUI**
- [Chat API](https://github.com/supoz9/edge-ai-education/blob/main/api-openwebui/api.py): `api-openwebui/api.py`
- [Socratic prompts](https://github.com/supoz9/edge-ai-education/blob/main/api-openwebui/prompts.py): `api-openwebui/prompts.py`
- **Ollama**

### Agent profiles

- [Demo tutors](https://github.com/supoz9/edge-ai-education/tree/main/agents): `agents`

### Other components

- **Student**

## Connections

- Student → Open WebUI: asks through
- Open WebUI → Chat API: sends chat
- Chat API → Hybrid retrieval: requests passages
- Chat API → Socratic prompts: builds messages
- Chat API → Ollama: requests generation
- Chat API → Open WebUI: returns answer
- Referentiel → Corpus ingestion: read
- Courses → Corpus ingestion: read
- TP statements → Corpus ingestion: read
- Datasheets → Corpus ingestion: read
- Restricted solutions → Corpus ingestion: excluded by default
- Restricted hints → Corpus ingestion: excluded by default
- Corpus ingestion → Metadata and chunks: parses and chunks
- Corpus ingestion → BGE-M3 embedder: encodes chunks
- Corpus ingestion → Chroma index: writes vectors
- Hybrid retrieval → BGE-M3 embedder: encodes query
- Hybrid retrieval → Chroma index: queries index
