Architecture
Quick Start: Few-Shot Examples Migration

Source: data_layer/docs/QUICK_START_MIGRATION.md

Quick Start: Few-Shot Examples Migration

πŸ“‹ What's Happening

Moving few-shot examples service from:

❌ database/few_shot_examples_training_data/

To proper locations:

βœ… apps/backend/services/few_shot_examples/    (service logic)
βœ… database/output-styles/examples/            (data)

πŸš€ Execute Migration (Easy Mode)

Option 1: Automated Script

cd /path/to/project
./scripts/migrate_few_shot_service.sh

The script will:

  1. βœ… Create backup automatically
  2. βœ… Create new directory structure
  3. βœ… Copy all files
  4. βœ… Test imports
  5. ⚠️ Prompt before archiving old structure

Option 2: Manual Step-by-Step

See EXECUTION_PLAN.md for detailed instructions

⏱️ Time Estimate

  • Automated: ~5 minutes (mostly waiting for confirmations)
  • Manual: ~60 minutes (careful review at each step)

🎯 What You'll Need to Do

Before Running

  1. Read this file
  2. Commit any uncommitted changes
  3. Be ready to review file changes

During Migration

  • βœ… Review suggested changes
  • βœ… Confirm each major step
  • βœ… Test imports work

After Migration

  • βœ… Update any imports in your code
  • βœ… Test your application
  • βœ… Run seed scripts to verify

πŸ“ Key Changes

Import Changes

# OLD
from database.few_shot_examples_training_data import FewShotExamplesAPI
 
# NEW  
from apps.backend.services.few_shot_examples import FewShotExamplesAPI

Path Changes

# OLD
Path("database/few_shot_examples_training_data/data/triage.jsonl")
 
# NEW
from apps.backend.services.few_shot_examples import config
config.SEEDS_DIR / "triage.jsonl"

βœ… Verification

After migration, verify with:

# Test imports
python3 -c "from apps.backend.services.few_shot_examples import config; print('βœ…', config.SEEDS_DIR)"
 
# Check files exist
ls -la database/output-styles/examples/seeds/
 
# Verify service
ls -la apps/backend/services/few_shot_examples/

πŸ”„ If Something Goes Wrong

Rollback

# Restore from backup
backup=$(ls -td backups/pre-migration-* | head -1)
rm -rf database/few_shot_examples_training_data/
cp -r "$backup/few_shot_examples_training_data" database/

Get Help

  1. Check EXECUTION_PLAN.md for detailed troubleshooting
  2. Review migration-dependencies.txt (created during migration)
  3. Check backup location: backups/pre-migration-*/

πŸ“Š Success Criteria

Migration complete when:

  • βœ… New service imports work: from apps.backend.services.few_shot_examples import config
  • βœ… Data files in correct location: database/output-styles/examples/seeds/*.jsonl
  • βœ… Old location archived/removed: database/few_shot_examples_training_data/
  • βœ… No old imports in code: grep -r "from database.few_shot_examples_training_data"
  • βœ… Application tests pass
  • βœ… Seed scripts work

πŸŽ“ What Gets Moved Where

Old LocationNew LocationType
database/few_shot_examples_training_data/*.pyapps/backend/services/few_shot_examples/Service code
database/few_shot_examples_training_data/data/*.jsonldatabase/output-styles/examples/seeds/Data files
database/few_shot_examples_training_data/README.mdapps/backend/services/few_shot_examples/README.mdDocs

πŸ“š Additional Resources

  • Detailed Plan: EXECUTION_PLAN.md - Step-by-step with rollback
  • Conceptual Plan: CONSOLIDATION_PLAN_REVISED.md - Architecture explanation
  • Migration Script: scripts/migrate_few_shot_service.sh - Automated execution

🚦 Ready?

# Review the script first
cat scripts/migrate_few_shot_service.sh
 
# When ready, execute
./scripts/migrate_few_shot_service.sh

The script will guide you through each step with confirmations.

Platform

Documentation

Community

Support

partnership@altsportsdata.comdev@altsportsleagues.ai

2025 Β© AltSportsLeagues.ai. Powered by AI-driven sports business intelligence.

πŸ€– AI-Enhancedβ€’πŸ“Š Data-Drivenβ€’βš‘ Real-Time