# Architecture générale

### Schéma d'architecture générale de Sophia

<div class="shrink-0 ltr:mr-3 rtl:ml-3 hidden @lg:flex mt-1  svelte-1u5gq5j" id="bkmrk-">![profile](https://sophia.vincennes.fr/favicon.png)</div>[![image-1759053377657.png](https://formagent.vincennes.fr/uploads/images/gallery/2025-09/scaled-1680-/image-1759053377657.png)](https://formagent.vincennes.fr/uploads/images/gallery/2025-09/image-1759053377657.png)

Pour modifier l'image : [https://onlyoffice.vincennes.fr/Products/Files/DocEditor.aspx?fileid=40912](https://onlyoffice.vincennes.fr/Products/Files/DocEditor.aspx?fileid=40912)

<div class="flex-auto w-0 pl-1 relative" id="bkmrk-today-at-19%3A45"><div class="self-center font-semibold line-clamp-1 flex gap-1 items-center"><div class="flex">  
</div><div class="self-center text-xs font-medium first-letter:capitalize ml-0.5 translate-y-[1px] invisible group-hover:visible transition text-gray-400"><div class="flex"><span class="line-clamp-1">L'architecture Today at 19:45</span></div></div></div><div><div class="chat-assistant w-full min-w-full markdown-prose svelte-1u5gq5j"><div><div class="text-sm flex flex-col w-full">L'architecture est basée sur la documentation d'openwebui : [https://docs.openwebui.com/](https://docs.openwebui.com/).</div></div></div></div></div><div class="w-full flex flex-col relative" id="bkmrk--2"><div class="w-full flex flex-col relative"><div>  
- - - - - -

</div></div></div>### Tableau récapitulatif des conteneurs - visualisation par Portainer

<div class="w-full flex flex-col relative" id="bkmrk-conteneur-%2F-service-"><div><div class="relative w-full group mb-2"><div class="scrollbar-hidden relative overflow-x-auto max-w-full"><table class="w-full text-sm text-left text-gray-500 dark:text-gray-400 max-w-full rounded-xl"><thead class="text-xs text-gray-700 uppercase bg-white dark:bg-gray-900 dark:text-gray-400 border-none"><tr class=""><th class="px-2.5! py-2! cursor-pointer border-b border-gray-100! dark:border-gray-800!" scope="col" style="text-align: null;"><div class="gap-1.5 text-left"><div class="shrink-0 break-normal">**Conteneur / Service**</div></div></th><th class="px-2.5! py-2! cursor-pointer border-b border-gray-100! dark:border-gray-800!" scope="col" style="text-align: null;"><div class="gap-1.5 text-left"><div class="shrink-0 break-normal">**Stack / Origine**</div></div></th><th class="px-2.5! py-2! cursor-pointer border-b border-gray-100! dark:border-gray-800!" scope="col" style="text-align: null;"><div class="gap-1.5 text-left"><div class="shrink-0 break-normal">**Rôle**</div></div></th><th class="px-2.5! py-2! cursor-pointer border-b border-gray-100! dark:border-gray-800!" scope="col" style="text-align: null;"><div class="gap-1.5 text-left"><div class="shrink-0 break-normal">**Port hôte (local)**</div></div></th><th class="px-2.5! py-2! cursor-pointer border-b border-gray-100! dark:border-gray-800!" scope="col" style="text-align: null;"><div class="gap-1.5 text-left"><div class="shrink-0 break-normal">**Port conteneur**</div></div></th><th class="px-2.5! py-2! cursor-pointer border-b border-gray-100! dark:border-gray-800!" scope="col" style="text-align: null;"><div class="gap-1.5 text-left"><div class="shrink-0 break-normal">**URL d’accès depuis Sophia**</div></div></th></tr></thead><tbody><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`openwebui`</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Sophia</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Interface principale</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">3002</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">8080</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`https://sophia.vincennes.fr`</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`qdrant`</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Sophia</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Base vectorielle (RAG)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">6333, 6334</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">6333, 6334</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Interne (via API locale)</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`postgres`</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Sophia</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Base de données d’application</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">5437</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">5432</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Interne</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`sophia-nodered-openwebui-1`</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Sophia</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Automatisation, intégration des services</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">1886</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">1880</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`http://sp26.vincennes.fr:1886`</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`infomaniak-xinference-1`</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Infomaniak (tunnel SSH)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Tunnel vers xinference (reranking)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">9995</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">9998</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`http://sp26.vincennes.fr:9995`</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`infomaniak-docling-1`</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Infomaniak (tunnel SSH)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Tunnel vers docling (analyse de documents)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">5002</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">5001</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`http://sp26.vincennes.fr:5002`</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`infomaniak-portainer_agent-1`</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Infomaniak (tunnel SSH)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Agent Portainer pour supervision distante</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">9002</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">9001</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Interne (gestion Docker)</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`searxng`</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">ia-app</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Moteur de recherche web</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">8056</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">8080</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Via Node-RED (recherche)</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`firecrawl-api-1`</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">firecrawl</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Analyse de pages web (scraping intelligent)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">3003</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">3002</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`http://sp26.vincennes.fr:3003`</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`docling` (VM Infomaniak)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">-</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Analyse de documents (PDF, etc.)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">5001</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">5001</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Accès distant (via tunnel SSH depuis SP26:5002)</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">`xinference` (VM Infomaniak)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">-</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Modèle de reranking (`bge-reranker-v2-m3`)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">9997</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">9997</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max border-b border-gray-50! dark:border-gray-850!"><div class="break-normal">Accès distant (via tunnel SSH depuis SP26:9995)</div></td></tr><tr class="bg-white dark:bg-gray-900 text-xs"><td class="px-3! py-2! text-gray-900 dark:text-white w-max "><div class="break-normal">`portainer_agent` (VM Infomaniak)</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max "><div class="break-normal">-</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max "><div class="break-normal">Agent Docker pour supervision</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max "><div class="break-normal">9001</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max "><div class="break-normal">9001</div></td><td class="px-3! py-2! text-gray-900 dark:text-white w-max "><div class="break-normal">Accès distant (via tunnel SSH depuis SP26:9002)</div></td></tr></tbody></table>

</div></div></div></div>### Réglages dans l’interface administrateur - visualisation par Openwebui

#### **1. Menu Connexions**

- **URL** : `https://sophia.vincennes.fr/admin/settings/connections`
- **Fonction** : Gestion des connexions aux modèles IA hébergés sur Infomaniak.
- **Détails** : 
    - Affiche l’état de disponibilité des endpoints IA (texte, audio, image).
    - Aucune action de configuration possible directement : en cas de problème, contact avec le support requis.
    - Vérification de la connectivité aux API distantes.

<div class="my-2" id="bkmrk--4">  
</div>#### **2. Menu Documents**

- **URL** : `https://sophia.vincennes.fr/admin/settings/documents`
- **Fonction** : Configuration du traitement des documents (analyse, embedding, reranking).
- **Paramètres** : 
    - **Analyse de documents** :  
        → URL : `http://sp26.vincennes.fr:5002/`  
        → Connecté au service **docling** via tunnel SSH.
    - **Embedding** :  
        → URL : `http://sp26.vincennes.fr:1886/`  
        → Passerelle via **Node-RED**, qui relaye vers le modèle `bge_multilingual_gemma2` sur Infomaniak.  
        → Utilisation de Node-RED pour limiter et réguler les appels API.
    - **Reranking (RAG)** :  
        → URL : `http://sp26.vincennes.fr:9995/v1/rerank`  
        → Connecté au modèle `bge-reranker-v2-m3` via **xinference** sur Infomaniak (tunnel SSH).

<div class="my-2" id="bkmrk--5">  
</div>#### **3. Menu Recherche web**

- **URL** : `https://sophia.vincennes.fr/admin/settings/web`
- **Fonction** : Configuration de la recherche web et de l’analyse des résultats.
- **Paramètres** : 
    - **Recherche** :  
        → URL : `http://sp26.vincennes.fr:1886/search?q=<query>`  
        → Passerelle via **Node-RED**, qui interroge **searxng**.  
        → Node-RED assure la traduction de la requête en français si nécessaire.
    - **Analyse des pages** :  
        → URL : `http://sp26.vincennes.fr:3003/`  
        → Envoi des URLs récupérées vers **Firecrawl** pour extraction de contenu structuré.

<div class="my-2" id="bkmrk--6">  
</div>#### **4. Menu Interface utilisateur**

- **Fonction** : Génération automatique de métadonnées pour améliorer l’expérience utilisateur.
- **Utilisation** : 
    - Appels aux **API Infomaniak** pour : 
        - Génération de **titres** pertinents.
        - Création de **tags** et de **mots-clés** pour la recherche.
    - Ces fonctionnalités enrichissent les réponses et les contenus générés.

<div class="my-2" id="bkmrk--7">  
</div>#### **5. Menu Audio**

- **URL** : `https://sophia.vincennes.fr/admin/settings/audio`
- **Fonction** : Transcription de fichiers audio en texte.
- **Paramètres** : 
    - **Transcription** :  
        → URL : `http://sp26.vincennes.fr:1886/`  
        → Utilisation de **Node-RED** pour gérer l’appel à l’API Infomaniak.  
        → Le processus est asynchrone : Node-RED surveille la tâche et renvoie le texte une fois disponible.
    - Permet de traiter des fichiers audio longs via une file d’attente.

<div class="my-2" id="bkmrk--8">  
</div>#### **6. Menu Images**

- **Fonction** : Génération d’images à partir de descriptions textuelles.
- **Paramètres** : 
    - Appel direct aux **endpoints OpenAI** (ex: DALL·E).
    - Aucun traitement local ou intermédiaire : la requête est envoyée directement à OpenAI.
    - Les images générées sont intégrées dans les réponses de l’interface.