#!/bin/bash # Initial corpus build on the production node (run ON the node from ~/apps/ai-atlas). Idempotent; connectors are conditional # (ETag / content hash) so re-running only fetches what changed. Priority 0 first (labs, hub, research, providers), then the rest. set -euo pipefail cd "$(dirname "$0")/.." export PATH="/opt/homebrew/opt/postgresql@17/bin:/opt/homebrew/bin:$PATH" export DATABASE_URL=${DATABASE_URL:-postgresql+asyncpg://aiatlas:aiatlas@127.0.0.1:5432/aiatlas} export REDIS_URL=${REDIS_URL:-redis://127.0.0.1:6379/5} export AIA_DATA_DIR=${AIA_DATA_DIR:-$HOME/ai-atlas-data} export AIA_LOG_JSON=0 AIA=.venv/bin/aia $AIA migrate | tail -1 $AIA seed | tail -1 echo "== all enabled connectors, once each, in priority order" $AIA crawl --priority 9 || true $AIA quality | tail -1 $AIA stats | head -40 $AIA status