# osiris-sio/sae-ia-groupe7 architecture

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

- Interactive diagram: https://gitdiagram.com/osiris-sio/sae-ia-groupe7
- Repository: https://github.com/osiris-sio/sae-ia-groupe7

## Overview

This is a French-language document search application: users submit a query in Gradio and choose lexical, semantic, or hybrid retrieval. For indexing, the service extracts supported document formats, chunks their text, generates embeddings, and writes aligned records to vector and lexical stores. Search results are formatted for the UI; hybrid mode combines rankings with RRF. The README documents these capabilities, while the source excerpts show the main calls. The LLM client’s documented generation features are represented separately; no sampled source connects them to the search workflow.

Main entry points: [`src/recherche_fichiers/service/core.py`](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/service/core.py) (Search orchestrator), [`src/recherche_fichiers/ollama_client/base.py`](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/ollama_client/base.py) (Ollama HTTP client), [`src/recherche_fichiers/ollama_client/embedding.py`](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/ollama_client/embedding.py) (Embedding client), [`src/recherche_fichiers/config.py`](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/config.py) (Application settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_gradio["Gradio search UI<br/>[ui_gradio.py]"]
end

subgraph group_service["Search and indexing"]
  node_core["Search orchestrator<br/>[core.py]"]
  node_parsing["Parsing and chunking<br/>[utils.py]"]
  node_config["Application settings<br/>[config.py]"]
end

subgraph group_models["Ollama clients"]
  node_embedding["Embedding client<br/>[embedding.py]"]
  node_llm["LLM features<br/>[llm.py]"]
  node_http["Ollama HTTP client<br/>[base.py]"]
end

subgraph group_stores["Search storage"]
  node_vector[("Vector store<br/>[base.py]")]
  node_lexical[("Lexical store<br/>[base.py]")]
end

node_user(("Search user"))
node_ollama["Ollama server"]

node_user -->|"enters query"| node_gradio
node_gradio -->|"submits search"| node_core
node_core -->|"loads and chunks"| node_parsing
node_core -->|"requests embeddings"| node_embedding
node_core -->|"writes and searches"| node_vector
node_core -->|"writes and searches"| node_lexical
node_core -->|"formats results"| node_parsing
node_embedding -->|"uses HTTP client"| node_http
node_llm -->|"uses HTTP client"| node_http
node_http -->|"sends API requests"| node_ollama
node_http -->|"reads settings"| node_config
node_embedding -->|"reads settings"| node_config
node_llm -->|"reads settings"| node_config

click node_gradio "https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/ui_gradio.py"
click node_core "https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/service/core.py"
click node_parsing "https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/service/utils.py"
click node_config "https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/config.py"
click node_embedding "https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/ollama_client/embedding.py"
click node_llm "https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/ollama_client/llm.py"
click node_http "https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/ollama_client/base.py"
click node_vector "https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/storage/base.py"
click node_lexical "https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/storage/base.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_gradio,node_user toneBlue
class node_core,node_parsing,node_config toneAmber
class node_embedding,node_llm,node_http,node_ollama toneMint
class node_vector,node_lexical toneRose
```

## Components

### User interface

- [Gradio search UI](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/ui_gradio.py): `src/recherche_fichiers/ui_gradio.py`

### Search and indexing

- [Search orchestrator](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/service/core.py): `src/recherche_fichiers/service/core.py`
- [Parsing and chunking](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/service/utils.py): `src/recherche_fichiers/service/utils.py`
- [Application settings](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/config.py): `src/recherche_fichiers/config.py`

### Ollama clients

- [Embedding client](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/ollama_client/embedding.py): `src/recherche_fichiers/ollama_client/embedding.py`
- [LLM features](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/ollama_client/llm.py): `src/recherche_fichiers/ollama_client/llm.py`
- [Ollama HTTP client](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/ollama_client/base.py): `src/recherche_fichiers/ollama_client/base.py`

### Search storage

- [Vector store](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/storage/base.py): `src/recherche_fichiers/storage/base.py`
- [Lexical store](https://github.com/osiris-sio/sae-ia-groupe7/blob/main/src/recherche_fichiers/storage/base.py): `src/recherche_fichiers/storage/base.py`

### Other components

- **Search user**
- **Ollama server**

## Connections

- Search user → Gradio search UI: enters query (evidence: `src/recherche_fichiers/ui_gradio.py`)
- Gradio search UI → Search orchestrator: submits search (evidence: `src/recherche_fichiers/ui_gradio.py`)
- Search orchestrator → Parsing and chunking: loads and chunks (evidence: `src/recherche_fichiers/service/core.py`)
- Search orchestrator → Embedding client: requests embeddings (evidence: `src/recherche_fichiers/service/core.py`)
- Search orchestrator → Vector store: writes and searches (evidence: `src/recherche_fichiers/service/core.py`)
- Search orchestrator → Lexical store: writes and searches (evidence: `src/recherche_fichiers/service/core.py`)
- Search orchestrator → Parsing and chunking: formats results (evidence: `src/recherche_fichiers/service/core.py`)
- Embedding client → Ollama HTTP client: uses HTTP client (evidence: `src/recherche_fichiers/ollama_client/embedding.py`)
- LLM features → Ollama HTTP client: uses HTTP client (evidence: `src/recherche_fichiers/ollama_client/llm.py`)
- Ollama HTTP client → Ollama server: sends API requests (evidence: `src/recherche_fichiers/ollama_client/base.py`)
- Ollama HTTP client → Application settings: reads settings (evidence: `src/recherche_fichiers/ollama_client/base.py`)
- Embedding client → Application settings: reads settings (evidence: `src/recherche_fichiers/ollama_client/embedding.py`)
- LLM features → Application settings: reads settings (evidence: `src/recherche_fichiers/ollama_client/llm.py`)
