Info:: RAG avec open-webui

De wiki_pcwiki2
Aller à la navigationAller à la recherche

KEYWORDS: RAG, OPEN-WEBUI, PCWIKI, SRV18

Le 20/04/2026:
Et oui, le rêve est devenu réalité, j'ai un RAG sur pcwiki avec une intégration automatique de toutes les nouvelles pages wiki chaque heure.
[[Info RAG crontab]]
srv18::crontab:
# Toutes les heures, intégration d’éventuels ajouts pcwiki dans le RAG 'wiki PCStreet':
0 * * * * /root/IA/wiki-sync/run_sync.sh >> /root/IA/wiki-sync/cron.log 2>&1
#!/bin/bash
set -euo pipefail

SYNC_DIR="/root/IA/wiki-sync"
VENV_DIR="/root/IA/open-webui.debian12/venv"
MAIL_TO="pchevalier@pcstreet.fr"

set -a
source "$SYNC_DIR/.env"
set +a

source "$VENV_DIR/bin/activate"
python3 "$SYNC_DIR/wiki_sync.py" "$@" 2>&1 | tee "$SYNC_DIR/last_run.log"

if grep -q "Synchronisé" "$SYNC_DIR/last_run.log"; then
    PAGES=$(grep "Synchronisé" "$SYNC_DIR/last_run.log" | sed 's/.*Synchronisé: /  - /')
    COUNT=$(grep -c "Synchronisé" "$SYNC_DIR/last_run.log")
    {
        echo "To: $MAIL_TO"
        echo "From: pchevalier@pcstreet.fr"
        echo "Subject: [Wiki Sync] $COUNT page(s) synchronisee(s)"
        echo "Content-Type: text/plain; charset=UTF-8"
        echo ""
        echo "Synchronisation wiki terminee le $(date '+%d/%m/%Y a %H:%M')"
        echo ""
        echo "Pages mises a jour dans le RAG wiki PCStreet: ($COUNT) :"
        echo "$PAGES"
        echo ""
        echo "-- wiki_sync sur srv18"
    } | ssmtp "$MAIL_TO"
fi