27 lines
792 B
Bash
Executable File
27 lines
792 B
Bash
Executable File
#!/bin/bash
|
|
# WEVIA RAG Auto-Ingest — runs every 30 minutes
|
|
# Ingests new KB entries into Qdrant via embedding
|
|
LOG=/tmp/wevia-rag-ingest.log
|
|
echo "$(date): RAG ingest starting" >> $LOG
|
|
|
|
# Check if Qdrant is up
|
|
curl -sf http://127.0.0.1:6333/collections > /dev/null 2>&1
|
|
if [ $? -ne 0 ]; then
|
|
echo "$(date): Qdrant DOWN, skipping" >> $LOG
|
|
exit 1
|
|
fi
|
|
|
|
# Run PHP ingest if exists
|
|
if [ -f /var/www/html/api/kb-ingestor.php ]; then
|
|
timeout 120 php /var/www/html/api/kb-ingestor.php >> $LOG 2>&1
|
|
echo "$(date): KB ingest done" >> $LOG
|
|
fi
|
|
|
|
# Run vectorize if exists
|
|
if [ -f /opt/wevia-brain/wevia-vectorize.py ]; then
|
|
timeout 120 python3 /opt/wevia-brain/wevia-vectorize.py >> $LOG 2>&1
|
|
echo "$(date): Vectorize done" >> $LOG
|
|
fi
|
|
|
|
echo "$(date): RAG ingest complete" >> $LOG
|