# Crawl4AI - Intégration Effi Server Intégration du service **Crawl4AI** au docker-compose existant de `/root/effi/`. ## Architecture ``` ┌─────────────────────────────────────────────────────────┐ │ effi-server │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ OpenWebUI │ │ Qdrant │ │ Crawl4AI │ │ │ │ :3000 │ │ :6333 │ │ :11235 │ │ │ └──────┬──────┘ └─────────────┘ └──────┬──────┘ │ │ │ │ │ │ └──────────────────────────────────┘ │ │ Réseau: effi-net │ └─────────────────────────────────────────────────────────┘ ``` ## Installation ### Option 1 : Script automatique (recommandé) Sur **effi-server**, dans `/root/effi/` : ```bash cd /root/effi # Copier le script add-to-effi.sh ici # Puis exécuter : bash add-to-effi.sh ``` Le script va : 1. Sauvegarder ton docker-compose.yml 2. Ajouter le service Crawl4AI 3. Démarrer le service 4. Vérifier qu'il fonctionne ### Option 2 : Manuel 1. **Sauvegarder** le docker-compose existant : ```bash cd /root/effi cp docker-compose.yml docker-compose.yml.backup ``` 2. **Éditer** `docker-compose.yml` et ajouter avant la section `networks:` : ```yaml # ───────────────────────────────────────────────────────── # 8. CRAWL4AI - Web Scraping pour OpenWebUI # → http://localhost:11235 (accessible depuis OpenWebUI) # ───────────────────────────────────────────────────────── crawl4ai: image: unclecode/crawl4ai:basic container_name: crawl4ai restart: unless-stopped ports: - "11235:11235" environment: - CRAWL4AI_API_TOKEN=${CRAWL4AI_API_TOKEN:-} - MAX_CONCURRENT_TASKS=3 - CRAWL4AI_ENABLE_GPU=false volumes: - /dev/shm:/dev/shm deploy: resources: limits: memory: 2G reservations: memory: 512M healthcheck: test: ["CMD", "curl", "-f", "http://localhost:11235/health"] interval: 30s timeout: 10s retries: 3 start_period: 60s networks: - effi-net ``` 3. **Démarrer** le service : ```bash docker-compose up -d crawl4ai ``` ## Configuration OpenWebUI 1. Aller dans **Admin Panel** → **Tools** → **Web Search and Crawl** → ⚙️ 2. **Crawl4AI Base URL** : `http://localhost:11235` 3. **Timeout** : `30000` 4. Activer le Tool ✅ ## Vérification ```bash # Sur effi-server curl http://localhost:11235/health # Résultat attendu : {"status":"healthy"} ``` ## Test Dans OpenWebUI : > *"Effi, cherche les dernières nouvelles sur Linux et résume-moi un article"* ## Troubleshooting **Le service ne démarre pas** : ```bash docker logs crawl4ai docker-compose ps ``` **Timeout** : Augmenter la valve à `60000` dans OpenWebUI **Mémoire** : Le service est limité à 2GB (suffisant pour la plupart des sites) ## Fichiers - `crawl4ai-service-to-add.yml` - Contenu à ajouter au docker-compose - `add-to-effi.sh` - Script d'installation automatique - `README.md` - Cette documentation --- *Intégration créée pour la stack Effi existante*