feat: Phase 2.6 edges migration to Qdrant (TKG-only architecture)
Phase 2.6.1: co_occurrence_edges migration - build_co_occurrence_edges_from_qdrant() - Qdrant embeddings → frame grouping → YOLO objects - Result: 6679 edges (vs 6701 PostgreSQL) Phase 2.6.2: face_face_edges migration - build_face_face_edges_from_qdrant() - Qdrant embeddings → frame grouping → face pairs - mutual_gaze detection preserved - Result: 6 edges (exact match) Phase 2.6.3: speaker_face_edges migration - build_speaker_face_edges_from_qdrant() - Qdrant embeddings → trace_id frame ranges - SPEAKS_AS edge creation Architecture: - All edges use Qdrant payload (no face_detections queries) - PostgreSQL fallback for empty Qdrant - Estimated 3.6x performance improvement Testing: - Playground (3003): ✓ All Phase 2.6 logs verified - Edge counts: ✓ Close match with PostgreSQL - Fallback: ✓ Working Docs: - docs_v1.0/DESIGN/TKG_PHASE2_6_EDGES_MIGRATION.md - docs_v1.0/M4_workspace/2026-06-21_phase2_6_test.md
This commit is contained in:
@@ -7,6 +7,13 @@ set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
mkdir -p logs
|
||||
|
||||
# Ensure development environment variables
|
||||
export DATABASE_SCHEMA=dev
|
||||
export MOMENTRY_SERVER_PORT=3003
|
||||
export MOMENTRY_REDIS_PREFIX=momentry_dev:
|
||||
|
||||
# Kill existing server on port 3003
|
||||
PID=$(lsof -ti :3003 2>/dev/null || true)
|
||||
if [ -n "$PID" ]; then
|
||||
@@ -15,6 +22,17 @@ if [ -n "$PID" ]; then
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
# Kill existing worker via PID file
|
||||
if [ -f logs/worker_3003.pid ]; then
|
||||
WPID=$(cat logs/worker_3003.pid)
|
||||
if kill -0 "$WPID" 2>/dev/null; then
|
||||
echo "Killing existing worker (PID: $WPID)"
|
||||
kill "$WPID" 2>/dev/null || true
|
||||
sleep 1
|
||||
fi
|
||||
rm -f logs/worker_3003.pid
|
||||
fi
|
||||
|
||||
# Build if needed
|
||||
if [ ! -f target/debug/momentry_playground ]; then
|
||||
echo "Building playground binary..."
|
||||
@@ -22,7 +40,15 @@ if [ ! -f target/debug/momentry_playground ]; then
|
||||
fi
|
||||
|
||||
# Start server
|
||||
echo "Starting momentry_playground server on port 3003..."
|
||||
echo "Starting momentry_playground server on port 3003 (DATABASE_SCHEMA=${DATABASE_SCHEMA})..."
|
||||
./target/debug/momentry_playground server --port 3003 > logs/momentry_3003.log 2>&1 &
|
||||
echo "Server started (PID: $!)"
|
||||
echo "Logs: logs/momentry_3003.log"
|
||||
|
||||
# Start companion worker
|
||||
echo "Starting momentry_playground worker (DATABASE_SCHEMA=${DATABASE_SCHEMA})..."
|
||||
nohup ./target/debug/momentry_playground worker --max-concurrent 6 --poll-interval 10 --batch-size 5 > logs/worker_3003.log 2>&1 &
|
||||
WPID=$!
|
||||
echo "$WPID" > logs/worker_3003.pid
|
||||
echo "Worker started (PID: $WPID)"
|
||||
echo "Worker logs: logs/worker_3003.log"
|
||||
|
||||
Reference in New Issue
Block a user